DROP TABLE IF EXISTS listing;
CREATE TABLE scores (
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
name CHAR(30) NOT NULL,
score INT NOT NULL,
INDEX property (NAME, SCORE)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
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;
id	name	score
1	Taro Yamada	29
2	Taro Yamada	-12
3	Jiro Yamada	27
4	Taro Yamada	10
REPLACE scores (id, name, score) VALUES (3, "Taro Yamada", 28);
SELECT * FROM scores;
id	name	score
1	Taro Yamada	29
2	Taro Yamada	-12
3	Taro Yamada	28
4	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
3	Taro Yamada	28
DROP TABLE scores;
