Lecture 6 Flashcards
How to draw a high-level database model?
- Draw diagram, as starting point for you relational database, DO NOT start with FDs, normal forms and decompositions. Instead start with objects like Customers, Invoices and Orders.
- Convert diagram to version 1 of you relation schemas
- Apply database-design theory to normalize schemas.
What does ER stand for?
Entity/Relationship model
What does ES stand for?
Entity Sets
What is the definition for a key in an ES?
A set K of one or more attributes s.t., given two distinct entities e1 in A and e2 in E, they cannot have identical values for each attribute in key K
What are the requirements of keys in ES?
- Every ES must have a key
- There can be multiple keys for an ES
- When ES is in isa-hierarchy, root ES is required to have all attributes needed for a key
What does an arrow with and without referential integrity look like?
With thin, without fat.
What is referential integrity?
A value appearing in one context, to appear as well in another context.
What is the definition of a weak entity set?
An ES with key composed of some attributes belonging to other ES(s)
Why do weak ESs typically arise?
- Weak ES is part of hierarchy, not of the isa type
2. Weak ES is a connecting ES (to replace multiway relationship), don’t have a key.
What follows from a weak ES?
If E is a weak ES, then its key consist of:
- Zero or more of its own attributes, and
- key attributes from ESs that are reached by ‘specific’ many-one relationships R from E to other ESs.
What is relationship R, that makes ES F ‘contribute’ to key of weak ES E called?
A supporting relationship
How to convert an ER diagram to relation schema?
- Turn each ES into relation with same attributes as ES
2. Replace relationship by relation, with keys from connected ESs as attributes
What are the 3 approaches to convert subclass structures?
- Follow ER viewpoint, for each ES E in hierarchy, create a relation
- Treat entities as object belonging to only a single class: for each possible subtree including the root, create on relation
- Use null values: one big relation with all attributes of all ESs in hierarchy.