The Entity-Relationship Model Flashcards
What is the ER Model?
The Entity-Relationship Model
Why would you want to model something?
- To understand something or for others to understand
- To plan
What are the steps in Database Design?
- Requirement Analysis
- Conceptual Database Design
- Map Semantic Schema to relational Schema
- Requirement Analysis
- Identify the data that needs to be stored
- What does the data look like?
- Identify the operations that need to be executed on the data
- What will we do with the data?
- Questions to ask:
- What are the entities and the relationships
- What info should about the entities and relationships should we store?
- Constraints?
- What operations do we want to execute on the entities?
- Conceptual Database Design
- Modeling
- Use semantic data model to develop a semantic schema
Think of an example of how the database of Minerva could be structured. Think about the entities and operations.
- Entities:
- students
- employees
- financial data
- courses
- etc…
- Operations:
- Access data
- Modify some data
What is the E/R Model?
- language that allows for a pictorially description of the data determined through the requirement analysis
What is an E/R diagram or schema?
- Representation of the data model of the application.
- Should be understandable by a non-computer scientist
What are the main concepts of the E/R model?
- Entities
- Relationships
Into what can an ER schema be translated to?
Relational Schema
What is an entity?
- Real world object described useing a set of attributes
What is an Entity set?
- Collection of similar entities
- Ex) Companies is an entity set containing entities such as Walmart, IGA, etc…
True or False
All entities in an entity set contain the same attributes?
True
What is an attribute?
Describes a property of the entity set.
What is a key?
- Minimum set of attributes whose values uniquely identify an entity in an entity set
- Can be natural (an attribute such as company name) or artificial (student ID)
- A key has to be UNDERLINED
What is one way to store an entity set?
Via a table
Ex) a table of companies with their respective attributes
What is a hierarchy when it comes to entities?
It is similar to having a subclass in OOP. They refer to special cases BUT different from OOP, you can create hierarchy only if they share many functionalities not attributes.
Ex) There are different types of companies such as: Sole, Partnership and Corporation
In and ER Model, how do you show/represent a hierarchy?
With the ISA keyword.
Why would you want to have a hierarchy of entity sets?
- Additional descriptive attributes
- Identification of a subclass that participates in a relationship
Where do entities reside?
p. 12
- E/R viewpoint:
- An entity has a component in each entity set to which it logically belongs. Its properties are the union of these entities.
- Note that we have a hierarchy of entity sets not entities.
- Contrast OOP-viewpoint:
- An object belongs to exactly one class. The subclass inherits the attributes of its superclass.