MySQL Forums
Forum List  »  Newbie

Re: How to view number of available books in a library DB?
Posted by: Andreianu Georgiana
Date: December 14, 2021 02:35AM

I don't think it would help much as it is not written in english, that's why i didn't attach it in the first place.
Basically there is the book table with info like id, title, author, etc and number of books per title, and then there is the lent books table with id of the reader, id of the book, lending date and return date. If there is no return date then of course the book has not been returned, there are some books with a date value for returnDate and some have NULL for returnDate.
I need to count those with NULL for returnDate, and show the book table with a new column that show the available number of books. For each title the available number of books is gonna be total - notReturned.
And i need to do all of this in one single query, i can't write more :(

Options: ReplyQuote

Written By
Re: How to view number of available books in a library DB?
December 14, 2021 02:35AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.