SQL Assignments Select Functions
SQL Assignments Select Functions
Library System
Tables-
Task / Problems:
1) List all the books that are written by Author Loni and has price
less then 600.
2) List the Issue details for the books that are not returned yet.
3) Update all the blank return_date with 31-Dec-06 excluding 7005 and
7006.
4) List all the Issue details of books issued for more then 30 days.
5) List all the books that have price in range of 500 to 750 and has
category as Database.
6) List all the books that belong to any one of the following categories
Science, Database, Fiction, Management.
7) List all the members in the descending order of Penalty due on them.
8) List all the books in ascending order of category and descending order of
price.
9) List all the books that contain word SQL in the name of the book.
10) List all the members whose name starts with R or G and contains
letter I in it.
11) List the entire book name in Init cap and author in upper case in
the descending order of the book name.
12) List the Issue Details for all the books issue to member 101
with Issue_date and Return Date in following format. ‘Monday,
July, 10, 2006’.
13) List the data in the book table with category data displayed as
D for Database, S for Science, R for RDBMS and O for all the
others.
14) List all the members that became the member in the year 2006.
15) List the Lib_Issue_Id, Issue_Date, Return_Date and No of days
Book was issued.
16) Find the details of the member of the Library in the order of their
joining the library.
17) Display the count of total no of books issued to Member 101.
18) Display the total penalty due for all the members.
19) Display the total no of members
20) Display the total no of books issued
21) Display the average membership fees paid by all the members
22) Display no of months between issue date and return date for all
issues
23) Display the length of member’s name
24) Display the first 5 characters of membership_type for all members
25) Display the last day of the month of the issue date
26) List the various categories and count of books in each category.
27) List the book_No and the number of times the book is issued in the
descending order of count.
28) Find the maximum, minimum, total and average penalty amount in
the member table.
29) Display the member id and the no of books for each member that
was issued more then 2 books.
30) Display the member id, book no and no of times the same book is
issued by the member in the descending order of count.
31) Display the month and no of books issued each month in the
descending order of count.