human
Schema:
city (City_ID, City, Hanzi, Hanyu_Pinyin, Regional_Population, GDP)
match (Match_ID, Date, Venue, Score, Result, Competition)
temperature (City_ID, Jan, Feb, Mar, Apr, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
hosting_city (Year, Match_ID, Host_City)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the cities which were once a host city after 2009?
assistant
SELECT T1.city FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T2.year > 2009;
human
How many cities in this table?
assistant
SELECT COUNT( distinct City ) FROM city;
human
Find average GDP of this table?
assistant
SELECT AVG ( GDP ) FROM city;
human
Most GDP in this table? | Do you mean the max GDP | Yes.
assistant
SELECT MAX( GDP ) FROM city ;