Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions lab_solved.sql
Original file line number Diff line number Diff line change
@@ -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)