Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
modul:m290:learningunits:lu03:loesungen:l02 [2024/08/14 15:18] – angelegt vdemir | modul:m290:learningunits:lu03:loesungen:l02 [2024/10/02 15:13] (aktuell) – vdemir | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== | + | ====== |
- | ===== Given business case ===== | + | For this scenario, the following |
- | As overreaching goal, we want to administrate our holidays. Though we want to store the following | + | |
- | * 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 ==== | + | 1. Country |
- | Analyse the given business case and design an ERD that matches the requirements of the business case. | + | * Attributes |
+ | * CountryID (Primary Key) | ||
+ | * CountryName | ||
+ | * ContinentName | ||
- | ===== Solution ===== | + | 2. Trip |
- | Based on the given information, | + | * 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. | ||
- | * **Trip**: Represents a single holiday journey. | + | 3. Continent |
- | * trip_id (primary key) | + | * Attributes: |
- | * start_date | + | * ContinentID |
- | * end_date | + | * ContinentName |
- | * cost | + | * Relationships: |
- | * **Country: Represents a country visited. | + | * Country: Each country is located on one continent. |
- | * country_code | + | |
- | * 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 | + | |
+ | 4. Relationships: | ||
+ | * One-to-Many: | ||
+ | * A Continent can have many Countries. | ||
+ | * A Country can have many Trips. | ||
- | ===== Vocabulary ===== | ||
- | ^ English ^ German ^ | ||
- | | prerequite | Grundvoraussetzung | | ||
+ | 5. ERM in Crow's feet notation | ||
+ | * Continent (1) ————< | ||
+ | * Country (1) ————< | ||
+ | {{: | ||
+ | |||
+ | ===== Vocabulary ===== | ||
+ | ^ English ^ German ^ | ||
+ | | prerequisite | Grundvoraussetzung | | ||
+ | | given| gegebene, vorausgesetzt | | ||
---- | ---- | ||
[[https:// | [[https:// |