wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

DataBase Quiz - CME Workshop

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is a primary key in a relational database?

a)

A unique identifier for a table

b)

A foreign key in another table

c)

A field that can have duplicate values

d)

An index on all columns

2.

Which SQL statement is used to retrieve data from a database?

a)

GET

b)

SELECT

c)

FETCH

d)

QUERY

3.

What is the purpose of the SQL JOIN operation?

a)

To insert data into a table

b)

To delete data from a table

c)

To combine rows from two or more tables based on a related column

d)

To update data in a table

4.

In a relational database, what is normalization?

a)

The process of removing duplicate rows from a table

b)

The process of organizing data in a structured format

c)

The process of optimizing query performance

d)

The process of reducing data redundancy by dividing tables into smaller, related tables

5.

Which SQL clause is used to filter rows in a SELECT statement?

a)

FROM

b)

WHERE

c)

HAVING

d)

GROUP BY

6.

. What is an index in a database?

a)

A list of all the tables in the database

b)

A unique identifier for a database

c)

A data structure that improves the speed of data retrieval

d)

A column that can have duplicate values

7.

Which of the following is an example of a non-relational database?

a)

MySQL

b)

PostgreSQL

c)

MongoDB

d)

Oracle

8.

What is the purpose of the SQL GROUP BY clause?

a)

To filter rows in a SELECT statement

b)

To join two or more tables

c)

To group rows with the same values in specified columns

d)

To order the result set in ascending or descending order

9.

What is a foreign key in a relational database?

a)

A key that uniquely identifies each row in a table

b)

A key that is not used as a primary key

c)

A key that references the primary key of another table

d)

A key that contains only numeric values

10.

Which SQL statement is used to add new rows to a table?

a)

INSERT INTO

b)

UPDATE

c)

DELETE FROM

d)

ALTER TABLE

11.

What is SQL injection?

a)

A method of injecting SQL code into a database to retrieve data

b)

A way to prevent SQL queries from executing

c)

A technique to hide sensitive data in a database

d)

A method to improve SQL query performance

12.

What does the acronym ACID stand for in the context of database transactions?

a)

Atomicity, Consistency, Isolation, Durability

b)

Association, Complexity, Isolation, Data

c)

. Authentication, Compatibility, Integrity, Deployment

d)

Availability, Compression, Indexing, Decryption

13.

In SQL, what is the purpose of the UNION operator?

a)

To combine the results of two or more SELECT statements into a single result set

b)

To filter rows based on a condition

c)

. To perform a cross join between two tables

d)

To delete duplicate rows from a table

14.

What is a stored procedure in a database?

a)

A type of primary key

b)

A predefined set of SQL statements that can be executed as a single unit

c)

A virtual table used for reporting

d)

A temporary table used for data storage

15.

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

a)

INSERT INTO

b)

SELECT

c)

UPDATE

d)

DELETE FROM

16.

What is the purpose of the SQL ORDER BY clause?

a)

To group rows with the same values

b)

To filter rows based on a condition

c)

To sort the result set in ascending or descending order

d)

To combine rows from two or more tables

17.

What is the difference between a primary key and a unique key?

a)

A primary key allows duplicate values, while a unique key does not.

b)

A primary key can consist of multiple columns, while a unique key cannot.

c)

A primary key enforces both uniqueness and NOT NULL constraint, while a unique key enforces only uniqueness.

d)

A primary key is used for indexing, while a unique key is not.

18.

What is the purpose of the SQL LIMIT clause?

a)

To limit the number of rows returned in a result set

b)

To specify the maximum length of text fields

c)

To define the precision of a numeric column

d)

To filter rows based on a condition

19.

Which of the following is NOT a valid data type in SQL?

a)

INTEGER

b)

BOOLEAN

c)

DECIMAL

d)

STRING

20.

What is a view in a database?

a)

A virtual table that is based on the result of a SELECT query

b)

A physical table that stores temporary data

c)

A type of primary key

d)

A unique identifier for a database