Quiz Question
Quiz Question
Consider the following Schema Diagram for understanding the structure and relationship among entities
of a library management system database and based on this diagram a database is created that will be
shared with you. Now import the database and answer the following Queries.
[Instruction: Create a database named lirbabry on MySql Database and execute the
following query.]
1. Write a query to find the title, author name, publisher name of all
the books available in the library.
A:
2. SQL query to list the details of borrowers who do not borrow any
books yet.
A:
3. Write a query to display the name of an author who have written a book
having 'e ' as the second character.
A:
4. SQL query to list the details of borrowers who have borrowed more
than five books.
A:
5. Show the details of the book which have been borrowed most.
A:
8. Write a query to get the borrower name (firstanme and lastname), book
name and borrowing month.
A:
9. First execute the following command:
CREATE TABLE writters(
writer_id INT NOT NULL AUTO_INCREMENT,
writer_name varchar(40),
writer_address varchar(40),
PRIMARY KEY(writer_id)
);
Now, Write a SQL statement insert rows to writters table from authors
table.
A:
10. Write a query to update the portion of the phone in the borrowers table,
within the phone number the substring '337’ will be replaced by ‘999’.
A:
Good Luck!!!