Relations (Database Design) Flashcards

1
Q

Any set of one or more columns that uniquely identify a row in a
table.

A

Superkey

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A minimal superkey, meaning it uniquely identifies a row
without any unnecessary columns.

A

Candidate Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The chosen candidate key to uniquely identify rows in a table.

A

Primary Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Other candidate keys not chosen as the primary key

A

Alternate Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A key derived from real-world attributes (e.g., SSN, Email).

A

Natural Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

An artificially generated key (e.g., UserID) with no business
meaning, often used for simplicity and efficiency.

A

Surrogate Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A single column serving as a primary key (e.g., StudentID).

A

Simple Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A primary key made of multiple columns (e.g., {OrderID,
ProductID}).

A

Composite Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Often used interchangeably with composite key, but
technically refers to combining columns that have meaning together.

A

Compound Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Defines the number of instances of one entity that can or must be associated with instances
of another entity

A

Cardinality / Multiplicity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Each record in one table is associated with exactly one record in another
table.

A

One-to-One

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A single record in one table can be related to multiple records in
another table, but each record in the second table relates to only one record in the first.

A

One-to-Many

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Records in one table can relate to multiple records in another and vice versa

Typically implemented using a junction table

A

Many-to-Many

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Defines whether an entity’s participation in a relationship is mandatory or optional.

A

Modality / Participation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Entities in one table may or may not have related records in another table

A

Optional

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Every record in one table must have a related record in another table

17
Q

The structure of a table, defined by its name, attributes, and data
types. It is static and does not change frequently.

A

Relation Schema

18
Q

A snapshot of the data in the table at a specific point in time. It
consists of all rows (tuples) currently stored in the table.

A

Relation Instance

19
Q

3 Types of Constraints

A

Implicit Constraint
Explicit Constraint
Semantic (Application Based) Constraint

20
Q

Inherent to the data model itself, such as atomic values in the
relational model

A

Implicit Constraint

21
Q

Defined in the schema, such as domain, primary key, foreign key,
and unique constraints.

A

Explicit Constraint

22
Q

Rules specific to the business logic,
enforced at the application level.

A

Semantic Constraint

23
Q

5 Types of Relational Integrity Constraint

A

Domain Constraint
Key Constraint
NULL Constraint
Entity Integrity
Referential Integrity

24
Q

Ensure that values stored in an attribute match its defined data
type and range.

A

Domain Constraints

25
Ensure uniqueness for rows in a table.
Key Constraints
26
Restrict whether an attribute can be left empty.
NULL Constraints
27
Ensures that no primary key value is NULL, as every record must be uniquely identifiable.
Entity Integrity
28
Ensures that a foreign key value in one table matches a primary key value in another table.
Referential Integrity