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:
Booksbid: integer, bname: string, author: string, pubyear: integer, publisher: string
Studentssid: integer, sname: string, age: real, state: string
Readssid: 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 or older than
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
