From 90772c3fea9375dbc5d6f188c354bbe656051e67 Mon Sep 17 00:00:00 2001 From: chiara lanzi Date: Thu, 1 Jan 2026 12:53:15 +0100 Subject: [PATCH] lab solved --- lab_solved.sql | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 lab_solved.sql diff --git a/lab_solved.sql b/lab_solved.sql new file mode 100644 index 0000000..4212ccf --- /dev/null +++ b/lab_solved.sql @@ -0,0 +1,58 @@ +-- 1 +SHOW TABLES FROM sakila; +-- 2 +select * +from sakila.actor; + +select * +from sakila.film; + +select * +from sakila.customer; +-- 3 +select title +from sakila.film; + +select name as language +from sakila.language; + +select first_name +from sakila.staff; + +-- 4 +select distinct release_year +from sakila.film; + +-- 5 +select count(store_id) as n_store +from sakila.store; + +select count(staff_id) as n_employees +from sakila.staff; + +select count(film_id) as available_film +from sakila.film; + +select count(distinct rental_id) as n_rentals +from sakila.rental; + +select distinct(last_name) +from sakila.actor; + +-- 6 +select film_id, title, length +from sakila.film +order by length desc +limit 10; + +-- 7 +select actor_id, first_name, last_name +from sakila.actor +where first_name = 'SCARLETT'; + +select title, length +from sakila.film +where title like '%ARMAGEDDON%' and length > 100; + +select count(film_id) +