human
Schema:
device (Device_ID, Device, Carrier, Package_Version, Applications, Software_Platform)
shop (Shop_ID, Shop_Name, Location, Open_Date, Open_Year)
stock (Shop_ID, Device_ID, Quantity)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of the shops?
assistant
SELECT Shop_Name FROM shop;
human
Which shop has some devices in stock?
assistant
SELECT Shop_Name FROM shop WHERE Shop_ID IN ( SELECT Shop_ID FROM stock );
human
What about no device at all?
assistant
SELECT Shop_Name FROM shop WHERE Shop_ID NOT IN ( SELECT Shop_ID FROM stock ) ;