如何爲以下查詢編寫關係代數表達式?如何爲以下查詢編寫關係代數表達式?
select Customer_ID
from tbl_Reservation
where Customer_ID not in (select Customer_ID from tbl_Bill)
如何爲以下查詢編寫關係代數表達式?如何爲以下查詢編寫關係代數表達式?
select Customer_ID
from tbl_Reservation
where Customer_ID not in (select Customer_ID from tbl_Bill)
事情是這樣的:
excludedCustomers = π(Customer_ID)(tbl_Bill)
customerReservations= π(Customer_ID)(tbl_Reservation)
result = customerReservations- excludedCustomers
你只需要得到你想要排除(全部來自tbl_Bill)客戶的投影,做tbl_Reservation相同,從兩個預測減法是你的答案。
感謝您的回答。你知道如何編寫這個查詢嗎? – Smith 2012-04-17 01:09:44
select top 1 drinkcode from tbl_order group by drinkcode order by count(*)desc – Smith 2012-04-17 01:09:50
其實我對此有疑問。你有什麼好的鏈接去研究代數表達式嗎?我一直在閱讀一些網站,但我可以找到的最好的網站是[鏈接](http://www.go4expert.com/forums/showthread.php?t=21166),它並沒有幫助我編寫前1名選擇,按數量排序(*)desc。我完全不是來自開發領域,所以請告訴我,如果你有任何良好的學習鏈接。 – Smith 2012-04-17 05:39:49
這功課嗎? – Taryn 2012-04-16 16:47:57
男子我希望我在大學時知道這個網站... – climbage 2012-04-16 16:48:29