Current location - Training Enrollment Network - Books and materials - The database lists the number of people who borrow books.
The database lists the number of people who borrow books.
1. Query the book number, name and department of the readers whose books have expired.

Select bor. BNO, bor. RNO, reader. Receptor destroying enzyme

Borrow Bor from readers.

Where are the readers? RNO = bor. RNO

And RDA>' 2010-12-25'

-& gt; 20 10- 12-25' is today's date, so different SQL dialects should be converted appropriately.

2. Count the number of readers in each department and display the name and quantity of the department.

Select "RDE, quantity (b.bno)" as the quantity.

Add book borrowing b from the left of reader R.

On RNO = RNO

RDE group

3. Inquire about the information of readers who have borrowed two books.

Select RNO, RN, RDE, RUP.

From the readers where RNO is located (select the number of RNOs from the borrowing group of RNO (BNO)>=2)

4. Check the library card number and name of the reader who borrows the same book in "S070 1026".

Choose BNO RNO

Borrow from

Where is BNO (choose BNO RNO =' s 070 1026' from where to borrow it)

RNO group

HAVING COUNT(BNO)=(SELECT COUNT(BNO)FROM BORROW WHERE RNO = ' s 070 1026 ')