TASK 4 Filtering and sorting Query results Flashcards
1
Q
List all directors of Pixar movies (alphabetically), without duplicates
A
SELECT DISTINCT director FROM movies
ORDER BY director ASC;
2
Q
List the last four Pixar movies released (ordered from most recent to least)
A
SELECT title, year FROM movies
ORDER BY year DESC
LIMIT 4;
3
Q
List the first five Pixar movies sorted alphabetically
A
SELECT title FROM movies
ORDER BY title ASC
LIMIT 5;
4
Q
List the next five Pixar movies sorted alphabetically
A
SELECT title FROM movies
ORDER BY title ASC
LIMIT 5 OFFSET 5;