Professional Documents
Culture Documents
Lab
1. Overview
• Database is the collection of information well organized so that data can be easily stored,
managed, updated, and retrieved.
• An Entity–relationship model (ER model) describes the structure of a database with the
help of a diagram, which is known as Entity Relationship Diagram (ER Diagram). An
ER model is a design or blueprint of a database that can later be implemented as a
database.
• ER diagram has three main components: Entity, Attribute, and Relationship.
• An entity is an object or component of data (tangible/ non-tangible)
• Once you install the software on your machine; create a new diagram:
• Name your diagram file, select: Entity Relationship Diagram and click on “create”:
• Your workspace is now ready, all you need to do is click on “Entity Relation” on the
bottom-left side of your window:
3. Exercise 1:
• One student may be enrolled in different associations at the same time. And might NOT be
enrolled at all!
• In one association, we have AT LEAST ONE student enrolled (the president!)
➔Next, define the relationships between your entities. Finally, define the cardinalities.
4. Exercise 2:
Transform the following verbal descriptions into their corresponding ER Diagrams:
a) Customer_Management
• In a shop, customers get discounts on items. Each item can only have one discount rate.
• Each item must belong to a category. Within one category, we find many items!
• The Customer has a unique id (CustomerId), a year of birth (YearBirth) and a Nationality.
• The item must have a unique id (ItemId) and a Price.
• The category has a CategoryId and a Name.
b) Company_Management
• A person is either an employee or a manager.
• A person works for one or more companies.
• Companies usually employ at least one person.
• A manager manages one department, which is assigned to one company, while companies have
several departments.
• A person is characterized by an Id, a name, an age, and a nationality.
• A manager, in addition, has number of years of service (YearsService).
• The department has a name and a description. And so does the company.
c) Flights_Management