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
Based on the given information, we can identify three primary entity-types:
- Trip: Represents a single holiday journey.
- trip_id (primary key)
 - start_date
 - end_date
 - cost
 
 - **Country: Represents a country visited.
- country_code (primary key)
 - country_name
 - continent
 
 - Visit: Represents a visit to a specific country within a trip.
- visit_id (primary key)
 - trip_id (foreign key to Trip)
 - country_code (foreign key to Country)
 - number_of_days
 
 
