File notes/fig/er/accident_bis.tex added (mode: 100644) (index 0000000..c1cff85) |
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
\begin{tikzpicture}[node distance=7em] |
|
5 |
|
\node[entity] (person) {Person}; |
|
6 |
|
\node[attribute] (pid) [left of=person] {\key{id}} edge (person); |
|
7 |
|
\node[attribute] (name) [above left of=person] {Name} edge (person); |
|
8 |
|
\node[attribute] (address) [below left of=person] {Address} edge (person); |
|
9 |
|
|
|
10 |
|
\node[relationship] (owns) [above right of=person] {Owns} edge node[above, sloped]{$\c1$} (person); |
|
11 |
|
\node[entity] (car) [above right of=owns] {Car} edge[total] node[above, sloped]{$\cM$} (owns); |
|
12 |
|
\node[relationship] (co-owns) [above = 1.9cm of person] {Co-Owns} edge node[left]{$\cM$} (person) edge node[above, sloped]{$\cM$} (car); |
|
13 |
|
\node[attribute] (licence) [above left of=car] {\key{VIN}} edge (car); |
|
14 |
|
\node[attribute] (model) [above of =car] {ModelYear} edge (car); |
|
15 |
|
\node[attribute] (make) [above right of =model] {Model} edge (model); |
|
16 |
|
\node[attribute] (year) [above left of =model] {Year} edge (model); |
|
17 |
|
|
|
18 |
|
\node[relationship] (accident) [right = 5cm of person] {Accident} edge node[above, sloped]{$M$} node[above, pos=0.2]{driver} (person); |
|
19 |
|
\node[attribute] (time) [right of = accident] {Time} edge (accident); |
|
20 |
|
\node[attribute] (place) [below right of = accident] {Place} edge (accident); |
|
21 |
|
\node[attribute] (damage_amount) [above right of = accident] {Damage\_Amount} edge (accident); |
|
22 |
|
|
|
23 |
|
\draw (car) edge node[above, sloped]{$N$} (accident); |
|
24 |
|
\end{tikzpicture} |
|
25 |
|
|
|
26 |
|
\end{document} |
File notes/lectures_notes.md changed (mode: 100644) (index ee220af..ee49d1c) |
... |
... |
The quizzes are not indicated, but were generally a mix of up to five exercises |
121 |
121 |
- [%D %n (%T)](#problem:grade_report) |
- [%D %n (%T)](#problem:grade_report) |
122 |
122 |
- [%D %n (%T)](#problem:cellphones) |
- [%D %n (%T)](#problem:cellphones) |
123 |
123 |
- Five small exercises about [data base application](#exercises-4). |
- Five small exercises about [data base application](#exercises-4). |
|
124 |
|
- Final: |
|
125 |
|
- [%D %n (%T)](#problem:accident-er) |
124 |
126 |
|
|
125 |
127 |
### Spring 2020 {-} |
### Spring 2020 {-} |
126 |
128 |
|
|
|
... |
... |
Problem (From business statements to ER diagram -- UNIVERSITY) +.#BusinessToEr |
7063 |
7065 |
|
|
7064 |
7066 |
--- |
--- |
7065 |
7067 |
|
|
|
7068 |
|
Problem (Studying an Accident ER Diagram) +.#accident-er |
|
7069 |
|
~ |
|
7070 |
|
Have a look at the diagram below: |
|
7071 |
|
|
|
7072 |
|
 |
|
7073 |
|
\ |
|
7074 |
|
|
|
7075 |
|
The assumption is that a car has exactly one (primary) owner, but can additionally have multiple co-owners, and that the "Accident" relationship gathers information about who was driving which car when accident happened, along with some other information about the accident. |
|
7076 |
|
|
|
7077 |
|
#. Answer the following short questions, justifying your answers: |
|
7078 |
|
|
|
7079 |
|
#. Can this model be used to determine if the driver involved in the accident was owning the car? |
|
7080 |
|
#. What could justify having the "Address" attribute being composite? |
|
7081 |
|
#. Is it possible to determine if multiple cars were involved in the same accident? |
|
7082 |
|
|
|
7083 |
|
#. Convert the diagram to a relational model. |
|
7084 |
|
|
|
7085 |
|
#. We want to edit the ER diagram to be able to record multiple quotes per accident instead of having a single "Damage_Amount". |
|
7086 |
|
To do that, we would like to create a "Quote" weak entity with attributes for the amount and the contact information of the garage who wrote it. |
|
7087 |
|
Your task is to |
|
7088 |
|
#. Have Accident becomes an entity, |
|
7089 |
|
#. Create a relationship between Accident, Car and Person to convey the information that was previously conveyed by the Accident relationship, |
|
7090 |
|
#. Create a weak entity Quote with the required attributes and relationship. |
|
7091 |
|
|
|
7092 |
|
You should draw only the part of the ER diagram that will change, no need to copy all of it. |
|
7093 |
|
|
|
7094 |
|
--- |
|
7095 |
|
|
7066 |
7096 |
|
|
7067 |
7097 |
Problem (Normal form of a CAR\_SALE relation) +.#carsale |
Problem (Normal form of a CAR\_SALE relation) +.#carsale |
7068 |
7098 |
~ |
~ |