Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started