I will try to explain what I need by using an example.

I have 2 tables.
1st table (City) has 2 columns: cityID, city
2nd table (Student) has 3 columns: studentID, name, address

The 1st table, in the city column, has names cities.
The 2nd table, in the address column, has the full address - city, street and house number.

I want to create a query, that will result in a table that will have 4 columns - the 3 columns from the Student table, and also the cityID corresponding to that student's address.

For this to happen as I understand it (and here lies my problem), the query needs to take the data from cityID, search in the address column string if it exists and if it does enter the information in the new column.

Now, I only know the basics in SQL, so whoever responds to this if possible give an example, and try to explain what you did exactly and why.

Thanks in advance