0

如何为以下查询编写关系代数表达式?

select Customer_ID
from tbl_Reservation
where Customer_ID not in (select Customer_ID from tbl_Bill)
4

1 回答 1

2

像这样的东西:

excludedCustomers = π(Customer_ID)(tbl_Bill)
customerReservations= π(Customer_ID)(tbl_Reservation)
result = customerReservations- excludedCustomers

您只需要获取您想要排除的客户的预测(全部来自 tbl_Bill),对 tbl_Reservation 执行相同操作,然后从两个预测中减去就是您的答案。

于 2012-04-16T16:57:53.890 回答