🙏 We need your help! SQLtest.online has no ads and lives only on donations. Even a small amount helps. Donate now →
SQL code copied to buffer
Task 48:

Top states by population

SQL Server 2022
Determine the top 3 states in the United States with the highest population based on the number of addresses in the Address table.
Output the table with columns StateProvince and PopulationPersentage showing the top 3 states with their corresponding population percentages (of total Addresses in United States). Order it by percentages in descending order.
Expected result Columns: 2 · Rows: 3
StateProvince PopulationPersentage

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial

By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more

The query result will appear here. Ctrl+Enter - Run query