Chapter 4 - Logical Database Design and the Relational Model Flashcards

1
Q

Data structure ?

A

Table (relation), rows, columns

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

Data integrity ?

A

Mechanisms for implementing business rules that maintain integrity of manipulated data

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

What is a relation ?

A

A relation is a named, two dimensional table of data

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

Requirements for a table to qualify as a relation (6)

A
  • Unique name
  • Every attribute must be atomic (not multivalued, not composite)
  • Every row must be unique (can’t have two rows with exactly the same values for all their fields)
  • Attributes (columns) in tables must have unique names
  • The order of the columns must be irrelevant.
  • The order of the rows must be irrelevant.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Correspondence with E-R Model :
- Relations (tables) correspond with __ and with __.
- Rows correspond with __ and __.
- Columns correspond with __.
- Note: The word relation (in __) is not
the same as the word relationship (in __).

A
  • Relations (tables) correspond with entity types and with many-to-many relationship types
  • Rows correspond with entity instances and with many-to-many relationship instances.
  • Columns correspond with attributes.
  • Note: The word relation (in relational database) is not the same as the word relationship (in E-R model).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

__ are unique identifiers of the relation.
Examples include employee numbers, social security
numbers, etc. This guarantees that __

A

Primary keys are unique identifiers of the relation.
Examples include employee numbers, social security
numbers, etc. This guarantees that all rows are unique.

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

__ are identifiers that enable a dependent

relation (on the __ of a relationship) to refer to its parent relation (on the __ of the relationship).

A

Foreign keys are identifiers that enable a dependent relation (on the many side of a relationship) to refer to its parent relation (on the one side of the relationship).

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

Keys can be _ (__) or __ (__).

A

Keys can be simple (a single field) or composite (more than one field).

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

Keys are usually used as __ to __ the response to user queries.

A

Keys are usually used as indexes to speed up the response to user queries.

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

Domain Constraints ?

A

Allowable values for an attribute (includes data types and restrictions on values)

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

Entity Integrity ?

A

No primary key attribute may be null. All primary key fields MUST contain data values.

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

Referential Integrity ?

A

Rules that maintain consistency between the rows of two related tables. rule states that any foreign key value (on the relation of the many side) MUST match a primary key value in the relation of the one side.(Or the foreign key can be null.)

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

Example of Referential Integrity ?

A

Delete Rules :
Restrict – don’t allow delete of “parent” side if related rows exist in “dependent” side
Cascade – automatically delete “dependent” side rows that correspond with the “parent” side row to be deleted
Set-to-Null – set the foreign key in the dependent side to null if deleting from the parent side → not allowed for weak entities

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

Mapping Regular Entities to Relations
– Simple attributes ?
– Composite attributes ?
– Multivalued attributes ?

A

Mapping Regular Entities to Relations
– Simple attributes: E-R attributes map directly onto the relation
– Composite attributes: Use only their simple,
component attributes
– Multivalued attributes: Become a separate relation
with a foreign key taken from the superior entity

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

Mapping Weak Entities
– Becomes a __ with a __ taken from the superior entity
– Primary key composed of ?

A

Mapping Weak Entities
– Becomes a separate relation with a foreign key taken from the superior entity
– Primary key composed of:
▪ Partial identifier of weak entity
▪ Primary key of identifying relation (strong entity)

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

Mapping Binary Relationships
– One-to-Many ?
– Many-to-Many ?
– One-to-One ?

A

Mapping Binary Relationships
– One-to-Many – Primary key on the one side becomes a foreign key on the many side
– Many-to-Many – Create a new relation with the primary keys of the two entities as its primary key
– One-to-One – Primary key on mandatory side becomes a foreign key on optional side

17
Q

Mapping Associative Entities
– Identifier Not Assigned ?
– Identifier Assigned ?

A

Mapping Associative Entities
– Identifier Not Assigned
▪ Default primary key for the association relation is
composed of the primary keys of the two entities
(as in M:N relationship)
– Identifier Assigned
▪ It is natural and familiar to end-users
▪ Default identifier may not be unique

18
Q

Mapping Unary Relationships
– One-to-Many ?
– Many-to-Many ?

A

Mapping Unary Relationships
– One-to-Many – Recursive foreign key in the same
relation
– Many-to-Many – Two relations:
▪ One for the entity type
▪ One for an associative relation in which the
primary key has two attributes, both taken from the
primary key of the entity

19
Q

Mapping Ternary (and n-ary) Relationships ?

A

Mapping Ternary (and n-ary) Relationships
– One relation for each entity and one for the
associative entity
– Associative entity has foreign keys to each entity in
the relationship

20
Q

Mapping Supertype/Subtype Relationships ?

A

Mapping Supertype/Subtype Relationships
– One relation for supertype and for each subtype
– Supertype attributes (including identifier and subtype
discriminator) go into supertype relation
– Subtype attributes go into each subtype; primary key
of supertype relation also becomes primary key of
subtype relation
– 1:1 relationship established between supertype and
each subtype, with supertype as primary table

21
Q

Data normalization ?

A

A tool to validate and improve a logical design so that it satisfies certain constraint that avoid uncecessary duplication of data. The process of decomposing relation with anomalies to produce smaller and well structured relation

22
Q

Well structured relation ?

A

Relations that contains minimal data redundancy and allow users to insert, delete and update rows without causing data inconsistencies.

23
Q

Insertion anomaly ?

A

Adding new rows forces user to create duplicate data

24
Q

Deletion anomaly ?

A

Deleting rows may cause a loss of data that would be needed for other future rows

25
Q

Modification anomaly ?

A

Changing data in a row forces changes to other rows because of duplication

26
Q

Non relation to 1NF ?

A

Remove multivalued attributes

27
Q

1NF to 2NF ?

A

Remove partial dependencies

28
Q

2NF to 3NF ?

A

Remove transitive dependencies

29
Q

3NF to Boyce-Codd normal form ?

A

Remove remaining anomalies resulting from multiple candidate keys

30
Q

Boyce-Codd normal form to 4NF ?

A

Remove multivalued dependencies

31
Q

4NF to 5NF ?

A

Remove remaining anomalies

32
Q

Functional Dependency ?

A

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

33
Q

Candidate key ?

A
  • A unique identifier. One of the candidate keys will become the primary key
  • Each non-key field is functionally dependent on every candidate key.