Kodewick
Start learning →
Basic←→0 / 70

Ticket list

#038BasicJOIN4 min

The box office wants a list of orders: the movie's name, the day, and how many seats. tickets only has a movie_id; the titles are in movies. Join the two and pick title, day and seats, in that order.

The tables
movies
idtitlegenreminutesrating
1Robot Summerfamily958
2Dark Lakehorror1106
3Space Palsfamily887
4The Long Roaddrama1429
5Laugh Trackcomedy1015
6Snow Daycomedy927
6 rows
tickets
idmovie_iddayseatsprice
11Fri240
21Sat480
32Fri125
43Sat354
54Sun260
61Sun120
75Sat236
83Sun590
8 rows
query.sql
-- your code here: JOIN movies, then pick movies.title, tickets.day, tickets.seats
SELECT day, seats
FROM tickets;
Ctrl + Enter runs too
Result

Run shows what your query gives. When it looks right, Submit.