Suppose I have the following relationships:
Branch (branchNo(PK), street, city, postcode) Staff (staffNo(PK), fName, lName, sex, branchNo(FK))
Not that this is important for this question, but PK = primary key and FK = foreign key
How to write relational algebra for the following query:
List the names of all female employees who work in Glasgow.
My attempt:
Ο Staff.sex=F & Branch.city = Glasgow (Ο fName, lName, sex, branchNo (Staff) x Ο city, branchNo (Branch))
I know that my selection (Ο) statement (SHOULD NOT BE ELIMINATED WITH SELECT) is syntactically incorrect:
ΟStaff.sex=F & Branch.city = Glasgow
How to write two choices for a different relationship? Or, in other words, how to express an SQL statement with two or more conditions in a WHERE clause in relational algebra? I used '&' but it can't be right? Should I embed one choice in another?
NOT HOMEWORK
source share