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
List the distinct carriers of phones with memories bigger than 32.
assistant
SELECT DISTINCT Carrier FROM phone WHERE Memory_in_G > 32
human
What are the memories and carriers of phones?
assistant
SELECT Memory_in_G , Carrier FROM phone
human
List the names of phones that are not on any market.
assistant
SELECT Name FROM phone WHERE Phone_id NOT IN (SELECT Phone_ID FROM phone_market)
human
List the names of phones in ascending order of price.
assistant
SELECT Name FROM phone ORDER BY Price ASC
human
Show the most frequently used carrier of the phones.
assistant
SELECT Carrier FROM phone GROUP BY Carrier ORDER BY COUNT(*) DESC LIMIT 1
human
What is the carrier of the most expensive phone?
assistant
SELECT Carrier FROM phone ORDER BY Price DESC LIMIT 1 ;