In this lab, you will be using the Sakila database of movie rentals. You have been using this database for a couple labs already, but if you need to get the data again, refer to the official installation link.
The database is structured as follows:
- Get film ratings
- Get release years
- Get all films with ARMAGEDDON in the title
- Get all films with APOLLO in the title
- Get all films which title ends with APOLLO
- Get all films with word DATE in the title
- Get 10 films with the longest title
- Get 10 the longest films
- How many films include Behind the Scenes content
- List films ordered by release year and title in alphabetical order
SELECT
DISTINCT rating
FROM
film;
SELECT
DISTINCT release_year
FROM
film;
SELECT
title
FROM
film
WHERE
title LIKE '%armageddon%';
SELECT
title
FROM
film
WHERE
title REGEXP 'apollo';
SELECT
title
FROM
film
WHERE
title REGEXP 'apollo$';
SELECT
title
FROM
film
WHERE
title REGEXP 'date';
SELECT
title,
length(title) AS titles_length
FROM
film
ORDER BY
length(title) DESC
LIMIT
10;
SELECT
title,
length
FROM
film
ORDER BY
length DESC
LIMIT
10;
SELECT
title AS 'Film Title',
special_features AS 'Films with Behind the Scenes content'
FROM
film
WHERE
special_features REGEXP 'behind the scenes';
SELECT
release_year,
title
FROM
film
ORDER BY
title ASC;