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
Can you show me the total number of phones?
assistant
SELECT COUNT( * ) FROM phone;
human
how about the total number of different carriers?
assistant
SELECT COUNT( distinct carrier ) FROM phone;
human
Can you list the phones with carrier either Sprint or TMobile?
assistant
SELECT phone_id FROM phone WHERE Carrier = 'Sprint' OR Carrier = 'TMobile';
human
Can you please include their names?
assistant
SELECT phone_id , Name FROM phone WHERE Carrier = "Sprint" OR Carrier = "TMobile" ;