🎯 Few days left this month Support SQLTest.online and help us keep SQL practice free for everyone. Donate today →
SQL code copied to buffer
Task 195:

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
The query result will appear here. Ctrl+Enter - Run query