L2 ERD Flashcards
What is a ISA relationship?
I Also known as generalisation/specialisation.
When an entity type contains certain entities that have special properties not shared by all entities, this suggests two entity types should be created with an ISA relationship type between them.
I E.g. An Employee ISA Person and a Student ISA Person I If Employee ISA Person then Employee inherits all the attributes of Person.
What is a composite key?
composite keys are keys having more than one attribute, such as {Department, University} and {Name, Address}
What is meant by a cyclic relationship type, including the part played by roles in the relationship type?
- a relationship type between two occurrences of the same entity type.
- Examples:
- Marriage between Person and itself.
- Parent-Child between Person and itself.
- Part-Sub-Part between Part and itself.
- With each entity type in a cyclic relationship type we associate a role, represented by labels on lines in an ERD.
What is The Entity Relationship Model?
An example of a conceptual (high-level) data model
I Useful for design before moving to a lower level
model (e.g. relational)
What are alternatives to ERD?
UML (Unified Modelling Language) and I ODL (Object Description Language)
What are the main parts of ERD
Structural part
- entity types
- attributes
- relationship types
Integrity constraints
- primary keys for entity types and relationship types,and
- multiplicity (cardinality) constraints for relationship types
What are the main advantages of the ERD?
The diagrams (ERDs) associated with entity-relationship models
- are relatively simple
- are user-friendly
- can provide a unified view of data, which is independent of any implemented data model
What is an entity?
An entity is a “thing” that exists and can be uniquely
identified, e.g., an individual person.
What are entity types?
- An entity type (or entity set) is a collection of similar entities, e.g., a collection of people.
- An entity type
- is similar to a class in object-oriented languages
- has associated attributes, which represent properties of the entities comprising the entity type
- is represented in an ERD by a rectangle
What are attributes?
- properties ofentity types.
- Each attribute usually has only simple values (e.g. integers or character strings)
- represented by an oval in an ERD, with a line to the rectangle representing its entity type
- Sometimes multi-valued attributes (e.g. Phones) are allowe represented by a double oval in an ERD
What is the Domain?
The domain of an attribute of an entity type is the set of
constant values associated with that attribute.
What is a relationship type?
A relationship type is an association between two or more
entity types.
Relationship types are represented in an ERD by diamond shapes, with lines to each of the rectangles representing entity types involved in the association
What are Relationships?
A relationship is an instance of a relationship type, i.e., it is the set of associations between the entities comprising the entity types associated by the relationship type.
Which types of Multiplicity / Cardinality exist?
- many-to-one (or one-to-many)
- An Employee Works in one Department or a Department has many Employees.
- one-to-one
- A Manager Heads one Department and vice versa.
- many-to-many
- A Lecturer Teaches many Students and a Student is Taught by many Lecturers.
Which Participation Constraints exist?
optional relationship
I e.g., an Employee may or may not be assigned to a
Department
I Participation of entity (e.g., Employee) in relationship
is said to be partial
I This is the default for relationships in our notation
I (Sometimes indicated by cardinality constraint of 0..*)
I mandatory relationship
I e.g., every Course must be Taught by at least one
Lecturer
I Participation of entity (e.g., Course) in relationship
said to be total
I Indicated by double lines in our notation
I (Sometimes indicated by cardinality constraint of 1..*)