Chapter 2 - The Relational Model Flashcards

1
Q

What is an Entity?

A

Something of importance to the user that needs to be represented in a database. It can be represented by a single table.

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

What is a Relation?

A

A two-dimensional table consisting of rows and columns

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

What are the Characteristics of a Relation? (1-4)

A
  1. Rows contain data about an entity
  2. Columns contain data about attributes of the entity
  3. Cells of the table hold a single value
  4. All entries in a column are of the same kind
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the Characteristics of a Relation? (5-8)

A
  1. Each column has a unique name
  2. The order of the columns is unimportant
  3. The order of the rows is unimportant
  4. No two rows may hold identical sets of data values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some examples of Poorly-Formed Relations?

A

Multiple entries per cell
The order of the rows affects the table
Different kinds of column entries
Variable-length column values

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

How do we Notate Relation Structures?

A

Relation names are in ALL CAPS (and always singular; if two words, separate by an underscore)
A column name is with the first letter capitalized (if two words, run together LikeThis)
The primary key is underlined
All the attributes of a table are listed in parentheses
Foreign keys are in italics

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

What is a database schema?

A

A database schema is the design on which a database and its associated applications are built.

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

What are the Synonyms for Tables, Rows, and Columns?

A

Tables = Files = Relations
Rows = Records = Tuples
Columns = Fields = Attributes

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

What is a Key?

A

One or more columns of a relation that is used to identify a row. A key can be unique (primary) or nonunique (foreign)

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

What are Composite and Candidate Keys?

A

A composite key contains two or more attributes.

A candidate key uniquely identifies each row in a relation.

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

What is a Primary Key (PK)?

A

A candidate key that is chosen as the key that the DBMS will use to uniquely identify each row in a relation. The PK will be underlined.

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

What is a Surrogate Key?

A

A column with a unique, DBMS-assigned identifier that has been added to a table to be the primary key.

Example, with an address it takes street, city, zip, etc. to identify a unique row. A surrogate key might add in a PropertyID to function as a unique identifier in a single row.

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

What is a Foreign Key?

A

A primary key of another table that has been placed in the current table to represent a relationship between the tables.

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

What is the Referential Integrity Constraint with Foreign Keys?

A

A referential integrity constraint states that every value of a foreign key must match a value of an existing primary key.

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

What is a Null Value? What are some Issues with having Null Values?

A

A null value is a missing value in a cell in a relation.

The problem with null values is that it is ambiguous. Is it that no value is appropriate? Or is the value known, but not entered? Or is the value unknown, and therefore not entered?

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

How can you Prevent Null Values from appearing in the Database?

A

You can eliminate null values by requiring an attribute value.

17
Q

What is a Functional Dependency?

A

A functional dependency occurs when a candidate key determines all the other attributes (columns) in a relation.

18
Q

What is Normalization?

A

The process or set of steps for breaking a table with more than one theme into a set of tables that each has only one.

19
Q

What is First Normal Form (1NF) and when is it Achieved?

A

First normal form means each cell only has one value, and all entries in a column are of the same kind.

1NF is achieved when a table has all 8 characteristics of a relation, a defined PK, and has no repeating groups.

20
Q

What are the Steps of the Normalization Process? (1-4)

A
  1. Identify all the candidate keys of a relation
  2. Identify all the functional dependencies in the relation.
  3. Examine the determinants of the functional dependencies. If any determinant is NOT a candidate key, then the table is not well formed. (More in a separate card)
  4. Repeat step 3 until every determinant of every relation is a candidate key.
21
Q

What are the Steps of the Normalization Process? (Step 3 expanded)

A

3A. Place the columns of the functional dependency in a new relation of their own.
3B. Make the determinant of the functional dependency the PK of the new relation
3C. Leave a copy of the determinant as the foreign key in the original relation
3D. Create a referential integrity constraint between the original and the new realtions

22
Q

What is the Boyce Codd Normal Form (BCNF)?

A

It’s a relation in 3NF (Third Normal Form) in which every determinant is a candidate key.

23
Q

What is a Multivalued Dependency?

A

A multivalued dependency occurs when a determinant is matched with a particular set of values.

Solution: Make both the determinant and the other field a composite PK.

24
Q

What are the Normal Forms? (1-4)

A
  1. First normal form (1NF) - each cell has only one value, and all entries in a column are the same kind
  2. 2NF - No partial dependencies (all non-key attributes are determined by the entire PK)
  3. 3NF - No transitive dependencies (no non-key attributes are determined by another non-key attribute)
  4. BCNF - each table is in 3NF and all determinants are candidate keys