如何编写mysql查询
关系代数中的SELECT book, COUNT(book) FROM booking GROUP BY book;
?
我认为Gcount(book)(booking)
但似乎不对。
我遵循Arun K Majumdar和Pritimoy Bhattacharya的数据库管理系统标准。提前谢谢。
答案 0 :(得分:0)
将您的SQL命令修改为:
select booking.book,count(booking.book) as book_count
from booking
GROUP BY booking.book
等效关系代数命令:
π booking.book, book_count γ booking.book;
COUNT(booking.book)→book_count booking
来源:http://dbis-uibk.github.io/relax/calc.htm
我希望这有帮助!