Movies Rating
Opgave
Swipe to start coding
For each cinema, let's create a rating of movies: order movies in each cinema by its rating
. Display the cinema.label, movie.label, and rating as cinema
, movie
, and rating
columns. Order records by cinema.id
and rating
(starting with the best).
Løsning
9
1
2
3
4
5
select c.label as cinema, m.label as movie, m.rating as rating
from cinema as c
left join schedule as s on s.cinema_id=c.id
left join movie as m on m.id=s.movie_id
order by c.id, rating desc
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 8
9
1
No query executed yet... |
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat