Question: Please provide me complete answer for this with explanation. Show all necessary work. Write SQL queries for the following scenario: A library database stores information
Please provide me complete answer for this with explanation. Show all necessary work.
Write SQL queries for the following scenario:
A library database stores information about books, authors, and borrowings. The tables
are:
Books bookid title, isbn, publicationyear
Authors authorid name, nationality
BookAuthors bookid authorid primary key
Borrowings borrowingid bookid borrowerid borrowdate, returndate
Borrowerid name, address
List all books published after the year
Find the total number of books written by each author.
Retrieve the names of borrowers who currently have overdue books returndate
is null and borrowdate is before today's date
Write a query to update the publication year of all books by a specific author
identified by authorid to a new value.
Write a query that find the most borrowed books over the last month.
Write a query that returns each borrower, with the number of borrowed books,
and the percentage between the number of books she borrowed vs the highest
borrower.
Relational Schema Design
A university wants to design a database to manage student information, courses, and
enrollments.
Students have attributes like studentid name, major, and email.
Courses have attributes like courseid title, department, and credits.
Enrollments link students to courses, with attributes like enrollmentid
studentid courseid and semester.
Draw an EntityRelationship Diagram ERD for this scenario, identifying entities,
attributes, relationships, and cardinalities.
Convert the ERD into a relational schema with tables, columns, data types, and
primaryforeign keys.
Normalization Marks
Consider the following table storing information about a music store:
CDID Title Artist Genre Price Stock
Dark Side of the Moon Pink Floyd Rock $
Wish You Were Here Pink Floyd Rock $
Hotel California Eagles Rock $
Thriller Michael Jackson Pop $
Identify any normalization issues with this table. Explain why they are
problematic.
Apply normalization techniques up to rd Normal Form to decompose the table
into a set of related tables with minimal redundancy.
Serializability
Consider the following schedule of database transactions:
T: RAWA
T: RAWB
T: RA RB
Explain the concept of serializability in database transactions.
Is the given schedule serializable? If yes, demonstrate how it is equivalent to a
serial execution order. If not, explain why.
Give an example of a nonserializable schedule and explain the potential
problems it can cause.
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
