File notes/fig/er/accident.tex changed (mode: 100644) (index ea306b2..2fe03c4) |
7 |
7 |
\node[attribute] (name) [above left of=person] {Name} edge (person); |
\node[attribute] (name) [above left of=person] {Name} edge (person); |
8 |
8 |
\node[attribute] (address) [below left of=person] {address} edge (person); |
\node[attribute] (address) [below left of=person] {address} edge (person); |
9 |
9 |
|
|
10 |
|
\node[relationship] (owns) [above right of=person] {Owns} edge node[above, sloped]{$M$} (person); |
|
11 |
|
\node[entity] (car) [above right of=owns] {Car} edge node[above, sloped]{$N$} (owns); |
|
|
10 |
|
\node[relationship] (owns) [above right of=person] {Owns} edge node[left]{$\cM$} (person); |
|
11 |
|
\node[entity] (car) [above right of=owns] {Car} edge node[left=0.1]{$\cN$} (owns); |
12 |
12 |
\node[attribute] (licence) [above left of=car] {\key{licence}} edge (car); |
\node[attribute] (licence) [above left of=car] {\key{licence}} edge (car); |
13 |
13 |
\node[attribute] (model) [above of =car] {model} edge (car); |
\node[attribute] (model) [above of =car] {model} edge (car); |
14 |
14 |
\node[attribute] (year) [above right of =car] {year} edge (car); |
\node[attribute] (year) [above right of =car] {year} edge (car); |
15 |
15 |
|
|
16 |
|
\node[relationship] (accident) [right = 5cm of person] {Accident} edge[total] node[above, sloped]{$M$} (person); |
|
|
16 |
|
\node[relationship] (accident) [right = 5cm of person] {Accident} edge[total] node[above]{$\cM$} (person); |
17 |
17 |
\node[attribute] (report_number) [below of = accident] {\key{Report Number}} edge (accident); |
\node[attribute] (report_number) [below of = accident] {\key{Report Number}} edge (accident); |
18 |
18 |
\node[attribute] (time) [right of = accident] {Time} edge (accident); |
\node[attribute] (time) [right of = accident] {Time} edge (accident); |
19 |
19 |
\node[attribute] (place) [below right of = accident] {Place} edge (accident); |
\node[attribute] (place) [below right of = accident] {Place} edge (accident); |
20 |
20 |
\node[attribute] (damage_amount) [above right of = accident] {Damage\_Amount} edge (accident); |
\node[attribute] (damage_amount) [above right of = accident] {Damage\_Amount} edge (accident); |
21 |
21 |
|
|
22 |
|
\draw (car) edge[total] node[above, sloped]{$N$} (accident); |
|
|
22 |
|
\draw (car) edge[total] node[right=0.15]{$\cN$} (accident); |
23 |
23 |
\end{tikzpicture} |
\end{tikzpicture} |
24 |
24 |
|
|
25 |
25 |
\end{document} |
\end{document} |
File notes/fig/er/conference.tex copied from file notes/fig/er/award.tex (similarity 53%) (mode: 100644) (index 5c426f0..dcecfee) |
2 |
2 |
\input{template.def} |
\input{template.def} |
3 |
3 |
|
|
4 |
4 |
\begin{tikzpicture}[node distance=1.5cm] |
\begin{tikzpicture}[node distance=1.5cm] |
5 |
|
\node[entity] (INSTITUTION) {INSTITUTION}; |
|
6 |
|
\node[attribute] [above of=INSTITUTION] {\key{Name}} edge (INSTITUTION); |
|
7 |
|
\node[attribute] [right = .5cm of INSTITUTION] {Phone} edge (INSTITUTION); |
|
8 |
|
\node[attribute] (Address) [below = .5cm of INSTITUTION] {Address} edge (INSTITUTION); |
|
|
5 |
|
\node[entity] (Conference) {CONFERENCE}; |
|
6 |
|
\node[attribute] (fullname) [above of=Conference] {\key{Full Name}} edge (Conference); |
|
7 |
|
\node[attribute] [above right = .5cm of fullname] {Name} edge (fullname); |
|
8 |
|
\node[attribute] [above left = .5cm of fullname] {Edition} edge (fullname); |
|
9 |
|
\node[multi attribute] [left = .5cm of Conference] {Day} edge (Conference); |
|
10 |
|
% |
|
11 |
|
\node[ident relationship] (Hosts) [right = 1.5cm of Conference] {HOSTS} edge node[above, pos=0.4] {$\c1$} (Conference); |
|
12 |
|
% |
|
13 |
|
\node[weak entity] (Session) [right = 1.5cm of Hosts] {SESSION} edge[total] node[above, pos=0.6]{$\cM$} (Hosts); |
|
14 |
|
\node[attribute] [above = .5cm of Session] {\pkey{Time Frame}} edge (Session); |
|
15 |
|
% |
|
16 |
|
\node[relationship] (ModeratedBy) [above right = 1 and 2 cm of Session] {MODERATED\_BY} edge[total] node[above=0.1] {$\cM$} (Session); |
|
17 |
|
\node[relationship] (JudgedBy) [below right = 1 and 2 cm of Session] {JUDGED\_BY} edge[total] node[above=0.1] {$\cM$} (Session); |
|
18 |
|
% |
|
19 |
|
\node[entity] (Faculty) [below right = 1cm and 2cm of ModeratedBy] {FACULTY} edge node[above, pos=0.6]{$\c1$} node[right=0.1]{Moderator} (ModeratedBy) edge node[above, pos=0.6]{$\cM$} node[right=0.16]{Judge} (JudgedBy); |
|
20 |
|
\node[attribute] [above = .9cm of Faculty] {\key{email}} edge (Faculty); |
|
21 |
|
\node[attribute] [right = .5cm of Faculty] {Title} edge (Faculty); |
|
22 |
|
\node[attribute] [above right = .5cm of Faculty] {Name} edge (Faculty); |
|
23 |
|
% |
|
24 |
|
\node[relationship] (PresentedAt) [below = 1.5 cm of Session] {PRESENTED\_AT} edge[total] node[right=0.1] {$\c1$} (Session); |
|
25 |
|
\node[attribute] [above left = .5cm of PresentedAt] {Title} edge (PresentedAt); |
|
26 |
|
\node[attribute] [left = .5cm of PresentedAt] {Length} edge (PresentedAt); |
|
27 |
|
% |
|
28 |
|
\node[entity] (Abstract) [below = 5 cm of Conference] {ABSTRACT} edge node[left=0.3] {$\cM$} node[below right=-.2 and 0.4] {Talk} (PresentedAt); |
|
29 |
|
\node[attribute] [left = .5cm of Abstract] {\key{Title}} edge (Abstract); |
|
30 |
|
\node[attribute] [below left = .5cm of Abstract] {Content} edge (Abstract); |
|
31 |
|
\node[multi attribute] [below = .5cm of Abstract] {Keyword} edge (Abstract); |
|
32 |
|
% |
|
33 |
|
\node[entity] (Student) [below = 5 cm of Faculty] {STUDENT} edge node[right=0.3] {$\c1$} node[right=0.9] {Presenter} (PresentedAt); |
|
34 |
|
\node[attribute] [below=.5cm of Student] {\key{id}} edge (Student); |
|
35 |
|
% |
|
36 |
|
\node[relationship] (AuthoredBy) [below = .5 cm of PresentedAt] {AUTHORED\_BY} edge[total] node[above=0.1] {$\cN$} (Abstract) edge node[above=0.1] {$\cM$} node[right=0.9] {Author} (Student); |
|
37 |
|
% |
|
38 |
|
\node[relationship] (SubmittedTo) [below = 1 cm of Conference] {RECEIVED} edge node[right=0.1] {$\cN$} node[below left=-.1]{Submission} (Abstract) edge node[right=0.1] {$\cM$} (Conference); |
|
39 |
|
% |
|
40 |
|
\node[relationship] (Mentors) [below = 1 cm of Faculty] {MENTORS} edge node[left=0.1] {$\cN$} node[right=0.1] {Mentor} (Faculty) edge node[left=0.1] {$\cM$} node[right=0.1] {Mentee} (Student); |
|
41 |
|
\end{tikzpicture} |
|
42 |
|
|
|
43 |
|
\end{document} |
|
44 |
|
|
9 |
45 |
\node[attribute] [left = .5cm of Address] {Street} edge (Address); |
\node[attribute] [left = .5cm of Address] {Street} edge (Address); |
10 |
46 |
\node[attribute] [below = .5cm of Address] {Zip} edge (Address); |
\node[attribute] [below = .5cm of Address] {Zip} edge (Address); |
11 |
47 |
\node[attribute] [below left = .5cm of Address] {City} edge (Address); |
\node[attribute] [below left = .5cm of Address] {City} edge (Address); |
|
14 |
50 |
\node[attribute] [below right = .5cm of Location] {State} edge (Location); |
\node[attribute] [below right = .5cm of Location] {State} edge (Location); |
15 |
51 |
\node[derived attribute] [right = .5cm of Location] {Code} edge (Location); |
\node[derived attribute] [right = .5cm of Location] {Code} edge (Location); |
16 |
52 |
% |
% |
17 |
|
\node[relationship] (AWARDEDTO) [left = 1.5cm of INSTITUTION] {AWARDED\_TO} edge node[above, pos=0.4] {$\cN$} (INSTITUTION); |
|
|
53 |
|
|
18 |
54 |
% |
% |
19 |
|
\node[entity] (AWARD) [left = 1.5cm of AWARDEDTO] {AWARD} edge[total] node[above, pos=0.6]{$\cM$} (AWARDEDTO); |
|
|
55 |
|
|
20 |
56 |
\node[attribute] [below right = .5cm and .5cm of AWARD] {Title} edge (AWARD); |
\node[attribute] [below right = .5cm and .5cm of AWARD] {Title} edge (AWARD); |
21 |
57 |
\node[attribute] [left = .5cm of AWARD] {Amount} edge (AWARD); |
\node[attribute] [left = .5cm of AWARD] {Amount} edge (AWARD); |
22 |
58 |
\node[attribute] (Period) [below left = .5cm of AWARD] {Period} edge (AWARD); |
\node[attribute] (Period) [below left = .5cm of AWARD] {Period} edge (AWARD); |
|
34 |
70 |
\node[attribute] [below left = 0.5cm of Name] {Last Name} edge (Name); |
\node[attribute] [below left = 0.5cm of Name] {Last Name} edge (Name); |
35 |
71 |
\node[attribute] [below = 0.5cm of RESEARCHER] {\key{email}} edge (RESEARCHER); |
\node[attribute] [below = 0.5cm of RESEARCHER] {\key{email}} edge (RESEARCHER); |
36 |
72 |
|
|
37 |
|
\node[relationship] (CONDUCTEDBY) [below = 1 cm of AWARD] {CONDUCTED\_BY} edge[total] node[right, pos=0.4] {$\cM$} (AWARD) edge node[left]{$\cN$} (RESEARCHER); |
|
|
73 |
|
|
38 |
74 |
\node[attribute] [right = .5cm of CONDUCTEDBY] {Role} edge (CONDUCTEDBY); |
\node[attribute] [right = .5cm of CONDUCTEDBY] {Role} edge (CONDUCTEDBY); |
39 |
75 |
|
|
40 |
76 |
\node[attribute] (RePeriod) [right = .5cm of RESEARCHER] {Period} edge (RESEARCHER); |
\node[attribute] (RePeriod) [right = .5cm of RESEARCHER] {Period} edge (RESEARCHER); |
|
61 |
97 |
\node[attribute] [below left = 1cm of DIVISION] {Abbreviation} edge (DIVISION); |
\node[attribute] [below left = 1cm of DIVISION] {Abbreviation} edge (DIVISION); |
62 |
98 |
|
|
63 |
99 |
\node[relationship] (BELONG2) [above left = 1cm and 0cm of DIRECTORATE] {BELONGS\_TO} edge node[above]{$1$} (DIRECTORATE) edge[total] node[above=0.2cm ]{$\cM$}(DIVISION); |
\node[relationship] (BELONG2) [above left = 1cm and 0cm of DIRECTORATE] {BELONGS\_TO} edge node[above]{$1$} (DIRECTORATE) edge[total] node[above=0.2cm ]{$\cM$}(DIVISION); |
64 |
|
\end{tikzpicture} |
|
65 |
100 |
|
|
66 |
|
\end{document} |
|
File notes/lectures_notes.md changed (mode: 100644) (index 4a84d50..7909cdc) |
... |
... |
Problem (Incorrect ER diagram) +.#incorrect-er |
7423 |
7423 |
This diagram, to your expert eyes, has multiple flaws, missing constraints, and has some inconsistencies with their requirements. |
This diagram, to your expert eyes, has multiple flaws, missing constraints, and has some inconsistencies with their requirements. |
7424 |
7424 |
List as many as you can, and suggest improvments or solution when you can think of one. |
List as many as you can, and suggest improvments or solution when you can think of one. |
7425 |
7425 |
|
|
|
7426 |
|
--- |
|
7427 |
|
|
|
7428 |
|
Problem (ER diagram for Undergraduate Conference) +.#conf-er |
|
7429 |
|
~ |
7426 |
7430 |
|
|
|
7431 |
|
Draw the ER diagram corresponding to the following situation for conferences on undergraduate research: |
|
7432 |
|
|
|
7433 |
|
> Every conference has a name, an edition ("First", "Second", etc.), and it takes place during particular days. Students can submit abstracts (made of a title, multiple keywords and a content) and, if accepted, they will give talks (that have a title and a length) during particular sessions. Note that an abstract can have multiple students as authors, but that a talk is given by exactly one student. A session must have exactly one moderator (who is a Faculty member), multiple judges (that are Faculty members as well), and a time frame. Faculty members have an email, a name, a title, and they can also mentor zero, one or multiple students. |
|
7434 |
|
|
|
7435 |
|
Indicate all the assumptions or choices you are making, but try to make as few assumptions as possible. |
|
7436 |
|
|
7427 |
7437 |
--- |
--- |
7428 |
7438 |
|
|
7429 |
7439 |
Problem (Reverse engineering by hand) +.#Reverse-Engineering-ACTOR |
Problem (Reverse engineering by hand) +.#Reverse-Engineering-ACTOR |
|
... |
... |
Solution to [%D %n (%T)](#problem:incorrect-er) |
8126 |
8136 |
|
|
8127 |
8137 |
--- |
--- |
8128 |
8138 |
|
|
|
8139 |
|
Solution to [%D %n (%T)](#problem:conf-er) |
|
8140 |
|
~ |
|
8141 |
|
|
|
8142 |
|
A possible solution is: |
|
8143 |
|
|
|
8144 |
|
 |
|
8145 |
|
\ |
|
8146 |
|
|
|
8147 |
|
Where we made the following assumptions: |
|
8148 |
|
|
|
8149 |
|
- A student has an id (note that having an entity type without attributes is improper, so we had to make an attribute), |
|
8150 |
|
- No two sessions for the same coneference can take place at the exact same time, |
|
8151 |
|
- Conferences cannot have joint sessions. |
|
8152 |
|
|
|
8153 |
|
Also, note that we could have decided to make Presentation an entity instead of a relationship: both choices were correct. |
|
8154 |
|
To determine if an abstract was accepted, one has to "track" whenever it is in the PRESENTED\_AT relationship. Another option would have been to add a "Accepted" attribute to the RECEIVED relationship. |
|
8155 |
|
|
|
8156 |
|
|
|
8157 |
|
--- |
|
8158 |
|
|
|
8159 |
|
|
8129 |
8160 |
Solution to [%D %n (%T)](#problem:ERtoRELBike) |
Solution to [%D %n (%T)](#problem:ERtoRELBike) |
8130 |
8161 |
~ |
~ |
8131 |
8162 |
|
|