MySQL8.0 OCP最新版1Z0-908认证考试题库整理-003

原题

Choose the best answer.
Examine this statement, which executes successfully:

MySQL8.0 OCP最新版1Z0-908认证考试题库整理-003_第1张图片

You want to improve the performance of this query:
SELECT Name
FROM world.city
WHERE Population BETWEEN 1000000 AND 2000000;
Which change enables the query to succeed while accessing fewer rows?
A) ALTER TABLE world.city ADD INDEX (Name) ;
B) ALTER TABLE world.city ADD SPATIAL INDEX (Name) ;
C) ALTER TABLE world.city ADD FULLTEXT INDEX (Name) ;
D) ALTER TABLE world.city ADD FULLTEXT INDEX (Population) ;
E) ALTER TABLE world.city ADD SPATIAL INDEX (Population) ;
F) ALTER TABLE world.city ADD INDEX (Population) ;

 MySQL8.0 OCP最新版1Z0-908认证考试题库整理-003_第2张图片

解析

Answer:F
分析:
mysql> ALTER TABLE city ADD SPATIAL INDEX(Population);
ERROR 1687 (42000): A SPATIAL index may only contain a geometrical type column

你可能感兴趣的:(MySQL,学习,数据库,mysql)