Question: Consider a database schema with the following three relations: Books ( bid: integer, bname: string, author: string, pubyear: integer, publisher: string ) Students ( sid:

Consider a database schema with the following three relations:
Books(bid: integer, bname: string, author: string, pubyear: integer, publisher: string)
Students(sid: integer, sname: string, age: real, state: string)
Reads(sid: integer, bid: integer, year: integer)
Primary keys are underlined in each relation. A book is uniquely identified by book id (bid). Additionally, every book has an id (bid), a name (bname), an author, a publication year (pubyear), and a publishing company (publisher). A student is uniquely identified by student id (sid). In addition to id, each student has a name (sname), an age, and a state. If a student read a book, a record would be present in the Reads relation, with the students id, the books id, and the year the book was read.
Write the relational algebra expressions for the following queries:
Find the students who live in MA and they are either younger than 25 or older than 35.
Find the oldest books (hint: pubyear is min).
Find the names and authors of the newest books.
Find the names of the students who read some book in the same year when that book was published.
Find the names of the students who read all books.
Find the names and ages of the students who read all books published by penguin publishing company in any year.

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 Programming Questions!