Dies ist eine alte Version des Dokuments!
LU03.L02 - Designing an ERD
Given business case
As overreaching goal, we want to administrate our holidays. Though we want to store the following information:
- which countries we visited so far
 - how long we stayed in each country
 - on which continent each country is located
 - the price for each trip
 - the date of each trip
 
Task: Design a ERD
Analyse the given business case and design an ERD that matches the requirements of the business case.
Solution
For this scenario, the following entities are identified:
1. Country
- Attributes
- CountryID (Primary Key)
 - CountryName
 - ContinentName
 
 
2. Trip
- Attributes
- TripID (Primary Key)
 - CountryID (Foreign Key)
 - StartDate
 - EndDate
 - Price
 
 - Relationships:
- Country: A trip occurs in one country.
 - Duration: Calculated as the difference between EndDate and StartDate.
 
 
3. Continent
- Attributes:
- ContinentID (Primary Key)
 - ContinentName
 
 - Relationships:
- Country: Each country is located on one continent.
 
 
4. Relationships:
- One-to-Many:
- A Continent can have many Countries.
 - A Country can have many Trips.
 
 
5 ERD in Crow's feet notation Continent (1) ————< has >———— (∞) Country Country (1) ————< hosts >———— (∞) Trip
