wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Database Relationships Quiz

Total questions: 20

Worksheet time: 13mins

Name
Class
Date
1.

What is the primary role of a primary key in a table?

a)

To store the most frequently accessed data

b)

To uniquely identify each record in the table

c)

To maintain referential integrity

d)

To create relationships between tables

2.

Which of the following is an example of a one-to-many relationship?

a)

A student enrolled in multiple courses

b)

An employee working in a single department

c)

A product supplied by multiple suppliers

d)

A customer placing multiple orders

3.

What is a foreign key?

a)

A key that provides a unique identifier for a table

b)

A key that links two tables together

c)

A key that allows many-to-many relationships

d)

A key that can only be used in one table

4.

In a many-to-many relationship, what is typically used to link two tables?

a)

Foreign key

b)

Junction table

c)

Composite key

d)

Primary key

5.

Which of the following is a requirement for referential integrity?

4 lines
6.

Foreign key values must match the primary key in the related table

a)

Foreign key values must match the primary key in the related table

b)

Foreign key values must be null

c)

Primary key values can be duplicated

d)

Foreign key values must always be unique

7.

What is the main function of a junction table?

a)

To store additional information about a foreign key

b)

To establish a one-to-one relationship between tables

c)

To resolve many-to-many relationships between tables

d)

To provide alternative foreign keys for a table

8.

If a foreign key in a child table does not have a matching primary key in the parent table, what database issue arises?

a)

Data inconsistency

b)

Referential integrity violation

c)

Data redundancy

d)

Data normalization

9.

What is a composite key?

a)

A key composed of multiple foreign keys

b)

A key made up of two or more columns to uniquely identify records

c)

A key that enforces referential integrity

d)

A key used only in junction tables

10.

Which of the following best describes a one-to-one relationship?

a)

One record in a table is related to many records in another table

b)

Many records in one table are related to many records in another table

c)

One record in a table is related to one record in another table

d)

A single record in a table can have multiple foreign keys

11.

In a many-to-many relationship, how many foreign keys does a junction table typically have?

a)

One

b)

Two

c)

Three

d)

None

12.

Why is it important that foreign keys are non-null in certain cases?

a)

It ensures every record has a matching value in the related table

b)

It ensures referential integrity is violated

c)

It prevents data duplication across tables

d)

It makes foreign keys unique

13.

Which of the following statements about primary keys is true?

a)

Primary keys can contain null values

b)

A table can have multiple primary keys

c)

Primary keys must be unique for each record in the table

d)

A primary key can be duplicated in another table

14.

What is the main purpose of enforcing referential integrity?

a)

To prevent data duplication within a table

b)

To ensure related data is kept consistent between tables

c)

To speed up query performance

d)

To simplify database design

15.

If a table contains two foreign keys, it is most likely to be:

a)

A parent table in a one-to-one relationship

b)

A junction table in a many-to-many relationship

16.

Which of the following is NOT a valid reason for using a junction table?

a)

A) To resolve a many-to-many relationship

b)

B) To store metadata about the relationship between two tables

c)

C) To provide additional data integrity checks

d)

D) To enforce a one-to-one relationship

17.

A primary key that consists of more than one column is called:

a)

A) A composite key

b)

B) A duplicate key

c)

C) A concatenated key

d)

D) A unique key

18.

Which of the following describes a duplicate foreign key?

a)

A) A foreign key that appears more than once in the same table

b)

B) A foreign key that links the same two tables twice

c)

C) A foreign key that exists in two tables with different values

d)

D) A foreign key that exists in two different tables and points to the same primary key

19.

Which of the following fields would most likely be a primary key?

a)

A) CustomerName

b)

B) ProductID

c)

C) OrderDate

d)

D) Price

20.

Why are foreign keys important in relational databases?

a)

A) They allow one-to-one relationships

b)

B) They enforce referential integrity between related tables

c)

C) They help in creating indexes