Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Exploring SQL and MySQL Fundamentals

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is one advantage of using SQL?

a)

It guarantees data security and privacy.

b)

It automatically generates reports and analytics.

c)

It simplifies complex data structures.

d)

It enables efficient data retrieval and manipulation.

2.

Which of the following is a Data Type in MySQL?

a)

CHAR

b)

FLOAT

c)

BOOLEAN

d)

INT

3.

What command is used to create a new database in MySQL?

a)

CREATE DATABASE database_name;

b)

NEW DATABASE database_name;

c)

ADD DATABASE database_name;

d)

INIT DATABASE database_name;

4.

What is the purpose of the CREATE TABLE statement?

a)

To update records in a database table.

b)

To retrieve data from a database table.

c)

To delete an existing table from a database.

d)

To define a new table in a database.

5.

Which language is used to manipulate data in a database?

a)

HTML

b)

Java

c)

SQL

d)

Python

6.

What does DDL stand for in the context of SQL?

a)

Data Design Language

b)

Data Delivery Logic

c)

Data Definition Language

d)

Data Distribution Layer

7.

Name a common data type used for storing text in MySQL.

a)

TEXT

b)

CHAR

c)

STRING

d)

VARCHAR

8.

What command would you use to add a new record to a table?

a)

INSERT INTO table_name (column1, column2) VALUES (value1, value2);

b)

UPDATE table_name SET column1 = value1 WHERE condition;

c)

DELETE FROM table_name WHERE condition;

d)

SELECT * FROM table_name WHERE condition;

9.

What is the purpose of the Data Query Language?

a)

The purpose of the Data Query Language is to retrieve data from a database.

b)

The purpose of the Data Query Language is to delete data from a database.

c)

The purpose of the Data Query Language is to create new databases.

d)

The purpose of the Data Query Language is to update data in a database.

10.

Which command is used to delete a database in MySQL?

a)

DELETE DATABASE database_name;

b)

DROP DATABASE database_name;

c)

REMOVE DATABASE database_name;

d)

CLEAR DATABASE database_name;

11.

What is the syntax to create a table in MySQL?

a)

CREATE TABLE table_name (column1_name column1_datatype, column2_name column2_datatype, ...);

b)

TABLE table_name (column1_name column1_datatype);

c)

INSERT INTO table_name (column1_name, column2_name);

d)

CREATE NEW table_name (column1, column2);

12.

What data type would you use for storing whole numbers?

a)

float

b)

string

c)

integer

d)

boolean

13.

How do you retrieve data from a table using SQL?

a)

GET data FROM table_name WHERE condition;

b)

SELECT column1, column2 FROM table_name WHERE condition ORDER BY column_name LIMIT number;

c)

FETCH column1, column2 FROM table_name;

d)

RETRIEVE column1, column2 IN table_name WHERE condition;

14.

What is the difference between DML and DQL?

a)

DML is for data manipulation (INSERT, UPDATE, DELETE), while DQL is for data querying (SELECT).

b)

DML handles data storage (SAVE), whereas DQL manages data visualization (DISPLAY).

c)

DML is for data querying (SELECT), while DQL is for data manipulation (INSERT, UPDATE, DELETE).

d)

DML is used for data definition (CREATE, ALTER), while DQL is for data retrieval (FETCH).

15.

Which command is used to modify existing records in a table?

a)

INSERT

b)

SELECT

c)

DELETE

d)

UPDATE

16.

What is the purpose of the PRIMARY KEY in a table?

a)

To define the data type of each column in a table.

b)

To uniquely identify each record in a table.

c)

To enforce data integrity across multiple tables.

d)

To group related records in a table.

17.

What data type is used for storing decimal numbers in MySQL?

a)

DECIMAL or NUMERIC

b)

CHAR or VARCHAR

c)

INTEGER or BIGINT

d)

FLOAT or REAL

18.

What command would you use to view the structure of a table?

a)

SELECT * FROM table_name;

b)

DESCRIBE table_name; or SHOW COLUMNS FROM table_name;

c)

SHOW TABLES;

d)

CREATE TABLE table_name;

19.

What is the significance of using indexes in a database?

a)

Indexes are only useful for large databases with millions of records.

b)

Indexes significantly enhance query performance and data retrieval speed in a database.

c)

Indexes are primarily used for data backup and recovery processes.

d)

Indexes slow down data updates and modifications in a database.

20.

How can you ensure that a column in a table cannot be null?

a)

Set the column to auto-increment.

b)

Allow NULL values in the column definition.

c)

Use the DEFAULT constraint on the column.

d)

Use the NOT NULL constraint on the column.