WorksheetsMySQL Commands and Data Types Quiz
Total questions: 30
Worksheet time: 15mins
Which of the following is a DDL command in MySQL?
SELECT
INSERT
CREATE
UPDATE
Which DDL command is used to remove an entire table along with its data?
DELETE
DROP
TRUNCATE
REMOVE
What does the ALTER command do in MySQL?
Adds, modifies, or deletes table columns
Deletes the table permanently
Inserts data into the table
Retrieves data
Which statement will delete all rows from a table but keep the structure?
DELETE
DROP
TRUNCATE
REMOVE
Which DDL command is used to create a database?
MAKE DATABASE
NEW DATABASE
CREATE DATABASE
INIT DATABASE
Which of these is a DML command?
SELECT
INSERT
CREATE
DROP
Which command is used to modify existing data in MySQL?
UPDATE
MODIFY
CHANGE
ALTER
To delete specific rows from a table, you use:
TRUNCATE
DELETE with WHERE
DROP
REMOVE
Which statement inserts multiple rows into a table?
INSERT ALL
INSERT INTO … VALUES (), ()
BULK INSERT
ADD ROWS
Which of these is not a DML command?
DELETE
UPDATE
INSERT
ALTER
Which command is classified as DQL?
SELECT
UPDATE
DELETE
CREATE
Which clause in MySQL is used to filter rows?
WHERE
HAVING
ORDER BY
GROUP BY
Which clause is used with aggregate functions to filter groups?
WHERE
GROUP BY
HAVING
ORDER BY
Which clause is used to sort query results?
SORT BY
ORDER BY
GROUP BY
RANK BY
Which clause in MySQL is used to combine rows from multiple tables?
UNION
JOIN
CONNECT
APPEND
Which data type is best for storing very large integers (up to 19 digits)?
INT
BIGINT
FLOAT
DOUBLE
Which data type is best for storing fixed-point decimal values accurately?
FLOAT
DOUBLE
DECIMAL
INT
Which data type is used to store text up to 255 characters?
CHAR
VARCHAR
TEXT
STRING
What is the main difference between CHAR and VARCHAR?
CHAR is variable length, VARCHAR is fixed length
CHAR is fixed length, VARCHAR is variable length
Both are fixed length
Both are variable length
Which data type can store very large text (up to 65,535 characters)?
VARCHAR
CHAR
TEXT
STRING
Which data type stores only the date without time?
TIMESTAMP
DATETIME
DATE
TIME
Which data type stores only time values (without date)?
TIMESTAMP
DATE
TIME
DATETIME
Which data type stores both date and time with automatic time zone support?
DATETIME
DATE
TIME
TIMESTAMP
Which data type should be used when you need to store numbers with fractional precision (scientific calculations)?
INT
BIGINT
FLOAT
CHAR
Which data type provides double precision floating-point numbers?
FLOAT
DOUBLE
BIGINT
NUMERIC
Which is the correct way to write a single-line comment in MySQL?
/* comment */
// comment
-- comment
## comment
Which is the correct way to write a multi-line comment in MySQL?
-- comment
/* comment */
## comment
Which of the following is not a valid comment syntax in MySQL?
-- comment
/* comment */
## comment
%% comment
Which command is used to select a database to work on?
USE database_name;
SELECT database_name;
OPEN database_name;
LOAD database_name;
Which command lists all databases in MySQL?
SHOW DATABASES;
LIST DATABASES;
DESCRIBE DATABASES;
SELECT DATABASES;
