Learn MYSQL MCQs

Prepare MYSQL MCQs (Multiple choice Questions) for exam and job interviews.

What is the command to display the structure of a table in MySQL?

1) DESCRIBE table_name;

2) REVEAL table_name;

3) SHOW STRUCTURE table_name;

4) DISPLAY table_name;

Answer : Option 1

Which MySQL function returns the current time?

1) CURTIME()

2) SYSDATE()

3) CURRENT_TIME()

4) NOW()

Answer : Option 1

How do you join two tables in MySQL?

1) Using the COMBINE clause

2) Using the CONNECT clause

3) Using the JOIN clause

4) Using the LINK clause

Answer : Option 3

What does the SQL keyword HAVING do?

1) Limits the number of rows returned

2) Filters records after an aggregation has been performed

3) Filters records before an aggregation is performed

4) Groups records by a specific column

Answer : Option 2

Which command is used to back up a MySQL database?

1) mysqlbackup

2) mysqlcopy

3) mysqlsave

4) mysqldump

Answer : Option 4

What is the purpose of the AUTO_INCREMENT attribute in MySQL?

1) Automatically generates a unique number for each record

2) Automatically generates a unique text string for each record

3) Automatically generates a unique time for each record

4) Automatically generates a unique date for each record

Answer : Option 1

What is the MySQL command to change the data type of a column?

1) UPDATE TABLE table_name MODIFY column_name new_data_type;

2) MODIFY TABLE table_name CHANGE column_name new_data_type;

3) ALTER TABLE table_name MODIFY column_name new_data_type;

4) CHANGE TABLE table_name MODIFY column_name new_data_type;

Answer : Option 3

How do you check the MySQL server version?

1) SHOW VERSION;

2) CHECK VERSION;

3) SELECT VERSION();

4) DISPLAY VERSION;

Answer : Option 3

Which MySQL storage engine is transaction-safe?

1) InnoDB

2) MyISAM

3) MEMORY

4) CSV

Answer : Option 1

What does the MySQL function CONCAT() do?

1) Concatenates two or more strings

2) Counts the number of characters in a string

3) Reverses a string

4) Splits a string into two or more parts

Answer : Option 1