DROP TABLE IF EXISTS scores;
SET NAMES UTF8MB4;
CREATE TABLE scores (
id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL,
name CHAR(30) NOT NULL,
score INT NOT NULL
) DEFAULT CHARSET=UTF8MB4;
INSERT INTO scores (name, score) VALUES("Taro Yamada", 29);
INSERT INTO scores (name, score) VALUES("Taro Yamada", -12);
INSERT INTO scores (name, score) VALUES("Jiro Yamada", 27);
INSERT INTO scores (name, score) VALUES("Taro Yamada", 10);
SELECT * FROM scores
WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
id	name	score
2	Taro Yamada	-12
4	Taro Yamada	10
ALTER TABLE scores ADD KEY property (name, score);
SELECT * FROM scores
WHERE name = "Taro Yamada" AND (score >= -12 AND score < 29);
id	name	score
2	Taro Yamada	-12
4	Taro Yamada	10
DROP TABLE scores;
