Professional Documents
Culture Documents
Advanced: Novice
Advanced: Novice
Back to Results
Question 12
Advanced
Intermediate
Novice
1 2 3 4 5 6 7 8 9 10 11 12 13
In your code, you forgot to include the INNER JOIN clause to specify how the two tables (bike_trips and bike) are related.
Without this clause, the database does not know how to join the tables together, resulting in the incorrect output of [object
Object],[object Object]. By adding the ON t.bike_ID = b.bike_ID clause in the correct code, you are telling the database
to match the bike_ID column in both tables to properly join the data and produce the desired output.
Yes No
Join the bike_trips table with bike but only keep all the matched records.
-- 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 |
https://assessment-v2.datacamp.com/15e09043-62d9-4b3e-a10c-638c40a5ea4c/review?returnUrl=https%253A%252F%252Fapp.datacamp.com%252Fcertificat… 1/2
23:45 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