Okay hello there I have 2 tables
Route table which has
route ID, frequency, start destination, final destination
and
Operates table which has
Proportion, Operator name, Route ID
I need to select Route id and frequency where the operator name is Arriva.
I put this SQL together which works and gets me the result but I am not sure if this is the correct way of doing it.
SELECT route_number, frequency
FROM route, operates
WHERE route_ID = route_number
AND operator_name = 'Arriva'
It is the right way, just that your first where statement is wrong:
It should be route_ID as well (at least from what you said). In order for this to work you need to give names to your tables, so SQL knows which columns you are comparing (since the names are the same from both tables). Like this: