Kodewick
Start learning →
Starter←→0 / 70

Shortest and longest

#027StarterAggregates2 min

The cinema wants its poster to say "films from … to … minutes". From the movies table, work out the smallest and the biggest minutes: the shortest in the first column, the longest in the second.

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: one column MIN(minutes), one MAX(minutes)
SELECT minutes
FROM movies;
Ctrl + Enter runs too
Result

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