Learn MYSQL MCQs

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

Which SQL statement is used to modify data in a database?

1) UPDATE

2) MODIFY

3) ALTER

4) CHANGE

Answer : Option 1

How do you select all columns from a table in MySQL?

1) SELECT * FROM table_name;

2) GET ALL FROM table_name;

3) SELECT ALL COLUMNS FROM table_name;

4) RETRIEVE * FROM table_name;

Answer : Option 1

What does the SQL command DELETE do?

1) Removes rows from a table

2) Deletes a table

3) Clears all data from a table

4) Removes a database

Answer : Option 1

Which SQL function retrieves the minimum value from a column?

1) MIN()

2) LEAST()

3) LOWEST()

4) MINIMUM()

Answer : Option 1

What is the purpose of the SQL statement INSERT INTO?

1) To add new records to a table

2) To delete records from a table

3) To update existing records

4) To retrieve records

Answer : Option 1

How do you change the structure of an existing table?

1) ALTER TABLE table_name;

2) MODIFY TABLE table_name;

3) UPDATE TABLE table_name;

4) CHANGE TABLE table_name;

Answer : Option 1

Which command is used to create an index on a column?

1) CREATE INDEX index_name ON table_name (column_name);

2) NEW INDEX index_name FOR table_name (column_name);

3) ADD INDEX index_name TO table_name (column_name);

4) DEFINE INDEX index_name ON table_name (column_name);

Answer : Option 1

What does the SQL keyword UNION do?

1) Combines the results of two SELECT statements

2) Merges two tables

3) Joins two columns

4) Filters two queries

Answer : Option 1

How do you limit the results returned by a SELECT statement?

1) SELECT * FROM table_name LIMIT number;

2) GET LIMIT number FROM table_name;

3) SELECT TOP number FROM table_name;

4) SELECT * FROM table_name MAX number;

Answer : Option 1

What type of JOIN returns all records from the left table and matched records from the right table?

1) LEFT JOIN

2) RIGHT JOIN

3) INNER JOIN

4) OUTER JOIN

Answer : Option 1