drop table if exists listing;
set names utf8mb4;
create table listing (
id int primary key auto_increment not null,
last_name char(30) not null,
first_name char(30) not null,
index name (last_name, first_name)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
insert into listing (last_name, first_name) values("Taro", "Yamada");
insert into listing (last_name, first_name) values("Taro", "Suzuki");
insert into listing (last_name, first_name) values("Jiro", "Yamada");
insert into listing (last_name, first_name) values("Taro", "Tanaka");
select * from listing
where last_name = "Taro" and (first_name >= "S" and first_name <= "Y");
id	last_name	first_name
2	Taro	Suzuki
4	Taro	Tanaka
drop index name on listing;
select * from listing
where last_name = "Taro" and (first_name >= "S" and first_name <= "Y");
id	last_name	first_name
2	Taro	Suzuki
4	Taro	Tanaka
create index new_name_index on listing (last_name, first_name);
select * from listing
where last_name = "Taro" and (first_name >= "S" and first_name <= "Y");
id	last_name	first_name
2	Taro	Suzuki
4	Taro	Tanaka
drop table listing;
