Question: You are given a database with following relational schema: Student(sid, sname, dept) Enroll(StuId, cid, grade) Course(cid, dept) Primary keys are underlined, the column Enroll.StuId is
You are given a database with following relational schema:
Student(sid, sname, dept)
Enroll(StuId, cid, grade)
Course(cid, dept)
Primary keys are underlined, the column Enroll.StuId is a foreign key referencing to Student.sid, Enroll.cid is a foreign key referencing to Course.cid, Enroll.grade is a decimal representing the GPA. Course ids(Course.cid) are strings, e.g. CSE462, the column Course.dept contains just the departmental acronym, 1 e.g., CSE, indicating the departments of courses (i.e. the departments offering the courses). Write following queries using relational algebra, you can assume that theres no null, NO AGGREGATE FUNCTION SHOULD BE USED, you are encouraged to use linear notation for complex queries.

(1) Find the names of all the students who received both A grade and Agrade.
(2) Find the sids and names of all the students who are enrolled in at least one course provided by CSE department.
(3) Find the names of all the students who are enrolled in and only enrolled in the courses provided by CSE department.
(4) Find the names of all the students who are enrolled in at most one course provided by CSE department.
Symbol Operation Selectiorn Projection Join Cross-product Set-difference Union Intersection Renaming Distinct Divisiorn
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
