Question: What is the relational algebra from the question below. I already have the SQL and need it in relational algebra. Student (snum: integer, sname: string,

What is the relational algebra from the question below. I already have the SQL and need it in relational algebra.

Student (snum: integer, sname: string, major: string, level: string, age: integer)

Class (name: string, meets_at: time, room: string, fid: integer)

Enrolled (snum: integer, cname: string)

Faculty (fid: integer, fname: string, deptid: integer)

4. Find the names of all students who are enrolled in two classes that meet at the same time.

SQL:

SELECT DISTINCT S.sname

FROM Student S

WHERE S.snum IN (SELECT E1.snum

FROM Enrolled E1, Enrolled E2, Class C1, Class C2

WHERE E1.snum = E2.snum AND E1.cname <> E2.cname

AND E1.cname = C1.name

AND E2.cname = C2.name AND C1.meets_at = C2.meets_at);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!