Your cart is currently empty!
The purpose of the following assignment is to practice writing queries using relational algebra and SQL. First, read Lab 4 notes before proceeding. Please use the relational algebra operators to write the queries, and then write the equivalent query in SQL. You will need to turn-in the lab, so either write your answers in text/word…
The purpose of the following assignment is to practice writing queries using relational algebra and SQL. First, read Lab 4 notes before proceeding. Please use the relational algebra operators to write the queries, and then write the equivalent query in SQL. You will need to turn-in the lab, so either write your answers in text/word document, or write the solutions on paper and take a photo to upload to iLearn.
Assume that the following relations exist:
BOOKS(DocId, Title, Publisher, Year) STUDENTS(StId, StName, Major, Age) AUTHORS(AName, Address)
borrows(DocId, StId, Date) has-written(DocId, AName) describes(DocId, Keyword)
The following shows the entity relationship diagram. The key elds of the relations are underlined in the ER diagram.
1
Write the following queries in relational algebra and then the equivalent
SQL query:
2