Learn MYSQL MCQs

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

What does the SQL LEFT JOIN keyword do?

1) Returns all records from the left table and matched records from the right table

2) Returns all records from the right table

3) Returns records with no matching values

4) Returns all records regardless of matching

Answer : Option 1

How do you create a backup of a MySQL database?

1) mysqldump -u user -p database_name > backup.sql

2) BACKUP DATABASE database_name;

3) COPY DATABASE database_name TO backup;

4) EXPORT DATABASE database_name;

Answer : Option 1

What is the purpose of the SQL UNION operator?

1) Combines the result sets of two or more SELECT statements

2) Filters records

3) Joins tables

4) Groups records

Answer : Option 1

Which SQL statement is used to add a new row to a table?

1) INSERT INTO table_name VALUES (value1, value2);

2) ADD ROW table_name (value1, value2);

3) APPEND table_name (value1, value2);

4) INSERT ROW table_name (value1, value2);

Answer : Option 1

How do you find the length of a string in MySQL?

1) SELECT LENGTH(string_column) FROM table_name;

2) SELECT SIZE(string_column) FROM table_name;

3) SELECT STRING_LENGTH(string_column) FROM table_name;

4) SELECT COUNT(string_column) FROM table_name;

Answer : Option 1

What is the default storage engine for MySQL?

1) InnoDB

2) MyISAM

3) MEMORY

4) CSV

Answer : Option 1

How can you delete a record from a table?

1) DELETE FROM table_name WHERE condition;

2) REMOVE FROM table_name WHERE condition;

3) DROP FROM table_name WHERE condition;

4) CLEAR FROM table_name WHERE condition;

Answer : Option 1

What is the purpose of the SQL DISTINCT keyword?

1) To return unique values

2) To filter records

3) To sort results

4) To group records

Answer : Option 1

Which function is used to return the current date in MySQL?

1) CURRENT_DATE()

2) GET_DATE()

3) NOW()

4) TODAY()

Answer : Option 1

What is the function of the SQL AVG() function?

1) Calculates the average value

2) Finds the maximum value

3) Counts the number of rows

4) Calculates the sum

Answer : Option 1