Chapter 4: Logical Database Design and the Relational Model Flashcards
The entity relationship diagram is a logical data model (T or F)
False
What is the objective of logical database design?
To transform the conceptual design into a logical database design that can be implemented via a chosen dbms
The relational model is based on mathematics (T or F)
True
What are the 3 components of a relational data model?
- Data structure
- Data manipulation
- Data integrity
A named two-dimensional table
of data
relation
is an attribute or a combination of attributes that
uniquely identifies each row in a relation
primary key
A primary key that consists of
more than one attribute
composite key
What is used to show relationships with relations?
Foreign keys
In the shorthand notation, what is used to identify foreign and primary keys?
PK: Solid underline
FK: Dashed underline
Properties of Relations: What are the properties of relations?
- Has a unique name
- rows and columns are atomic
- each row is unique
- each column is unique
- The sequence of columns are insignificant
- the sequence of rows is insignificant
a description of the overall logical structure of the database
Schema
What are the two common methods for expressing a schema
- short text statements
- graphical representation
Integrity Constraints: What are the three constraints found in relational data models?
- Domain Constraint
- Entity Integrity
- Referential Integrity
Integrity Constraints: is the set of values that may be assigned to an attribute
Domain Constraint
Integrity Constraints: is design to ensure that every relation has a primary key and that the data values are all valid
Entity Integrity
Integrity Constraints: In entity integrity, it ensures that all primary key attributes are?
Non-null
Integrity Constraints: A value that may be assigned to an attribute when no other value
applies or when the applicable
value is unknown.
Null
Integrity Constraints: A rule that states that either each
foreign key value must match
a primary key value in another
relation or the foreign key value
must be null.
referential integrity constraint
Integrity Constraints: In referential integrity, it is allowed to have a null foreign key if?
The relationship is optional
Well-Structured Relations: A relation that contains __ ___ and allows users
to __ ___ __ ___the
rows in a table without errors or
inconsistencies.
- minimal redundancy
- insert, modify, and delete
Well-Structured Relations: Redundancies may lead to?
Anomalies
Well-Structured Relations: An error or inconsistency that
may result when a user attempts
to update a table that contains
redundant data
anomaly
Well-Structured Relations: What are the three anomalies?
- Insertion
- Deletion
- Modification
Well-Structured Relations: Restrictions in composite primary keys when creating new tables are what anomaly?
Insertion Anomaly
Well-Structured Relations: When a removal of an attribute leads to a deletion of the whole instance
Deletion Anomaly
Well-Structured Relations: When updating needs to be done to every instance is what type of anomaly?
Modification Anomaly
Transforming EER Diagrams into Relations: aare entities that have an independent existence and generally represent real-world objects, such as persons and products. It is represented by what in a graphical representation?
Regular Entities. By a solid line box
Transforming EER Diagrams into Relations: are entities that cannot exist except with an identifying relationship with an owner (regular) entity type. It is identified in a graphical representation as?
Weak Entities. A double line box
Transforming EER Diagrams into Relations: are formed from many-to-many relationships between other entity types. It is identified in a graphical representation with?
Associative Entities. Rounded cornered box
Transforming EER Diagrams into Relations: Associative entities are also called?
Gerunds
Transforming EER Diagrams into Relations: What are the steps in creating relational data models?
- Map Regular Entities
- Map Weak Entities
- Map Binary Entities
- Map Associative Entities
- Map Unary Entities
- Map Ternary Relationships
- Map Supertype/Subtype Relationships
Transforming EER Diagrams into Relations: What happens to entities in step 1?
They become relations/tables
Transforming EER Diagrams into Relations: What will you do if there are composite attributes from an entity?
Separate each attribute into its own columns
Transforming EER Diagrams into Relations: What would you do with multivalued attributes?
Create a separate relation for the said attribute, and then use the primary key of the original relation and the ex- multivalued attribute as the primary keys
Transforming EER Diagrams into Relations: Nonkey attributes are also called
descriptors
Transforming EER Diagrams into Relations: exists only
through an identifying relationship with another entity type called the
owner
Transforming EER Diagrams into Relations: a weak entity has no complete identified and only uses a?
partial identifier
Transforming EER Diagrams into Relations: What do you do when there is a weak and strong entity relationship in your E-R diagram?
The weak entity references the pk of the strong entity and its partial identifier as its primary keys
Transforming EER Diagrams into Relations: A serial number or other systemassigned primary key for a relation.
Surrogate primary key
Transforming EER Diagrams into Relations: What are the instances when you use a surrogate key?
- When there is a composite primary key
- When the natural primary key is inefficient
- When it cannot be unique in the future
Transforming EER Diagrams into Relations: For binary 1:M, what do you do?
Create two relations, wherein the foreign key is placed on the “many” relation
Transforming EER Diagrams into Relations: Are foreign keys required to be the same names at the primary key it is referencing?
No. As long as it has the same domain.
Transforming EER Diagrams into Relations: In binary m:n, how do you do it?
Create 3 relations, each having their own unique attributes while the third one uses a composite key of both the original relations. (Associative Entity)
Transforming EER Diagrams into Relations: In binary 1:1, what do you do?
Create 2 relations, the optional relation has the foreign key reference
Transforming EER Diagrams into Relations: When identifiers are not assigned, associative entities use what primary keys?
A composite primary key of the two related relations
Transforming EER Diagrams into Relations: When an identifier is assigned to an associative entity, how would the relation look like?
- The primary key will be the assigned one
- The primary keys of the other two relations are referenced using foreign keys
Transforming EER Diagrams into Relations: In unary 1:M relationships, how would you make it?
- Create a relation
- Add a foreign key that references the primary key of the same relation
Transforming EER Diagrams into Relations: A foreign key in a relation that references the primary key values of the same relation
recursive foreign key
Transforming EER Diagrams into Relations: A unary M:N relationship is made how?
- Create two relations (one is an associative entity)
- A composite key that references the PK of the main relation
Transforming EER Diagrams into Relations: In a ternary relationship what is the default primary key?
The primary keys of the three relation and partial identifier of the associative entity
Normalization: When should you use normalization?
- During logical database design
- When reverse-engineering older systems
decomposing relations with anomalies
Normalization
Normalization: Normalization makes no assumptions about how data will be used in displays (T or F)
True
Normalization: is based on normal forms or functional dependencies defines data usage (T or F)
False. Business Rules dapat
Normalization: A state of a relation that requires
that certain rules regarding
relationships between attributes
(or functional dependencies) are
satisfied
Normal form
Steps in Normalization: What is the rules for first normal form?
multivalued attributes have been removed
Steps in Normalization: Can intersections in the table be null I the first normal form?
Yes
Steps in Normalization: rule for 2nd normal form?
Remove partial functional dependencies
Steps in Normalization: rules for 3rd normal form
Transitive dependencies are removed
Steps in Normalization: Any remaining anomalies that result from functional dependencies have been removed
Boyce Codd normal form
Steps in Normalization: Any multivalued dependencies have been removed
foruth normal form
Steps in Normalization: Any remaining anomalies have been removed
Fifth normal form
Normalization:A constraint between two
attributes in which the value of
one attribute is determined by the
value of another attribute.
Functional dependency
Normalization:The attribute on the left side of the
arrow in a functional dependency
Determinant
Normalization:An attribute, or combination of
attributes, that uniquely identifies
a row in a relation
Candidate key
Normalization:What are the two properties of Candidate Keys?
- Unique
- Nonredundant
Normalization:Are all candidate keys determinants? What about the other way around?
All candidate keys are determinants but not all determinants are candidate keys
Normalization: What is the preliminary step in normalization?
Get a user view
exists when a nonkey attribute is functionally dependent
on part (but not all) of the primary key.
partial functional dependency
Normalization:A functional dependency between
the primary key and one or
more nonkey attributes that are
dependent on the primary key via
another nonkey attribute.
transitive dependency
Normalization: How to convert to 3rd normal form?
- Create a new relation
- Transfer all related attributes to the non pk
- Reference PK of new relation to the old relation
Merging Relations: Is also called?
View integration
Merging Relations: Two (or more) attributes that have
different names but the same
meaning
synonym
Merging Relations:An alternative name used for an
attribute.
alias
Merging Relations:An attribute that may have more
than one meaning
homonym
A primary key whose value is
unique across all relations.
Enterprise Key
Enterprise Key:This criterion makes a primary key more like what in object-oriented
databases is called
object identifier
Enterprise Key: If a enterprise key is already available, what would happen to the “old pks”
they would become non key attributes