3570-find-books-with-no-available-copies

DevGod
Elf Vtuber
SELECT A.book_id,A.title,A.author,A.genre,A.publication_year, C.current_borrowersFROM library_books as AJOIN(SELECT book_id,COUNT(book_id) as current_borrowersFROM borrowing_records as BWHERE return_date IS NULLGROUP BY book_id) as CUSING (book_id)WHERE C.current_borrowers = A.total_copiesORDER BY C.current_borrowers desc, A.title