Download as pdf or txt
Download as pdf or txt
You are on page 1of 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