Learn MYSQL MCQs

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

What is the purpose of the SQL UNION operator?

1) To combine the result sets of two or more SELECT statements

2) To combine two tables

3) To merge rows from different tables

4) To filter results from two queries

Answer : Option 1

Which function is used to calculate the sum of a numeric column?

1) SUM()

2) TOTAL()

3) ADD()

4) COUNT()

Answer : Option 1

How do you delete all records from a table without deleting the table structure?

1) TRUNCATE TABLE table_name;

2) DELETE FROM table_name;

3) REMOVE ALL FROM table_name;

4) CLEAR TABLE table_name;

Answer : Option 1

What does the SQL command GRANT do?

1) Gives privileges to a user

2) Removes privileges from a user

3) Creates a new user

4) Shows user privileges

Answer : Option 1

Which command is used to show the structure of a table?

1) DESCRIBE table_name;

2) SHOW TABLE table_name;

3) VIEW TABLE table_name;

4) STRUCTURE table_name;

Answer : Option 1

What is the purpose of the SQL WHERE clause?

1) To filter records based on specific conditions

2) To sort records

3) To group records

4) To join tables

Answer : Option 1

How can you create a new database in MySQL?

1) CREATE DATABASE database_name;

2) NEW DATABASE database_name;

3) ADD DATABASE database_name;

4) MAKE DATABASE database_name;

Answer : Option 1

Which command is used to change a user s password in MySQL?

1) ALTER USER user_name IDENTIFIED BY new_password;

2) SET USER user_name PASSWORD new_password;

3) CHANGE PASSWORD FOR user_name;

4) UPDATE USER user_name SET PASSWORD new_password;

Answer : Option 1

What is a MySQL view?

1) A virtual table based on the result set of a SELECT query

2) A physical copy of a table

3) A backup of a table

4) An index on a table

Answer : Option 1

Which SQL function is used to return the current system date?

1) CURDATE()

2) CURRENT_DATE()

3) GET_DATE()

4) NOW()

Answer : Option 1