Advanced: Novice

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

23:35 21/04/2024 Skill Assessment

Back to Results

Data Management in SQL (PostgreSQL)

Question 1

Advanced

Intermediate

Novice

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

There was an error in your code BETA

Powered By
Explain Error

Add the rows from the movie_2010 table to movie_2000 but remove the duplicates.

-- movie_2000
| year | title | budget |
|---------|--------------------------|--------------|
| 2000 | Mission: Impossible 2 | 125000000 |
| 2004 | Shrek 2 | 150000000 |
| 2008 | The Dark Knight | 185000000 |
| 2010 | Toy Story 3 | 200000000 |

-- movie_2010
| year | title | budget |
|---------|------------------------------------|----------------|
| 2010 | Toy Story 3 | 200000000 |
| 2014 | Transformers: Age of Extinction | 210000000 |
| 2015 | Star Wars: The Force Awakens | 245000000 |
| 2016 | Captain America: Civil War | 250000000 |

Complete the code to return the output

SELECT *
FROM movie_2000
ORDER BY year;
UNION
SELECT *
FROM movie_2010
ORDER BY year;

Expected Output Your Output

year title budget year title budget

2000 Mission: Impossible 2 125000000 2010 Toy Story 3 200000000

2004 Shrek 2 150000000 2014 Transformers: Age of Extinction 210000000

2008 The Dark Knight 185000000 2015 Star Wars: The Force Awakens 245000000

2010 Toy Story 3 200000000 2016 Captain America: Civil War 250000000

2014 Transformers: Age of Extinction 210000000

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

year title budget

2015 Star Wars: The Force Awakens 245000000

2016 Captain America: Civil War 250000000

Incorrect answer

Difficulty MEDIUM

Skill Joining Multiple Datasets

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