Skip to content
Advertisement

how to do a few queries MYSQL

enter image description here

this is my homework, i am searching. total 17 question.I couldn’t make 5 questions but i am trying, trying..

  1. list the number of books each student reads. But next to those who do not read the book write 0.
  2. Find the most read book.
  3. List students who have never barrow a book.
  4. List the book number, name and the number of times the books are borrowed in ascending order according to the book numbers. 5 List the book number of the received books, how many times the book has been borrowed (write zero “0” next to not borrowed books).

1)select s.stnname, s.stnsurname, sum(b.bookname) from student s LEFT JOIN process p on s.stnno=p.stnno LEFT JOIN book b on b.bookno=p.bookno GROUP BY s.stnname,s.stnsurname; FALSE

Advertisement

Answer

Consider the following. I’ve deliberately simplified the design, which has the effect of prohibiting the possibility that a student may borrow the same book twice…

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement