Lecture 4 Flashcards

(17 cards)

1
Q

What is a relational table?

A

A two-dimensional structure composed of rows and columns that contains a group of related entities

An entity set and a table are often used interchangeably.

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

What are the basic components of the relational model?

A

Relational tables, keys, data integrity rules, data dictionary

These components enable the organization and management of data within relational databases.

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

What is a primary key?

A

An attribute (or a combination of attributes) that uniquely identifies any given entity (row)

The primary key must not contain NULL values and should be unique.

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

What is a foreign key?

A

An attribute whose values match primary key values in the related table

It ensures referential integrity by containing a value that refers to an existing valid tuple in another relation.

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

Define candidate key.

A

Any column or combination of columns that can qualify as a unique key in the database

There can be multiple candidate keys in one table, each of which can qualify as a primary key.

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

What is the role of keys in a relational database?

A

Keys consist of one or more attributes that determine other attributes

Knowing the value of one attribute allows the lookup of another.

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

What is controlled redundancy in relational databases?

A

It refers to necessary duplication of attribute values to enable tables to be linked together

Redundancy only exists when there is unnecessary duplication.

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

What is the data dictionary?

A

A detailed accounting of all tables in the user/designer-created database, containing metadata

It records design decisions about tables and their structures.

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

Why are NULL values not permitted in primary keys?

A

Because they represent no data entry, which violates the uniqueness requirement of primary keys

NULLs can create issues when performing functions like COUNT, AVERAGE, and SUM.

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

What are the criteria for selecting a primary key?

A

Select a key that does not contain NULL, is unique, and does not keep changing

Stability and uniqueness are essential for a primary key.

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

What is referential integrity?

A

A condition that ensures a foreign key contains a value that refers to an existing valid tuple in another relation

It maintains the accuracy and consistency of data across related tables.

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

Fill in the blank: A table is also called a ______.

A

relation

The term ‘relation’ was used by Codd, the creator of the relational model.

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

True or False: A secondary key is used strictly for data retrieval purposes.

A

True

Secondary keys do not enforce uniqueness but facilitate searching.

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

What is an attribute in the context of databases?

A

A property or characteristic of an entity

Attributes are the columns in a relational table.

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

What is the significance of data integrity rules?

A

They ensure the accuracy and consistency of data within the database

Integrity rules include entity integrity and referential integrity.

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

What does the term ‘domain’ refer to in databases?

A

The set of allowable values for an attribute

Domains help to enforce data integrity by restricting the type of data that can be stored.

17
Q

What are the main teaching points about keys in relational databases?

A

Keys are central to the use of relational tables and define functional dependencies

Types of keys include candidate key, primary key, secondary key, and foreign key.