Learn MYSQL MCQs
Prepare MYSQL MCQs (Multiple choice Questions) for exam and job interviews.
What does the SQL keyword LIMIT do?
1) Restricts the number of rows returned by a query
2) Sorts the rows returned by a query
3) Filters rows based on a condition
4) Groups rows by a specific column
Answer : Option 1
What is the MySQL command to remove a table?
1) DELETE TABLE table_name;
2) DROP TABLE table_name;
3) REMOVE TABLE table_name;
4) CLEAR TABLE table_name;
Answer : Option 2
What is a join in MySQL?
1) Combining two or more tables based on a related column
2) Duplicating a table
3) Aggregating data from a table
4) Creating a new table from an existing one
Answer : Option 1
How do you update data in a MySQL table?
1) UPDATE table_name SET column_name = value WHERE condition;
2) MODIFY table_name SET column_name = value WHERE condition;
3) CHANGE table_name SET column_name = value WHERE condition;
4) ALTER table_name SET column_name = value WHERE condition;
Answer : Option 1
Which MySQL function is used to get the current date and time?
1) NOW()
2) CURRENT_DATE()
3) GET_DATE()
4) SYSDATE()
Answer : Option 1
What does the MySQL command SHOW TABLES do?
1) Displays all tables in the current database
2) Creates a new table
3) Deletes all tables in the current database
4) Renames all tables in the current database
Answer : Option 1
Which clause is used to filter results in a GROUP BY statement?
1) HAVING
2) WHERE
3) FILTER
4) LIMIT
Answer : Option 1
How do you change a column data type in MySQL?
1) ALTER TABLE table_name CHANGE column_name new_data_type;
2) MODIFY TABLE table_name column_name new_data_type;
3) CHANGE COLUMN column_name TO new_data_type;
4) ALTER COLUMN column_name TYPE new_data_type;
Answer : Option 1
What is the purpose of the MySQL command TRUNCATE?
1) To remove all records from a table without deleting the table
2) To delete the table and its records
3) To remove specific records from a table
4) To clear a table of its structure
Answer : Option 1
Which command is used to check if a table exists in MySQL?
1) SHOW TABLE table_name;
2) DESCRIBE table_name;
3) CHECK TABLE table_name;
4) SELECT TABLE table_name;
Answer : Option 3