File notes/fig/er/Bike.tex added (mode: 100644) (index 0000000..5df1fda) |
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
\begin{tikzpicture}[node distance=1.5cm] |
|
5 |
|
\node[entity] (CUSTOMER) {CUSTOMER}; |
|
6 |
|
\node[attribute] [above of=CUSTOMER] {\key{Name}} edge (CUSTOMER); |
|
7 |
|
\node[attribute] [right = .5cm of CUSTOMER] {Phone} edge (CUSTOMER); |
|
8 |
|
% |
|
9 |
|
\node[ident relationship] (DROPPEDBY) [left = 1.5cm of CUSTOMER] {DROPPED\_BY} edge node[above, pos=0.4] {$1$} (CUSTOMER); |
|
10 |
|
% |
|
11 |
|
\node[weak entity] (BIKE) [left = 1.5cm of DROPPEDBY] {BIKE} edge[total] node[above, pos=0.6]{$\cM$} (DROPPEDBY); |
|
12 |
|
\node[attribute] [above of = BIKE] {\pkey{Dropped\_Time\_Date}} edge (BIKE); |
|
13 |
|
\node[attribute] (Description) [left = 0.5cm of BIKE] {Description} edge (BIKE); |
|
14 |
|
\node[attribute] [above left of = Description] {Color} edge (Description); |
|
15 |
|
\node[attribute] [below left of = Description] {Brand} edge (Description); |
|
16 |
|
% |
|
17 |
|
\node[relationship] (ASSIGNEDTO) [below =1cm of CUSTOMER] {ASSIGNED\_TO} edge [total] node[right, pos=0.4] {$\cM$} (CUSTOMER); |
|
18 |
|
\node[attribute] [right = .5cm of ASSIGNEDTO] {Level\_Of\_Satisfaction} edge (ASSIGNEDTO); |
|
19 |
|
% |
|
20 |
|
\node[entity] (EMPLOYEE) [below = 5cm of CUSTOMER] {EMPLOYEE} edge node[right, pos=0.4] {$1$} (ASSIGNEDTO); |
|
21 |
|
\node[attribute] [right = .5cm of EMPLOYEE] {\key{Name}} edge (EMPLOYEE); |
|
22 |
|
\node[multi attribute] [below = .5cm of EMPLOYEE] {Specialty} edge (EMPLOYEE); |
|
23 |
|
% |
|
24 |
|
\node[relationship] (REPAIREDBY) [below right =3cm of BIKE] {REPAIRED\_BY} edge node[below, pos=0.6] {$\cM$} (BIKE) edge node[below, pos=0.6] {$1$} (EMPLOYEE); |
|
25 |
|
|
|
26 |
|
|
|
27 |
|
%\node[entity] (CUSTOMER) {CUSTOMER}; |
|
28 |
|
% |
|
29 |
|
% |
|
30 |
|
% |
|
31 |
|
%\node[relationship] (SPEAKS) [below right of=CUSTOMER] {SPEAKS} edge node[right, pos=0.4] {$M$} (CUSTOMER); |
|
32 |
|
%\node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); |
|
33 |
|
%\node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); |
|
34 |
|
%\node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); |
|
35 |
|
% |
|
36 |
|
%\node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; |
|
37 |
|
%\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); |
|
38 |
|
%\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); |
|
39 |
|
% |
|
40 |
|
% |
|
41 |
|
%\node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); |
|
42 |
|
|
|
43 |
|
% |
|
44 |
|
%\node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; |
|
45 |
|
%\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); |
|
46 |
|
%\draw (anthem) to node[right, pos=0.6] {$M$} (WIN); |
|
47 |
|
|
|
48 |
|
\end{tikzpicture} |
|
49 |
|
|
|
50 |
|
\end{document} |
File notes/fig/er/Gym.tex added (mode: 100644) (index 0000000..86d3fbb) |
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
\begin{tikzpicture}[node distance=5em] |
|
5 |
|
\node [entity] (MEMBER) {MEMBER}; |
|
6 |
|
\node [relationship] (RESERVES) [right=of MEMBER] {RESERVES} edge node[above]{$(0,1)$} (MEMBER); |
|
7 |
|
\node [entity] [right = of RESERVES] {EQUIPMENT} edge node[above]{$(0,1)$} (RESERVES); |
|
8 |
|
\node [entity] [below = of RESERVES] {TIME\_SLOT} edge node[left]{$(0, \cN)$} (RESERVES); |
|
9 |
|
\end{tikzpicture} |
|
10 |
|
\end{document} |
File notes/lectures_notes.md changed (mode: 100644) (index 1dce784..407b5b0) |
... |
... |
Apply the ER-to-Relation mapping to your ER diagram from [%D %n (%T)](#problem:c |
4990 |
4990 |
|
|
4991 |
4991 |
--- |
--- |
4992 |
4992 |
|
|
|
4993 |
|
|
|
4994 |
|
Problem (From E.R. diagram to Relational model -- BIKE) +.#ERtoRELBike |
|
4995 |
|
~ |
|
4996 |
|
|
|
4997 |
|
Consider the following E.R. diagram: |
|
4998 |
|
|
|
4999 |
|
 |
|
5000 |
|
\ |
|
5001 |
|
|
|
5002 |
|
_Based on this diagram_, answer the following: "Is it true that …" |
|
5003 |
|
|
|
5004 |
|
|
|
5005 |
|
<!-- bug with table --> |
|
5006 |
|
| Yes | No | |
|
5007 |
|
------------ | --- | --- | |
|
5008 |
|
"… a customer cannot drop two bikes at the exact same time and date? | | | |
|
5009 |
|
"… two different customers cannot drop two different bikes at the exact same time and date? | | | |
|
5010 |
|
"… an employee cannot repair two bikes at the same time? | | | |
|
5011 |
|
"… a customer can be assigned to more than one employee? | | | |
|
5012 |
|
"… a customer can have a bike repaired by an employee that is not assigned to them? | | | |
|
5013 |
|
"… a bike can be in the database without having been dropped by a customer? | | | |
|
5014 |
|
"… an employee can be asked to repair a bike without having that type of bike as one of their specialty? | | | |
|
5015 |
|
|
|
5016 |
|
Then, convert that E.R. diagram to the relational model. Try to make as few assumptions as possible. |
|
5017 |
|
|
|
5018 |
|
--- |
|
5019 |
|
|
|
5020 |
|
|
4993 |
5021 |
Problem (ER-to-Relation mapping for Country) +.#ERtoRELCountry |
Problem (ER-to-Relation mapping for Country) +.#ERtoRELCountry |
4994 |
5022 |
~ |
~ |
4995 |
5023 |
|
|
|
... |
... |
Problem (From business statements to E.R. diagram -- UNIVERSITY) +.#BusinessToEr |
5028 |
5056 |
|
|
5029 |
5057 |
--- |
--- |
5030 |
5058 |
|
|
|
5059 |
|
|
5031 |
5060 |
Problem (Normal form of a CAR\_SALE relation) +.#carsale |
Problem (Normal form of a CAR\_SALE relation) +.#carsale |
5032 |
5061 |
~ |
~ |
5033 |
5062 |
|
|