You are on page 1of 2

23:42 21/04/2024 Skill Assessment

Back to Results

Data Management in SQL (PostgreSQL)

Question 8

Advanced

Intermediate

Novice

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

There was an error in your code BETA

In your code, you are missing the FROM clause which specifies the table from which you want to select the category column.
Without specifying the table, the SQL query does not know where to look for the category column. Additionally, you are using
ORDER BY without specifying any column to order by, which is also incorrect syntax. The correct code includes the FROM clause to
specify the table and removes the incorrect ORDER BY clause.

Was the AI Assistant helpful?

Yes No

From the fruit_2022 table, you want to return unique category values.

--fruit_2022
| category | item | variety |
|-------------|-----------|----------------------|
| fruit | apples | bramleys_seedling |
| fruit | apples | coxs_orange_group |
| fruit | apples | egremont_russet |
| ...

Complete the code to return the output

SELECT DISTINCT category


ORDER BY fruit_2022;
FROM fruit_2022;

Expected Output Your Output

column "category" does not exist


category LINE 1: SELECT DISTINCT category
^
cut_flowers

fruit

vegetable

Incorrect answer

Difficulty EASY

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

Skill Extracting & aggregating data from a database

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