Question

Consider a “Library Management System” which keeps the following tables: Book (isbn-no, book-title, author, publisher, edition, year-of-copyright) BookAccession (accession-no, isbn-no, date-of-purchase) Members (m-id, m-name, m-address, m-phone). Issue-return (accession-no, m-id, expected-date-of-return, actual-date-of-return) 7 Please note that a member can be issued a book for a period of 15 days. The actual-date-of-return is kept blank for the books that have not been returned. Write and run the following SQL queries on the tables:

(i) Find the m-id and m-name of the members who have got maximum number of un-returned books

(ii) List the book details along with the number of copies for that book in the library (issued or notissued both)

(iii) Find the names of all those students who have got all the books issued to him of the author named “ABC” .

(iv) Find the books that are expected to be returned in this week.

(v) Find those members who have not got any book issued to him/her during last six months.

15 Sep 2022
Answer :
Word Count : 629

(i) To find the m-id and m-name of the members who have got the maximum number of un-returned books, we can use the following SQL query:


SELECT i.m-id, m.m-name, COUNT(*) AS num_unreturned_books
FROM Issue_return i
INNER JOIN Members m ON i.m-id = m.m-id
WHERE i.actual-date-of-return IS NULL
GROUP BY i.m-id, m.m-name
HAVING COUNT(*) = (SELECT MAX(num_unreturned_books_count) FROM (SELECT COUNT(*) AS num_unreturned_books_count FROM Issue_return WHERE actual-date-of-return IS NULL GROUP BY m-id) AS unreturned_books_counts)
This query first joins the Issue_return and Members tables based on the m-id column. It then filters the rows where the actual-date-of-return column is NULL, i.e., the books have not been returned. It groups the results by m-id and m-name, and counts the number of _______ _____ ______ ___ ___ ______ _____ _________ _____ ____ ___ _________.
_________ _________ _____ _________ ________.
__________ _______ ___ ____ __________ ___ ______ _______ ________ ___.
_________ ________ ___ ________ _______.
_________ _______ ___ ___ ___ _____ _________ _____ ________ _________ __________.
__________ ____ ____ ______ ________ ____ ____ _______ ___ ____ __________.
_____ _______ ______ ___ _______ _________ _______.
___ ___ ______ _____ ____.
___ __________ __________ ____ ________ ______ ____ ______ _____ __________ _______.
______ ____ _____ ______ __________.
______ ________ _____ ______ ____ _________ _____ ____.
___ ___ _________ _______ _________ _______ ___ _____ _____ _______ ___.
_______ ______ ______ __________ ________ ____ ______.
_________ ___ ___ ________ ____.
__________ _______ ______ __________ ____ _____ ________ ________ ______ ___ __________.
_____ _________ __________ ________ ______ ____ ______ _____ ________ _______.
____ ______ _______ ___ __________ _____ ___ ________.
_____ __________ ______ ________ ________ _______ ____ ____ ________ ____ ___.
_________ ______ ________ _______ ________.
_________ ______ _____ ________ ___ _________ _______ ____ ____.
____ ________ ___ __________ ____ ___ __________ __________ ______ ________ ___.
________ _________ ________ __________ _____ __________ ________ ___.
____ ___ ____ ________ __________ ________ _______ ________.
__________ ______ ________ ________ ____.
_____ ____ ___ ___ ____ __________ _________.
______ ________ _____ ____ ________ ___ _______ ______ _______ _____ ________ ________.
____ ______ ______ ___ _____ _______.
___ _____ _______ _____ ___ ___ _________.
____ ________ _________ ____ ____ ____ _________ ____.
_______ ___ ___ ___ ___ __________ ______.
______ _______ _______ _______ __________.
_____ _____ _______ _______ ______ ____ ____ ______ ________.
________ __________ _____ __________ _________ _____ _______ _________ _____ __________ __________ _____.
____ ______ ___ _________ _________.
____ ________ ______ _____ ___ __________ ____.
________ ___ ___ _________ ___ _________ _________.
_______ _______ ________ ________ ______ ________.
_______ ______ _________ __________ _______ _______.
____ _______ ___ ________ _______ _______ __________ ___ ___ ___.
______ _____ ___ __________ _______ ________.
____ __________ __________ ______ ________ _______ ______.
____ ________ ______ _______ ______ ___ _______ ____ _________.
____ _____ _________ _________ ________ ___ ________ ____ __________ ________ ___.
_____ ______ _____ _____ ______ ________ ______ ____ ______ ____ __________ ___.
___ ______ __________ ______ _________.
_________ _______ _________ _____ ____.
_________ _______ ______ _______ ________ __________ _______ _____.
__________ ________ _____ _________ _________ ________ _____ ___.
__________ _______ ____ __________ _______ _____ ______ __________ ___.
_________ _______ _________ __________ _______ _______ __________ ____ _____ _______ ________.
_____ ___ _______ _______ __________ _____ ____.
___ ________ ____ _______ ________ ___ ________ ____ _____ __________.
________ ____ ______ _________ _____ _______ ____ _____ ___.
___ ______ _______ __________ _____ _______.
_________ ______ ________ _____ __________ ________ ___ _____ ________.
_____ ___ _________ ____ ______ ___ ________.
______ ______ ______ ____ ____ ______ _____ ____ ________ _____.
__________ _________ ______ ____ _________ ______ _______ ___.
_____ _______ ____ _____ _____ __________ ___.
__________ _______ __________ ______ ____.
__________ ________ __________ ______ __________ __________ ________ ___ _________ _________.
____ __________ __________ _____ ___ ___ ________ _____ ______.
_________ _____ ______.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Consider a “Library Management System” which keeps the fol
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→