From 18076e205d285c75db2625e4dbec00014d1e858c Mon Sep 17 00:00:00 2001 From: cristhian Date: Wed, 18 Dec 2024 17:39:52 +0100 Subject: [PATCH 1/2] week 4 lab 2 done --- movies.sql | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 movies.sql diff --git a/movies.sql b/movies.sql new file mode 100644 index 0000000..a33dd38 --- /dev/null +++ b/movies.sql @@ -0,0 +1,27 @@ +USE sakila; +SELECT * FROM actor; +SELECT * FROM film; +SELECT * FROM customer; + +SELECT title FROM film; +SELECT name AS language FROM language; +SELECT first_name FROM staff; + +SELECT DISTINCT release_year FROM film; + +SELECT COUNT(*) FROM store; +SELECT COUNT(*) FROM staff; +SELECT COUNT(DISTINCT film_id) AS available_films FROM inventory; +SELECT COUNT(*) AS rented_films FROM rental; +SELECT COUNT(DISTINCT last_name) AS distinct_actors FROM actor; + +SELECT title, length FROM film ORDER BY length DESC LIMIT 10; + +SELECT * FROM actor WHERE first_name = 'SCARLETT'; + +SELECT * FROM film +WHERE title LIKE '%ARMAGEDDON%' +AND length > 100; + +SELECT COUNT(*) FROM film +WHERE special_features LIKE '%Behind the Scenes%'; \ No newline at end of file From 46d8d2ad712d63706cb9d00f90ad27189f7b2fe1 Mon Sep 17 00:00:00 2001 From: cristhian Date: Wed, 18 Dec 2024 17:45:14 +0100 Subject: [PATCH 2/2] week 4 lab 2 done --- movies.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/movies.sql b/movies.sql index a33dd38..16eb0b0 100644 --- a/movies.sql +++ b/movies.sql @@ -10,9 +10,13 @@ SELECT first_name FROM staff; SELECT DISTINCT release_year FROM film; SELECT COUNT(*) FROM store; + SELECT COUNT(*) FROM staff; + SELECT COUNT(DISTINCT film_id) AS available_films FROM inventory; + SELECT COUNT(*) AS rented_films FROM rental; + SELECT COUNT(DISTINCT last_name) AS distinct_actors FROM actor; SELECT title, length FROM film ORDER BY length DESC LIMIT 10;