如何将Mysql查询转换为关系代数?

时间:2016-09-19 15:47:01

标签: mysql relational-algebra

如何编写mysql查询 关系代数中的SELECT book, COUNT(book) FROM booking GROUP BY book;? 我认为Gcount(book)(booking)但似乎不对。

我遵循Arun K Majumdar和Pritimoy Bhattacharya的数据库管理系统标准。提前谢谢。

1 个答案:

答案 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

我希望这有帮助!