4. A database is built in the library to catalogue books and handle book lending. Each book in the library is catalogued by author. Any number of books can be associated to an author. Each user is allowed to borrow one and only one book. The database stores information about the following entities and their relationships: User: unique reference number, name, and phone number, ● Author: unique reference number, name ● Book: unique title, category (e.g. Physics, Science,..), publication year, the user (reference) borrowing the book, the author (reference) of the book. a) Write SQL CREATE TABLE statements for these three tables. Justify your choices of keys used. b) Write SQL statements to perform the following tasks: (i) Insert a new entry in the user table (for a set of values at your choice). (ii) List the title for all books with author "Stephen King". (iii) List the names of all the authors in the database, and beside each name give the number of books published on or after 2017

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 3RP
icon
Related questions
Question
4.
A database is built in the library to catalogue books and handle book lending.
Each book in the library is catalogued by author. Any number of books can be
associated to an author. Each user is allowed to borrow one and only one book.
The database stores information about the following entities and their
relationships:
User: unique reference number, name, and phone number,
Author: unique reference number, name
Book: unique title, category (e.g. Physics, Science,..), publication year, the
user (reference) borrowing the book, the author (reference) of the book.
a) Write SQL CREATE TABLE statements for these three tables. Justify
your choices of keys used.
b) Write SQL statements to perform the following tasks:
(i) Insert a new entry in the user table (for a set of values
at your choice).
(ii) List the title for all books with author "Stephen King".
(iii) List the names of all the authors in the database, and beside
each name give the number of books published on or after 2017
Transcribed Image Text:4. A database is built in the library to catalogue books and handle book lending. Each book in the library is catalogued by author. Any number of books can be associated to an author. Each user is allowed to borrow one and only one book. The database stores information about the following entities and their relationships: User: unique reference number, name, and phone number, Author: unique reference number, name Book: unique title, category (e.g. Physics, Science,..), publication year, the user (reference) borrowing the book, the author (reference) of the book. a) Write SQL CREATE TABLE statements for these three tables. Justify your choices of keys used. b) Write SQL statements to perform the following tasks: (i) Insert a new entry in the user table (for a set of values at your choice). (ii) List the title for all books with author "Stephen King". (iii) List the names of all the authors in the database, and beside each name give the number of books published on or after 2017
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Database Architectures
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781305082168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning