Learn MYSQL MCQs

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

What is the purpose of the SQL LIKE operator?

1) Searches for a specified pattern in a column

2) Filters records based on equality

3) Joins two tables

4) Sorts records

Answer : Option 1

Which SQL statement is used to drop a table?

1) DROP TABLE table_name;

2) REMOVE TABLE table_name;

3) DELETE TABLE table_name;

4) CLEAR TABLE table_name;

Answer : Option 1

What does the SQL GROUP BY clause do?

1) Groups rows sharing a property so aggregate functions can be applied

2) Filters records

3) Sorts the results

4) Joins two tables

Answer : Option 1

How do you find a specific record in a table?

1) SELECT * FROM table_name WHERE condition;

2) GET * FROM table_name WHERE condition;

3) FETCH * FROM table_name WHERE condition;

4) RETRIEVE * FROM table_name WHERE condition;

Answer : Option 1

Which function is used to retrieve the current timestamp in MySQL?

1) CURRENT_TIMESTAMP()

2) NOW()

3) GET_TIMESTAMP()

4) TIME()

Answer : Option 1

How do you create a new table in MySQL?

1) CREATE TABLE table_name (column1 data_type, column2 data_type);

2) NEW TABLE table_name (column1 data_type, column2 data_type);

3) ADD TABLE table_name (column1 data_type, column2 data_type);

4) DEFINE TABLE table_name (column1 data_type, column2 data_type);

Answer : Option 1

What is the use of the SQL OFFSET clause?

1) Specifies the starting point for the returned records

2) Limits the number of records

3) Filters records

4) Sorts the results

Answer : Option 1

Which SQL statement is used to update a specific column in a table?

1) UPDATE table_name SET column_name = new_value WHERE condition;

2) MODIFY table_name SET column_name = new_value WHERE condition;

3) CHANGE table_name SET column_name = new_value WHERE condition;

4) ALTER table_name SET column_name = new_value WHERE condition;

Answer : Option 1

What does the SQL REPLACE() function do?

1) Replaces all occurrences of a substring with another substring

2) Finds a substring

3) Counts characters

4) Extracts substrings

Answer : Option 1

How do you check the data type of a column in MySQL?

1) SHOW COLUMNS FROM table_name;

2) DESCRIBE table_name;

3) SHOW DATA TYPE OF table_name;

4) GET COLUMNS FROM table_name;

Answer : Option 1