0% found this document useful (0 votes)
10 views2 pages

Advanced: Novice

The document describes a SQL question about counting rows with missing vendor state values in a vendors table. The question provides sample data and asks the reader to complete a SQL query to return the correct count of rows where the vendor state is NULL.

Uploaded by

thongocanhdoan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Advanced: Novice

The document describes a SQL question about counting rows with missing vendor state values in a vendors table. The question provides sample data and asks the reader to complete a SQL query to return the correct count of rows where the vendor state is NULL.

Uploaded by

thongocanhdoan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

23:43 21/04/2024 Skill Assessment

Back to Results

Data Management in SQL (PostgreSQL)

Question 11

Advanced

Intermediate

Novice

1 2 3 4 5 6 7 8 9 10 11 12 13

https://assessment-v2.datacamp.com/15e09043-62d9-4b3e-a10c-638c40a5ea4c/review?returnUrl=https%253A%252F%252Fapp.datacamp.com%252Fcertificat… 1/2
23:43 21/04/2024 Skill Assessment

There was an error in your code BETA

In your code, you are counting the number of rows where the vendor_state is not NULL. However, in the correct code, the
condition should be vendor_state IS NULL to count the number of rows where the vendor_state is NULL. This is why your
output is not what you expected.

Was the AI Assistant helpful?

Yes No

For the vendors table, return the number of the rows with missing values in the vendor_state column.

-- vendors
| vendor_name | vendor_city | vendor_state |
|---------------------|----------------|-----------------|
| CHONZIE INC | ASHEVILLE | NC |
| ... | ... | ... |
| WEBSEDGE LIMITED | LONDON | |
| ... | ... | ... |

Complete the code to return the output

SELECT
COUNT(*)
FROM vendors
WHERE vendor_state IS NOT NULL ;
WHERE vendor_state IS NULL ;

Expected Output Your Output

count count

2 286

Incorrect answer

Difficulty MEDIUM

Skill Quality and Validation

Report Issue

https://assessment-v2.datacamp.com/15e09043-62d9-4b3e-a10c-638c40a5ea4c/review?returnUrl=https%253A%252F%252Fapp.datacamp.com%252Fcertificat… 2/2

You might also like