current position:Home>Database implementation, confused

Database implementation, confused

2022-02-03 02:37:27 CSDN Q & A

It is required that books cannot be borrowed repeatedly , After the borrowing operation is completed, the borrowing information can be output , Such as :“ The student number is , The reader named lent a book in time ”.
Give the ball bosses a clue




Refer to the answer 1:

Source table :
User information sheet ( Student number , full name ......)
Book borrowing status table ( Book number , The name of the book , Borrowing state , Latest borrowing time , Return date )
The goal is :
Book borrowing information record form ( Book number , The name of the book , Student number , full name , Latest borrowing time , Agreed return date )
Book borrowing information record history table ( Book number , The name of the book , Student number , full name , Latest borrowing time , Agreed return date , True return date , Time of the day )

According to this borrowing status ( Lent out -1, Returned -2) To determine whether you can borrow
If lending , Then there's nothing to borrow
1、
If not lent ( Borrowing state =2),update Book borrowing status table Field Borrowing state =1, Latest borrowing time , True return date , -- Lend
Return the books ,update Book borrowing status table Field Borrowing state =2, Latest borrowing time , True return date -- The return

2、 Book borrowing information record form Information can be provided by User information table and book borrowing status table relation join obtain

3、 Put every day's Book borrowing information record insert To Book borrowing information record history table , In this way, you can use the history table , Find personal historical borrowing data ;




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030237261019.html

Random recommended