Chapter 4 Flashcards

1
Q

Data Structure

A

Data are organized in two-dimensional tables (also called relations) with columns and rows

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

Data Manipulation

A

Data stored in the tables may be manipulated through the use of a command language (Structured Query Language – SQL – was developed expressly for this purpose)

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

Data Integrity

A

Business rules may be defined that maintain the integrity of the data that is manipulated

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

Relational Database Model Constraints–Domain Integrity

A

constrains allowable values for columns(e.g., data type, column size, maximum value, etc.)

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

Relational Database Model Constraints–Policy Integrity

A

constrains data operations to business rules (e.g., only managers may place vendor orders)

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

Relational Database Model Constraints–Entity Integrity

A

prohibits null values for primary key column

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

Relational Database Model Constraints–Referential Integrity

A

constrains a foreign key value to match a primary key value in a related table

Example: For every value of CustomerID in the Order table there must be a matching value of CustomerID in the Customer table

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

Properties of Relational Tables–table (relation)

A

Each table (relation) in a given database has a unique name

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

Properties of Relational Tables-column (attribute)

A

within a given table has a unique name

  • -Every column (attribute) is single-valued
  • -Thus, multivalued attributes require special teatment when designing relational tables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Properties of Relational Tables–row (tuple)

A

Every row (tuple) in a table is unique

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

Primary Key (PK) (analogous to entity identifier)

A

A column (or columns) whose value uniquely identifies or differentiates each row in a table(e.g., EmployeeID)

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

Composite Key

A

a primary key made up of more than one column

e.g., FirstName + MiddleName + LastName

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

Foreign Key (FK)

A

A column in one table that serves as the primary key of another table in the same database (thus serving as a link between the two tables)

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

Candidate Key

A

If a table has more than one column that provides a way of uniquely identifying the rows of the table, then they are each called a candidate key

When there is more than one candidate key, one of them must be chosen to be the primary key of the table

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

alternate key

A

A candidate key that is not chosen to be the primary key of a table

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

Foreign Keys– additional rules

A

The foreign key column in one table must have the same domain of values as the primary key column in the linked table

–Two columns have the same domain of values if the columns have values of the same type (e.g., integer numbers; see previous slide)

17
Q

Logical Database Design

A

The process of arranging the entities and attributes of the conceptual data model of the business environment into the tables and columns of a relational database structure to serve that business in an information system

The goal is to create well-structured tables (i.e., free of anomalies) that properly reflect the organization’s business environment

18
Q

Anomalies

A

are problems that are experienced when attempting to manipulate stored data

19
Q

Well-Structured Tables

A

Tables that contains minimal redundancy and that allow users to insert, delete, and modify table rows without errors or inconsistencies are considered to be well-structured

When designing relational database tables, we seek to eliminate anomalies through the use of normalization

20
Q

Insertion Anomalies

A

are experienced when we attempt to store a value for a column but cannot because the value of another column is unknown

–e.g., cannot add a new customer’s information until an order number is ready to be entered (because OrderID column serves as the primary key for the table and cannot have null values)

21
Q

Deletion Anomalies

A

are experienced when a value for a column we wish to keep is unexpectedly removed when a value for another column is deleted

e.g., cannot delete the sole order for a customer without deleting the only copy of the customer’s information also

22
Q

Update Anomalies

A

are experienced when changes to multiple rows of a table are needed to effect an update to a single value of a column
e.g., cannot completely update a customer’s address without changing it for every order placed by that customer

23
Q

Map Binary Relationships/schemas–One-to-Many

A

Primary key on the one side becomes a foreign key on the many side

24
Q

Map Binary Relationships/schemas–Many-to-Many

A
  • Create a new table; the primary key of the new table is typically a CPK comprised of (at least) the primary keys of the two entities involved in the relationship
25
Q

Map Binary Relationships/schemas–One-to-One

A

Primary key on the mandatory side becomes a foreign key on the optional side (if optionalities are asymmetric)

26
Q

Unary (Recursive) Relationships–One-to-Many

A

Recursive foreign key in the same table (also true for unary One-to-One)

27
Q

Unary (Recursive) Relationships–Many-to-Many

A

(e. g., bill of materials): Two tables result:
- -One for the entity type
- -One for an associative relation in which the primary key has two fields, both taken from the identifier of the original entity

28
Q

Unary (Recursive) Relationships–Ternary (and n-ary) Relationships

A
  • -One table for each original entity and one for the common relationship (associative entity) (i.e., a ternary relationship maps to a total of four tables)
  • -Table representing the associative entity has foreign keys to each entity in the relationship
  • -PK of the table formed for the associative entity is typically a composite PK composed of (at least) the primary keys of the three entities
29
Q

Map Supertype/Subtype Structures

A
  • -Create a separate table for the supertype and each of the subtypes
  • -Assign common attributes, including subtype discriminator, to the supertype table
  • -Assign to the subtype tables those attributes unique to each subtype
  • -Assign to the subtype tables the primary key of the supertype table (which also functions as a FK referencing the supertype)
30
Q

Data Normalization

A
  • -A formal process for grouping attributes into tables
  • -A tool to validate and improve logical designs so that they satisfy certain constraints to avoid unnecessary duplication of data
  • -The process of decomposing a table with anomalies into two or more, smaller, well-structured tables
31
Q

Functional Dependency

A

The value of one attribute (the determinant) determines the value of another attribute

32
Q

A—>B

A

We say here that “A determines B” or

“B is functionally dependent on A”

33
Q

First Normal Form

A

Table has no multivalued attributes

  • -a table that has multivalued attributes is unnormalized
  • -in this context, a multivalued attribute is sometimes referred to as a repeating group

Identify the functional dependencies in the table and draw the arrows

34
Q

Second Normal Form

A

Table is in 1NF and has no partial functional dependencies (that is, every nonkey attribute is fully functionally dependent on the entire primary key)

35
Q

what is the Solution to get to 2NF

A

The solution to the problem with the previous table is to break it into two related tables to achieve 2NF (at least)

36
Q

Third Normal Form

A

Table is in 2NF and no transitive dependencies (functional dependencies between nonkey attributes)
–This means that no nonkey attribute should be able to determine another nonkey attribute

37
Q

how to remove transitive dependancies?

A

–For each nonkey attribute that is a determinant in a table, create a new table; that attribute becomes the primary key of the new table

–Move all of the attributes that are functionally dependent on that determinant attribute from the old table to the new table

–Leave the attribute that serves as the primary key in the new table in the old table to serve as a foreign key to allow the tables to be related