wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MySQL Commands and Data Types Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Which of the following is a DDL command in MySQL?

a)

SELECT

b)

INSERT

c)

CREATE

d)

UPDATE

2.

Which DDL command is used to remove an entire table along with its data?

a)

DELETE

b)

DROP

c)

TRUNCATE

d)

REMOVE

3.

What does the ALTER command do in MySQL?

a)

Adds, modifies, or deletes table columns

b)

Deletes the table permanently

c)

Inserts data into the table

d)

Retrieves data

4.

Which statement will delete all rows from a table but keep the structure?

a)

DELETE

b)

DROP

c)

TRUNCATE

d)

REMOVE

5.

Which DDL command is used to create a database?

a)

MAKE DATABASE

b)

NEW DATABASE

c)

CREATE DATABASE

d)

INIT DATABASE

6.

Which of these is a DML command?

a)

SELECT

b)

INSERT

c)

CREATE

d)

DROP

7.

Which command is used to modify existing data in MySQL?

a)

UPDATE

b)

MODIFY

c)

CHANGE

d)

ALTER

8.

To delete specific rows from a table, you use:

a)

TRUNCATE

b)

DELETE with WHERE

c)

DROP

d)

REMOVE

9.

Which statement inserts multiple rows into a table?

a)

INSERT ALL

b)

INSERT INTO … VALUES (), ()

c)

BULK INSERT

d)

ADD ROWS

10.

Which of these is not a DML command?

a)

DELETE

b)

UPDATE

c)

INSERT

d)

ALTER

11.

Which command is classified as DQL?

a)

SELECT

b)

UPDATE

c)

DELETE

d)

CREATE

12.

Which clause in MySQL is used to filter rows?

a)

WHERE

b)

HAVING

c)

ORDER BY

d)

GROUP BY

13.

Which clause is used with aggregate functions to filter groups?

a)

WHERE

b)

GROUP BY

c)

HAVING

d)

ORDER BY

14.

Which clause is used to sort query results?

a)

SORT BY

b)

ORDER BY

c)

GROUP BY

d)

RANK BY

15.

Which clause in MySQL is used to combine rows from multiple tables?

a)

UNION

b)

JOIN

c)

CONNECT

d)

APPEND

16.

Which data type is best for storing very large integers (up to 19 digits)?

a)

INT

b)

BIGINT

c)

FLOAT

d)

DOUBLE

17.

Which data type is best for storing fixed-point decimal values accurately?

a)

FLOAT

b)

DOUBLE

c)

DECIMAL

d)

INT

18.

Which data type is used to store text up to 255 characters?

a)

CHAR

b)

VARCHAR

c)

TEXT

d)

STRING

19.

What is the main difference between CHAR and VARCHAR?

a)

CHAR is variable length, VARCHAR is fixed length

b)

CHAR is fixed length, VARCHAR is variable length

c)

Both are fixed length

d)

Both are variable length

20.

Which data type can store very large text (up to 65,535 characters)?

a)

VARCHAR

b)

CHAR

c)

TEXT

d)

STRING

21.

Which data type stores only the date without time?

a)

TIMESTAMP

b)

DATETIME

c)

DATE

d)

TIME

22.

Which data type stores only time values (without date)?

a)

TIMESTAMP

b)

DATE

c)

TIME

d)

DATETIME

23.

Which data type stores both date and time with automatic time zone support?

a)

DATETIME

b)

DATE

c)

TIME

d)

TIMESTAMP

24.

Which data type should be used when you need to store numbers with fractional precision (scientific calculations)?

a)

INT

b)

BIGINT

c)

FLOAT

d)

CHAR

25.

Which data type provides double precision floating-point numbers?

a)

FLOAT

b)

DOUBLE

c)

BIGINT

d)

NUMERIC

26.

Which is the correct way to write a single-line comment in MySQL?

a)

/* comment */

b)

// comment

c)

-- comment

d)

## comment

27.

Which is the correct way to write a multi-line comment in MySQL?

a)

-- comment

b)

/* comment */

c)

## comment

d)
28.

Which of the following is not a valid comment syntax in MySQL?

a)

-- comment

b)

/* comment */

c)

## comment

d)

%% comment

29.

Which command is used to select a database to work on?

a)

USE database_name;

b)

SELECT database_name;

c)

OPEN database_name;

d)

LOAD database_name;

30.

Which command lists all databases in MySQL?

a)

SHOW DATABASES;

b)

LIST DATABASES;

c)

DESCRIBE DATABASES;

d)

SELECT DATABASES;