Skip to content
Open
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions Lab queries 9.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
select *
from sakila.rental;

create table sakila.rentals_may like sakila.rental;

insert into sakila.rentals_may
select *
from sakila.rental
where month(rental_date) = 5;

select *
from sakila.rentals_may;

create table sakila.rentals_june like sakila.rental;
insert into sakila.rentals_june
select * from sakila.rental
where month(rental_date) = 6;
select * from sakila.rentals_june;


select customer_id, count(rental_id) as number_rentals
from sakila.rentals_may
group by customer_id
order by customer_id;


select customer_id, count(rental_id) as number_rentals
from sakila.rentals_june
group by customer_id
order by customer_id;



Loading