这些桌子看起来像这样:
Table: Shops
ShopCode ShopName
-------- --------
A Aladdin
B Backstreet
C Clerk's Store
D Debs Tool
Table: Sale
ShopCode Product
-------- -------
A Hammer
A Thermometer
A Compass
B Eraser
B Ha
我有三张表:
Product(maker, model, type)
PC(model, speed, ram, hd, price)
Laptop(model, speed, ram, hd, screen, price)
我正在努力寻找那些只卖笔记本但不卖PC的厂商。我想我已经通过以下命令实现了这一点:
select product.maker
from product
where product.maker not in
(select maker
from pc, product
where product.model = pc.model)
and prod