Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following schema that models a university library. Suppose that we have already created three SQL tables Book, Student, and OnLoan with the required

image text in transcribed

Consider the following schema that models a university library. Suppose that we have already created three SQL tables Book, Student, and OnLoan with the required columns. Whenever a student borrows a book, a row is inserted into the OnLoan table that references the unique student ID (attribute sid) and the book ID (attribute book_id). Book( book_id: string, title: string, length: int, published: date, subject: string ) Studenti sid: string, name: string ) OnLoan( book_id: string, sid: string, due_date: date ) Write SELECT queries that achieve the following tasks: A. List the title and subject of every book that has a length of at least 100 pages. B. List all columns of all books that were published in the year 2020 on the subject 'databases. C. List the title of all books that are currently on loan. D. List the names of the students that have borrowed all books on the subject 'algorithms

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago