0% found this document useful (0 votes)
3 views2 pages

Quiz Question

SQL query question

Uploaded by

mhrafe420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Quiz Question

SQL query question

Uploaded by

mhrafe420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sample SQL 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:

6. Write a query to show the title and author of each book.


A:

7. Create a view for the following problem:


Show the list of those borrower who have crossed the due date.
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!!!

You might also like