human
Schema:
Manufacturers (Code, Name, Headquarter, Founder, Revenue)
Products (Code, Name, Price, Manufacturer)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the name of companies that do not make DVD drive.
assistant
SELECT name FROM manufacturers EXCEPT SELECT T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T1.name = 'DVD drive'
human
Find the number of manufactures that are based in Tokyo or Beijing.
assistant
SELECT count(*) FROM manufacturers WHERE headquarter = 'Tokyo' OR headquarter = 'Beijing'
human
Find the number of products for each manufacturer, showing the name of each company.
assistant
SELECT count(*) , T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code GROUP BY T2.name
human
Who is the founder of Sony?
assistant
SELECT founder FROM manufacturers WHERE name = 'Sony'
human
Find the name of product that is produced by both companies Creative Labs and Sony.
assistant
SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony'
human
How many products are not made by Sony?
assistant
SELECT COUNT( DISTINCT name ) FROM products WHERE name NOT IN ( SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = "Sony" ) ;