Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MySQL Mastery

Total questions: 28

Worksheet time: 11mins

Name
Class
Date
1.

What is the purpose of the CHAR data type in MySQL?

a)

To store variable-length strings

b)

To store date and time values

c)

To store fixed-length strings

d)

To store numeric values

2.

What are the ACID properties in database transactions?

a)

Reliability

b)

Atomicity

c)

Consistency

d)

Atomicity, Consistency, Isolation, Durability

e)

Isolation

3.

Explain the concept of Atomicity in ACID properties.

a)

Atomicity ensures that only some operations within a transaction are completed successfully

b)

Atomicity guarantees that transactions can be interrupted and resumed without consequences

c)

Atomicity allows for partial completion of operations within a transaction

d)

Atomicity ensures that all operations within a transaction are completed successfully or none of them are, maintaining database consistency.

4.

What is the role of Isolation in database transactions?

a)

Isolation guarantees that transactions can see each other's changes immediately

b)

Isolation ensures that transactions are executed sequentially

c)

Isolation in database transactions ensures that transactions are executed independently and changes made by one transaction are not visible to others until the transaction is completed.

d)

Isolation allows transactions to share data without restrictions

5.

What does the Consistency property ensure in ACID transactions?

a)

Allows for partial updates to the database

b)

Ensures that the database remains in a valid state before and after the transaction.

c)

Ensures that the database is always read-only

d)

Guarantees that the transaction will always commit successfully

6.

What is the significance of the Durable property in ACID transactions?

a)

The Durable property impacts the consistency of transaction data.

b)

The Durable property ensures the permanence of committed transaction effects.

c)

The Durable property ensures the speed of transaction processing.

d)

The Durable property guarantees the isolation of transactions.

7.

How can you ensure data integrity in MySQL transactions?

a)

Ignore error handling

b)

Use MongoDB instead of MySQL

c)

Utilize the ACID properties by structuring transactions, using locking mechanisms, handling errors, and committing or rolling back changes.

d)

Randomly commit changes

8.

How does MySQL handle NULL values in comparisons?

a)

MySQL treats NULL values as equal to any other value

b)

MySQL ignores NULL values in comparisons

c)

MySQL considers NULL values as greater than any other value

d)

MySQL throws an error when NULL values are encountered

9.

What is the purpose of SQL Joins in MySQL?

a)

SQL Joins are used to delete rows from tables in MySQL.

b)

SQL Joins are used to create new tables in MySQL.

c)

The purpose of SQL Joins in MySQL is to combine rows from two or more tables based on a related column between them.

d)

SQL Joins are used to update rows in tables in MySQL.

10.

What is the purpose of the GROUP BY clause in MySQL?

a)

GROUP BY clause is used to delete duplicate rows in MySQL

b)

GROUP BY clause is used to update multiple rows in MySQL

c)

The purpose of GROUP BY clause in MySQL is to group rows that have the same values into summary rows

d)

GROUP BY clause is used to create new tables in MySQL

11.

A relational database can have how many types of keys in a table ?

a)

Candidate key

b)

Primary key

c)

Foreign key

d)

All of these

12.

Which one of the following uniquely identifies the tuples/tows in a relation ?

a)

Secondary key

b)

Primary key

c)

Composite key

d)

Foreign key

13.

What is the full form of DDL ?

a)

Dynamic data language

b)

Detailed data language

c)

Data definition language

d)

Data derivation language

14.

SELECT is a DDL/DML command ....

a)

DDL

b)

DML

c)

None of these

d)

Both

15.

Which of the following keywords will you use to display unique values of the column dept_name ?


SELECT ______ dept_name from COMPANY;

a)

All

b)

distinct

c)

from

d)

name

16.

Which of the following SQL commands retrieves data from table(s)?

a)

update

b)

select

c)

insert

d)

delete

17.

INSERT INTO EMP VALUES(101,'SUMAN','MANAGER');


Which kind of statement is this ?

a)

DDL

b)

DML

c)

Value

d)

Python statement

18.

Total number of rows/records/horizontal arrangement in a table is called:

a)

Degree

b)

Records

c)

Integer

d)

Cardinality

19.

Which clause is used to filter out unwanted data?

a)

SELECT

b)

FROM

c)

WHERE

d)

ORDER BY

20.

Which SQL statement is used to delete an existing row ?

a)

DROP

b)

REMOVE

c)

DELETE

d)

UPDATE

21.

Which statement will return different values?

a)

SELECT UNIQUE

b)

SELECT DISTINCT

c)

SELECT DIFFERENT

d)

SELECT ALL

22.

What is the default sort order in ORDER BY clause?

a)

Ascending

b)

Descending

23.

_________ statement is used to delete a table

a)

DELETE TABLE

b)

REMOVE TABLE

c)

DROP TABLE

d)

MODIFY TABLE

24.

Which of the following is not an aggregate function?

a)

DATE

b)

AVG

c)

COUNT

d)

MAX

25.

Which clause is used to filter out unwanted data?

a)

SELECT

b)

FROM

c)

WHERE

d)

ORDER BY

26.

Which SQL statement is used to modify data in a database table?

a)

MODIFY

b)

CHANGE

c)

ALTER

d)

UPDATE

27.

INSERT INTO EMP VALUES(1221, 'ABC', 'MANAGER',12323); What kind of statement is this ?

a)

DDL

b)

DML

c)

DCL

d)

TCL

28.

(a)   is used to select a database

(Type in upper case)