ER Diagrams and the Relational Model Flashcards
1
Q
Entities
A
- “Things”
- Represented using rectangles
2
Q
Attributes
A
- Describe entities
- Represented as ovals connected by a line to the entity
- Double ovals for attributes with multiple possible values
3
Q
Key
A
- A collection of attributes that can uniquely identify each entity in an entity set
4
Q
Candidate Key
A
- A minimal collection of attributes that is a key
5
Q
Primary Key
A
- Chosen from the set of possible candidate keys
- Underlined in the ER diagram
6
Q
Relationships between Entities
A
- Represented using diamonds that are connected to the relevant entity sets
- The Key is the union of the primary keys of the related entities
- The resulting key may not be minimal
7
Q
Role Indicators
A
- Labels on the lines to distinguish the roles of the entities in the relationship
8
Q
Cardinality Constraint
A
- Limits the number of times a given entity can appear in a relationship set
- An entity in A having “at most one” entity in B is denoted by an arrow going into entity in B
9
Q
Many-to-One Relationship
A
- In a many-to-one relationship from A to B, an entity in A can be related to at most one entity in B, and an entity in B can be related to 0+ entities in A
10
Q
One-to-One Relationship
A
- An entity in A can be related to at most one entity in B, and an entity in B can be related to at most one entity in A
11
Q
Many-to-Many Relationship
A
- An entity in A can be related to 0+ entities in B, and an entity in B can be related to 0+ entities in A
12
Q
Participation Constraint
A
- An entity in A having “at least one” entity in B is denoted by a thick line going from the entity in A
13
Q
Relational Terminology
A
- Table = relation
- Row = tuple
- Column = attribute
14
Q
Relational Schema
A
- Consists of the name of the relation, the name of the attributes, and the domains of the attributes
- The relational database schema is made up of the schemas of all of the relations in the database
15
Q
Special Case: Many-to-One Relationship Sets
A
- Eliminate the relation for the relationship set
- Combine the entity and attributes on the “one” end into the “many” end