Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions