The relevant table is:
TRAIN (train-code, train-type, departure-station, destination-station)
List details of trains which depart from LONDON and are destined for KENT.
The question is very simple, and I've looked everywhere for a basic answer but can't find one.
This is what I have come up with so far, but I don't know if it is correct or if AND can even be used in relational algebra:
SELECT TRAIN WHERE departure-station = 'LONDON' AND destination-station = 'KENT'
Is that correct? I can't find any information online about whether or not you can use AND for this. If this didn't work, I'm thinking my answer should be something like this:
SELECT TRAIN WHERE departure-station = 'LONDON' GIVING TABLE1
SELECT TRAIN WHERE destination-station = 'KENT' GIVING TABLE2
PROJECT TABLE1 OVER train-code GIVING TABLE3
PROJECT TABLE2 OVER train-code GIVING TABLE4
TABLE1 INTERSECT TABLE2 GIVING TABLE3
PROJECT TABLE3 OVER train-code, train-type, departure-station, destination-station GIVING RESULT
This seems like it would be too long to me, and may be incorrect anyway. Maybe I need to use a JOIN command instead? I really don't know, even though it's such a simple question. Can anyone help me?