Using Relational AlgebraYou learned in Module 9 about Relational algebra; the theoretical language for operating on one or more relations. It forms the theoretical basis for relational databases and f
Optional Lab 9-1
2. The following is the relational algebraic expression:
student_id = 3115(Student_Grade)
The following is the SQL equivalent:
SELECT *
FROM Student_Grade
WHERE student_id = 3115;
3. The following is the relational algebraic expression:
class_id = 'Hist201' and grade != 'A'(Student_Grade)
The following is the SQL equivalent:
SELECT *
FROM Student_Grade
WHERE class_id = 'Hist201'
AND NOT grade = 'A';
5. The following is the relational algebraic expression:
name, email(Student_Info)
The following is the SQL equivalent:
SELECT name, email
FROM Student_Info;
7. The following is the relational algebraic expression:
NL_Hitters X AL_Hitters
The following is the SQL equivalent:
SELECT NL_Hitters.*, AL_Hitters.*
FROM NL_Hitters, AL_Hitters;
8. The following is the relational algebraic expression:
NL_Hitters.Home_Runs > 50 and AL_Hitters.Home_Runs > 50(NL_Hitters X AL_Hitters)
The following is the SQL equivalent:
SELECT NL_Hitters.*, AL_Hitters.*
FROM NL_Hitters, AL_Hitters
WHERE NL_Hitters.Home_Runs > 50
AND AL_Hitters.Home_Runs > 50;
10. The following is the relational algebraic expression:
state(Location) state(Property)
The following is the SQL equivalent:
SELECT state
FROM Location
UNION
SELECT state
FROM Property;
12. The following is the relational algebraic expression:
(cust_id,name (Customer)) (prop_id,cust_comment (Showings))
The following is the SQL equivalent:
SELECT Customer.cust_id, name, Showings.prop_id, Showings.cust_comment
FROM Customer, Showings
WHERE Customer.cust_id = Showings.cust_id;