MySQL Database Quiz Questions

Course Name:MySQL
Chapter Name:Chapter 8 - RDBMS Concepts
Lesson Content Link:Index Types
Current Quiz Count:30
Progress
0%
Q1
True / False

MySQL supports only one type of index: the primary index.

Q2
True / False

In MySQL, a unique index does not allow duplicate values in the indexed column.

Q3
True / False

MySQL automatically creates an index on primary key columns.

Q4
True / False

MySQL full-text indexes can only be created on CHAR, VARCHAR, and TEXT columns.

Q5
True / False

In MySQL, you can create a spatial index on any data type.

Q6
True / False

MySQL supports the creation of a clustered index.

Q7
True / False

MySQL allows the creation of multiple indexes on the same column.

Q8
True / False

Composite indexes in MySQL can improve performance for queries that use any of the indexed columns.

Q9
True / False

In MySQL, a spatial index can be used with the MEMORY storage engine.

Q10
True / False

MySQL supports descending indexes, which can be created using the DESC keyword in the CREATE INDEX statement.

Q11
Single Choice

Which of the following is a type of index in MySQL?

Q12
Single Choice

What is the primary purpose of using indexes in MySQL?

Q13
Single Choice

UNIQUE INDEX

Q14
Single Choice

Which MySQL storage engine primarily uses B-Tree indexes?

Q15
Single Choice

What type of index in MySQL can improve the performance of queries involving spatial data?

Q16
Single Choice

In MySQL, which type of index is used to enforce the uniqueness of values in a column?

Q17
Single Choice

In MySQL, what is the difference between a PRIMARY KEY and a UNIQUE INDEX?

Q18
Single Choice

Which MySQL index type can be used to index a prefix of a column's value?

Q19
Single Choice

When would you use a composite index in MySQL?

Q20
Single Choice

During a MySQL certification exam, you are asked to optimize a query that frequently filters data based on two columns, first_name and last_name. Which index type should you recommend?

Q21
Multiple Choice

Identify the correct SQL statement to create a simple index on the 'email' column in a MySQL table.

SQL Code
CREATE INDEX idx_email
ON users(email);
Q22
Multiple Choice

Choose the correct SQL statement to create a unique index on the 'username' column.

SQL Code
CREATE UNIQUE INDEX idx_username
ON users(username);
Q23
Multiple Choice

Determine the correct SQL statement to create a composite index on the 'first_name' and 'last_name' columns.

SQL Code
CREATE INDEX idx_name
ON employees(first_name, last_name);
Q24
Multiple Choice

Which SQL statement correctly creates a full-text index on the 'description' column in MySQL?

SQL Code
CREATE FULLTEXT INDEX idx_description
ON articles(description);
Q25
Multiple Choice

Select the correct SQL statement to drop an index named 'idx_email' from the 'users' table.

SQL Code
DROP INDEX idx_email
ON users;
Q26
Multiple Choice

Determine the correct SQL statement to create a spatial index on the 'location' column for geographic data in MySQL.

SQL Code
CREATE SPATIAL INDEX idx_location
ON places(location);
Q27
Multiple Choice

Which SQL statement correctly creates a unique composite index on the 'email' and 'username' columns in the 'users' table?

SQL Code
CREATE UNIQUE INDEX idx_user_unique
ON users(email, username);
Q28
Multiple Choice

Identify the correct SQL statement to create a partial index on the 'active' column where only 'active' records are indexed.

SQL Code
CREATE INDEX idx_active_users
ON users(active)
WHERE active = 1;
Q29
Multiple Choice

Select the correct SQL statement to create an index on the 'created_at' column that optimizes queries for retrieving the most recent records.

SQL Code
CREATE INDEX idx_recent_records
ON orders(created_at DESC);
Q30
Multiple Choice

Which SQL statement correctly creates a hash index on the 'session_token' column in MySQL?

SQL Code
CREATE INDEX idx_session_token
ON sessions(session_token) USING HASH;