Professional Documents
Culture Documents
Nguyễn Công Thành - 19021368 - Lab08
Nguyễn Công Thành - 19021368 - Lab08
use sakila;
show index from film_text;
-- 2
-- a: 1000 rows
use sakila;
explain
select * from film
where description like "A emotional%";
-- b: 57 rows
use sakila;
create index index2 on film(description(50));
explain
select * from film
where description like "A emotional%";
-- 3
-- a: 200 * 27 = 5400 rows
use sakila;
explain
select actor.first_name, actor.last_name, film_actor.film_id from actor
straight_join film_actor on actor.actor_id = film_actor.actor_id;
-- 4
-- film * film_actor * actor = 1000 * 5 * 1 = 5000 rows
use sakila;
explain
select film.title, actor.first_name, actor.last_name from film
straight_join film_actor on film.film_id = film_actor.film_id
straight_join actor on film_actor.actor_id = actor.actor_id;