Question: SQL and pgAdmin -- 19. The census region and the number of records in the state table (name column 'num_states') for each census region. Exclude

SQL and pgAdmin

-- 19. The census region and the number of records in the state table (name column 'num_states') for each census region. Exclude ones that don't have a census region. -- Order the results from highest to lowest. -- (Note: DC is in a census region, but the territories aren't, so the sum of the counts will equal 51). -- (4 rows)

This is what I have :

SELECT census_region, COUNT(*) AS num_states FROM state WHERE census_region <> null GROUP BY census_region ORDER BY num_states DESC

It's obviously incorrect but I cant figure out the right way to set this up

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!