human
Schema:
phone (Name, Phone_ID, Memory_in_G, Carrier, Price)
market (Market_ID, District, Num_of_employees, Num_of_shops, Ranking)
phone_market (Market_ID, Phone_ID, Num_of_stock)
Please answer with SQL.
assistant
Sure, I understand.
human
Show me all the phone carriers.
assistant
SELECT Carrier FROM phone;
human
The ones with a phones having a price range of 700 to 900?
assistant
SELECT Carrier FROM phone WHERE Price > 700 AND Price < 900;
human
How about the ones that have phones both price less than 700 and price more than 900.
assistant
SELECT Carrier FROM phone WHERE Price < 700 INTERSECT SELECT Carrier FROM phone WHERE Price > 900;
human
What about phones with memory less than 32 and memory greater than 64?
assistant
SELECT Carrier FROM phone WHERE Memory_in_G < 32 INTERSECT SELECT Carrier FROM phone WHERE Memory_in_G > 64 ;