i’ll just get straight to the point. my database is like this
every book is stored at reading_materials and every book has its own unique Accession No no matter how many copies it has (disregard the field name ‘Copies’). when a student or personnel borrows a book, the data is inserted at the borrow table. my problem now is, how can i get the most borrowed books on the borrow table.
can someone help me pls?
my database is like this:
borrow
Trans_ID PRIMARY KEY
A_Accession_No FOREIGN KEY references reading_materials(Accession_No)
B_Student_No
DateBorrowed
DateReturned
Penalty
reading_materials
Accession_No PRIMARY KEY
Date_acquired
Title
Copyright
Available
book_author
B_Accesion_No FOREIGN KEY references reading_materials('Accession_No')
Author_ID FOREIGN KEY references author(Author_ID)
author
Author_ID PRIMARY KEY
Name
*i apologize for my bad english and if some of u won’t find this not very clear
try this:
this will select the
TOP 5and sorted from the most borrowed book.