Professional Documents
Culture Documents
Advanced: Novice
Advanced: Novice
Advanced: Novice
Back to Results
Question 3
Advanced
Intermediate
Novice
1 2 3 4 5 6 7 8 9 10 11 12 13
In your code, you used UNION which removes duplicate rows from the result set. This is why you are only seeing [object Object]
as the output. To include all rows from both movie_2000 and movie_2010 tables, you should use UNION ALL instead of UNION. This
will include all rows from both tables in the result set.
Yes No
Add the rows from the movie_2010 table to movie_2000 but keep 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 |
SELECT *
FROM movie_2000
UNION
UNION ALL
SELECT *
FROM movie_2010
ORDER BY year;
https://assessment-v2.datacamp.com/15e09043-62d9-4b3e-a10c-638c40a5ea4c/review?returnUrl=https%253A%252F%252Fapp.datacamp.com%252Fcertificat… 1/2
23:37 21/04/2024 Skill Assessment
2008 The Dark Knight 185000000 2008 The Dark Knight 185000000
2014 Transformers: Age of Extinction 210000000 2015 Star Wars: The Force Awakens 245000000
2015 Star Wars: The Force Awakens 245000000 2016 Captain America: Civil War 250000000
Incorrect answer
Difficulty MEDIUM
Report Issue
https://assessment-v2.datacamp.com/15e09043-62d9-4b3e-a10c-638c40a5ea4c/review?returnUrl=https%253A%252F%252Fapp.datacamp.com%252Fcertificat… 2/2