wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CS10337 - Lecture #3

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

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

a)

Each employee is assigned to exactly one company car.

b)

A student can enroll in many courses, and each course can have many students.

c)

Each country has one capital city.

d)

A customer places one order at a time.

2.

In a one-to-one relationship:

a)

Each row in Table A can match many rows in Table B.

b)

Each row in Table A matches exactly one row in Table B.

c)

Each row in Table B can match many rows in Table A.

d)

Rows in Table A and Table B do not need to be related.

3.

A one-to-many relationship means:

a)

A single row in one table relates to multiple rows in another.

b)

Multiple rows in both tables relate to each other.

c)

Both tables must always have the same number of rows.

d)

One row in Table A relates to exactly one row in Table B.

4.

Many-to-many relationships in relational databases are usually implemented with:

a)

Primary keys only

b)

A junction (bridge) table

c)

Foreign keys that allow duplicates

d)

Regular indexes

5.

Which statement best describes a primary key?

a)

A field that can contain duplicate values.

b)

A field that uniquely identifies each row in a table.

c)

A field used only for indexing.

d)

A field that links to another table.

6.

Which statement best describes a foreign key?

a)

A unique identifier for each row in the same table.

b)

A reference to a primary key in another table.

c)

A field that prevents duplicates within its own table.

d)

A field that automatically increments.

7.

Which of the following is TRUE about referential integrity?

a)

It allows inserting a child record without a matching parent.

b)

It prevents inserting a child record without a matching parent.

c)

It allows deleting parent rows even if child rows exist.

d)

It guarantees every column in a table is unique.

8.

What happens if you try to insert a foreign key value that doesn’t exist in the parent table?

a)

The child row is inserted with NULL automatically.

b)

The database raises an error and prevents the insert.

c)

The database ignores the foreign key constraint.

d)

The row is inserted but marked as invalid.

9.

If a query to find orphan student_id in the enrollments table returns rows, what does this indicate?

a)

Duplicate enrollments exist.

b)

Referential integrity has been violated.

c)

The primary key is missing.

d)

The foreign key is indexed incorrectly.

10.
What must be common between two tables to create a relationship?
a)
Fields
b)
Characters
c)
Files
d)
Names