Ranking cities by percent of their state population in SQL
You're given the following table showing the population of various cities in the US, along with their associated states:
|New York||New York City||8300000|
Using this table, write a SQL query to return the following:
|...||...||the total population of the given city...||the percent of the total state population the given city represents...|
You can view/query the table in an interactive SQL fiddle here.
Subscribe to premium account to see the solution.Get premium now