你怎么写关系代数?

时间:2015-03-11 15:32:17

标签: relational-database relational-algebra

如何编写关系代数?假设您有以下4个表:

CLIENT(<u>ClientID</u>, ClientName, ClientPhone, ClientEmail, ClientDOB, ClientReferenceID)
DRIVER(<u>DriverID</u>, DriverName, DriverPhone, DriverEmail, DriverCity, DriverDOB)
RIDE(<u>RideID</u>, DriverID, ClientID, RideDate, RideTime, StartAddress, EndAddress, Fee, Tip)
RATING(<u>DriverID</u>, <u>ClientID</u>, RatingValue)

如何编写查询以输出所有客户端和驱动程序的名称和电子邮件。此输出中应该只有两列。我是这样写的:

πClientName,ClientEmail (CLIENT) U πDriverName,Driver (DRIVER)

你如何编写一个查询来输出所有从未骑过的司机的DriverID?

0 个答案:

没有答案