Professional Documents
Culture Documents
Advanced: Novice
Advanced: Novice
Back to Results
Question 7
Advanced
Intermediate
Novice
1 2 3 4 5 6 7 8 9 10 11 12 13
In your code, you forgot to include the JOIN condition between the bike_trips table and the bike table. Without specifying how
the two tables are related, the query will not be able to fetch the correct data. In the correct code, a LEFT JOIN is used along with
the ON clause to specify that the bike_ID from bike_trips should match the bike_ID from the bike table. This allows the query
to correctly retrieve the data from both tables based on the specified relationship.
Yes No
Join the bike_trips table with bike but keep all the records from bike_trips no matter whether they have a match in bike .
-- bike_trips
| trip_ID | duration | bike_ID |
|---------|----------|---------|
| 364 | 60 | 5000 |
| 365 | 900 | 2300 |
| 366 | 720 | 5002 |
-- bike
| bike_ID | last_date_in_use | color |
|---------|------------------|-------|
| 2300 | 2020-04-15 | blue |
| 2350 | 2020-04-15 | green |
| 3000 | 2020-04-18 | green |
364 60 5000
https://assessment-v2.datacamp.com/15e09043-62d9-4b3e-a10c-638c40a5ea4c/review?returnUrl=https%253A%252F%252Fapp.datacamp.com%252Fcertificat… 1/2
23:40 21/04/2024 Skill Assessment
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