File notes/fig/er/Bad_Design.tex changed (mode: 100644) (index d477a12..93f742d) |
1 |
1 |
\documentclass[border=20pt]{standalone} |
\documentclass[border=20pt]{standalone} |
2 |
2 |
\input{template.def} |
\input{template.def} |
3 |
3 |
|
|
4 |
|
\begin{tikzpicture}[node distance=2em] |
|
|
4 |
|
\begin{tikzpicture}[node distance=2em] |
5 |
5 |
\node[entity] (people) {PEOPLE}; |
\node[entity] (people) {PEOPLE}; |
6 |
6 |
\node[relationship] (has) [right=of people] {HAS} edge (people); |
\node[relationship] (has) [right=of people] {HAS} edge (people); |
7 |
7 |
\node[entity] (job) [right = of has] {JOB} edge (has); |
\node[entity] (job) [right = of has] {JOB} edge (has); |
8 |
8 |
\node[relationship] (in) [above=of job] {IN} edge (job); |
\node[relationship] (in) [above=of job] {IN} edge (job); |
9 |
9 |
\node[entity] (employer) [above=of in] {EMPLOYER} edge (in); |
\node[entity] (employer) [above=of in] {EMPLOYER} edge (in); |
10 |
|
|
|
|
10 |
|
|
11 |
11 |
\draw [->, >=latex] (has)+(0, -1) -- ++(0, -2); |
\draw [->, >=latex] (has)+(0, -1) -- ++(0, -2); |
12 |
|
|
|
|
12 |
|
|
13 |
13 |
\node[entity] (person) [below right = 6.5 and -2.5 of people] {PERSON}; |
\node[entity] (person) [below right = 6.5 and -2.5 of people] {PERSON}; |
14 |
14 |
\node[relationship] (occupies) [right=of person] {OCCUPIES} edge (person); |
\node[relationship] (occupies) [right=of person] {OCCUPIES} edge (person); |
15 |
15 |
\node[entity] (position) [right = of occupies] {POSITION} edge (occupies); |
\node[entity] (position) [right = of occupies] {POSITION} edge (occupies); |
16 |
16 |
\node[relationship] (offers) [above=of position] {OFFERS} edge (position); |
\node[relationship] (offers) [above=of position] {OFFERS} edge (position); |
17 |
17 |
\node[entity] (company) [above=of offers] {COMPANY} edge (offers); |
\node[entity] (company) [above=of offers] {COMPANY} edge (offers); |
18 |
|
\end{tikzpicture} |
|
19 |
|
|
|
|
18 |
|
\end{tikzpicture} |
|
19 |
|
|
20 |
20 |
\end{document} |
\end{document} |
File notes/fig/er/Car_Info.tex changed (mode: 100644) (index 7daac71..84ac4fb) |
16 |
16 |
\node[attribute] (make) [left of=car] {Make} edge (car); |
\node[attribute] (make) [left of=car] {Make} edge (car); |
17 |
17 |
\node[attribute] (year) [below left of =car] {Year} edge (car); |
\node[attribute] (year) [below left of =car] {Year} edge (car); |
18 |
18 |
\node[attribute] (brand) [below of =car] {Brand} edge (car); |
\node[attribute] (brand) [below of =car] {Brand} edge (car); |
19 |
|
|
|
|
19 |
|
|
20 |
20 |
\node[relationship] (seats) [below left of=person] {SEATS\_IN} edge node[above, pos=0.1] {$N$} (person); |
\node[relationship] (seats) [below left of=person] {SEATS\_IN} edge node[above, pos=0.1] {$N$} (person); |
21 |
21 |
\draw (seats) edge node[above, pos=0.3] {$1$} (car); |
\draw (seats) edge node[above, pos=0.3] {$1$} (car); |
22 |
22 |
\node[attribute] (position) [left of=seats] {Position} edge (seats); |
\node[attribute] (position) [left of=seats] {Position} edge (seats); |
|
27 |
27 |
\node[attribute] (policy) [above right of =insurance] {Policy Number} edge (insurance); |
\node[attribute] (policy) [above right of =insurance] {Policy Number} edge (insurance); |
28 |
28 |
\node[attribute] (company) [below right of =insurance] {Company Name} edge (insurance); |
\node[attribute] (company) [below right of =insurance] {Company Name} edge (insurance); |
29 |
29 |
\end{tikzpicture} |
\end{tikzpicture} |
30 |
|
|
|
|
30 |
|
|
31 |
31 |
\end{document} |
\end{document} |
File notes/fig/er/Country.tex changed (mode: 100644) (index ca4e3e6..8e99496) |
5 |
5 |
\node[entity] (COUNTRY) {COUNTRY}; |
\node[entity] (COUNTRY) {COUNTRY}; |
6 |
6 |
\node[attribute] (name) [left of=COUNTRY] {\key{Name}} edge (COUNTRY); |
\node[attribute] (name) [left of=COUNTRY] {\key{Name}} edge (COUNTRY); |
7 |
7 |
\node[attribute] (population) [below left of=COUNTRY] {Population} edge (COUNTRY); |
\node[attribute] (population) [below left of=COUNTRY] {Population} edge (COUNTRY); |
8 |
|
|
|
|
8 |
|
|
9 |
9 |
\node[relationship] (SPEAKS) [below right of=COUNTRY] {SPEAKS} edge node[right, pos=0.4] {$M$} (COUNTRY); |
\node[relationship] (SPEAKS) [below right of=COUNTRY] {SPEAKS} edge node[right, pos=0.4] {$M$} (COUNTRY); |
10 |
10 |
\node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); |
\node[entity] (LANGUAGE) [below right of=SPEAKS] {LANGUAGE} edge node[right, pos=0.5] {$N$} (SPEAKS); |
11 |
11 |
\node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); |
\node[attribute] (code) [left of = LANGUAGE] {\key{Code}} edge (LANGUAGE); |
12 |
12 |
\node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); |
\node[attribute] (symbol) [right of = LANGUAGE] {Name} edge (LANGUAGE); |
13 |
|
|
|
|
13 |
|
|
14 |
14 |
\node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; |
\node[relationship] (BWF) [below of = LANGUAGE] {B\_W\_F}; |
15 |
15 |
\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); |
\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (BWF.west); |
16 |
16 |
\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); |
\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (BWF.east); |
17 |
|
|
|
|
17 |
|
|
18 |
18 |
%\node[relationship] (boundary) [above of = COUNTRY] {S\_B\_W}; |
%\node[relationship] (boundary) [above of = COUNTRY] {S\_B\_W}; |
19 |
19 |
%\draw (COUNTRY) to node[left, pos=0.6] {$N$} (boundary.west); |
%\draw (COUNTRY) to node[left, pos=0.6] {$N$} (boundary.west); |
20 |
20 |
%\draw (COUNTRY) to node[right, pos=0.6] {$M$} (boundary.east); |
%\draw (COUNTRY) to node[right, pos=0.6] {$M$} (boundary.east); |
21 |
|
|
|
|
21 |
|
|
22 |
22 |
%\node[relationship] (conversion) [below of =LANGUAGE] {CONVERSION}; |
%\node[relationship] (conversion) [below of =LANGUAGE] {CONVERSION}; |
23 |
23 |
%\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (conversion.west); |
%\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (conversion.west); |
24 |
24 |
%\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (conversion.east); |
%\draw (LANGUAGE) to node[right, pos=0.6] {$M$} (conversion.east); |
25 |
|
|
|
|
25 |
|
|
26 |
26 |
%\node[attribute] (timestamp) [below left of=conversion] {\key{Timestamp}} edge (conversion); |
%\node[attribute] (timestamp) [below left of=conversion] {\key{Timestamp}} edge (conversion); |
27 |
27 |
%\node[attribute] (rate) [below right of=conversion] {Exchange\_rate} edge (conversion); |
%\node[attribute] (rate) [below right of=conversion] {Exchange\_rate} edge (conversion); |
28 |
|
|
|
|
28 |
|
|
29 |
29 |
\node[ident relationship] (hasfor) [right of=COUNTRY] {SINGS} edge node[above, pos=0.4] {$1$} (COUNTRY); |
\node[ident relationship] (hasfor) [right of=COUNTRY] {SINGS} edge node[above, pos=0.4] {$1$} (COUNTRY); |
30 |
30 |
\node[weak entity] (anthem) %[right of=hasfor] |
\node[weak entity] (anthem) %[right of=hasfor] |
31 |
31 |
[right = 1cm of hasfor] {NATIONAL\_ANTHEM} edge[total] node[above, pos=0.6]{$M$} (hasfor); |
[right = 1cm of hasfor] {NATIONAL\_ANTHEM} edge[total] node[above, pos=0.6]{$M$} (hasfor); |
32 |
32 |
\node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); |
\node[multi attribute] (color) [right =1cm of anthem] {Creator} edge (anthem); |
33 |
33 |
\node[attribute] (name) [below right of = anthem] {\pkey{Name}} edge (anthem); |
\node[attribute] (name) [below right of = anthem] {\pkey{Name}} edge (anthem); |
34 |
|
|
|
|
34 |
|
|
35 |
35 |
\node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; |
\node[relationship] (WIN) [above right of =LANGUAGE] {W\_IN}; |
36 |
36 |
\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); |
\draw (LANGUAGE) to node[left, pos=0.6] {$N$} (WIN); |
37 |
37 |
\draw (anthem) to node[right, pos=0.6] {$M$} (WIN); |
\draw (anthem) to node[right, pos=0.6] {$M$} (WIN); |
38 |
38 |
\end{tikzpicture} |
\end{tikzpicture} |
39 |
|
|
|
|
39 |
|
|
40 |
40 |
\end{document} |
\end{document} |
File notes/fig/er/Rel_Instance.tex changed (mode: 100644) (index 49d047a..1fd7c9e) |
1 |
1 |
\documentclass[border=20pt]{standalone} |
\documentclass[border=20pt]{standalone} |
2 |
2 |
\input{template.def} |
\input{template.def} |
3 |
3 |
|
|
4 |
|
\begin{tikzpicture}[node distance=2em] |
|
5 |
|
\draw [fill= gray!20] (0,-1) ellipse (1cm and 2cm) node[above=2]{Entity Set 1}; |
|
6 |
|
\draw [fill= blue!20] (2.75, -1) ellipse (1cm and 2cm) node[above=2]{Relationship Set 1}; |
|
7 |
|
\draw [fill= green!20] (5.5, -1) ellipse (1cm and 2cm) node[above=2]{Entity Set 2}; |
|
8 |
|
% |
|
|
4 |
|
\begin{tikzpicture}[node distance=2em] |
|
5 |
|
\draw [fill= gray!20] (0,-1) ellipse (1cm and 2cm) node[above=2]{Entity Set 1}; |
|
6 |
|
\draw [fill= blue!20] (2.75, -1) ellipse (1cm and 2cm) node[above=2]{Relationship Set 1}; |
|
7 |
|
\draw [fill= green!20] (5.5, -1) ellipse (1cm and 2cm) node[above=2]{Entity Set 2}; |
|
8 |
|
% |
9 |
9 |
\node (e1) {\(e_1\)}; |
\node (e1) {\(e_1\)}; |
10 |
10 |
\node (e2) [below of = e1] {\(e_2\)}; |
\node (e2) [below of = e1] {\(e_2\)}; |
11 |
11 |
\node (dots) [below of = e2] {\(\vdots\)}; |
\node (dots) [below of = e2] {\(\vdots\)}; |
12 |
12 |
\node (en) [below of = dots] {\(e_n\)}; |
\node (en) [below of = dots] {\(e_n\)}; |
13 |
|
% |
|
|
13 |
|
% |
14 |
14 |
\node (c1) [right = 5 of e1]{\(c_1\)}; |
\node (c1) [right = 5 of e1]{\(c_1\)}; |
15 |
15 |
\node (c2) [below of = c1]{\(c_1\)}; |
\node (c2) [below of = c1]{\(c_1\)}; |
16 |
16 |
\node (cdots) [below of = c2] {\(\vdots\)}; |
\node (cdots) [below of = c2] {\(\vdots\)}; |
17 |
17 |
\node (cp) [below of = cdots] {\(c_p\)}; |
\node (cp) [below of = cdots] {\(c_p\)}; |
18 |
|
% |
|
|
18 |
|
% |
19 |
19 |
\node (r1) [right = 2.25 of e2] {\(r_1\)}; |
\node (r1) [right = 2.25 of e2] {\(r_1\)}; |
20 |
20 |
\draw (r1) to (e1); |
\draw (r1) to (e1); |
21 |
21 |
\draw (r1) to (c2); |
\draw (r1) to (c2); |
22 |
|
% |
|
|
22 |
|
% |
23 |
23 |
\node (r2) [below of = r1] {\(r_2\)}; |
\node (r2) [below of = r1] {\(r_2\)}; |
24 |
24 |
\draw (r2) to (e2); |
\draw (r2) to (e2); |
25 |
25 |
\draw (r2) to (cp); |
\draw (r2) to (cp); |
26 |
|
\end{tikzpicture} |
|
27 |
|
|
|
|
26 |
|
\end{tikzpicture} |
|
27 |
|
|
28 |
28 |
\end{document} |
\end{document} |
File notes/fig/fd/model2.tex deleted (index 3273232..0000000) |
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\renewcommand\familydefault{\sfdefault} |
|
3 |
|
\usepackage{tikz-dependency} |
|
4 |
|
\begin{document} |
|
5 |
|
|
|
6 |
|
\depstyle{lvl}{% |
|
7 |
|
edge height=2.5ex, |
|
8 |
|
% edge unit distance=#1*2.5ex, % Another way of controlling the appearance of the edges. |
|
9 |
|
edge below, |
|
10 |
|
edge horizontal padding=0, |
|
11 |
|
edge start y offset=-(#1-1)*3ex, |
|
12 |
|
text only label, % No need for label for functional dependencies. |
|
13 |
|
edge slant=0, % Right angles |
|
14 |
|
rounded corners=0, |
|
15 |
|
edge style={thick} % Change the style of the arrowheads. |
|
16 |
|
} |
|
17 |
|
% |
|
18 |
|
%\tikzset{ |
|
19 |
|
%% /depgraph/.cd, |
|
20 |
|
%% /depgraph/.search also = {/tikz}, |
|
21 |
|
%% dep id/.code = {\def\dt@depid{#1}}, |
|
22 |
|
%% dep id = dependency, |
|
23 |
|
% edge vertical begin padding/.code = {\pgfmathsetlengthmacro{\dt@linkdist}{#1}}, |
|
24 |
|
%} |
|
25 |
|
%% p. 925 |
|
26 |
|
%%\pgfmathsetlengthmacro{hmacroi}{hexpressioni} |
|
27 |
|
%%Defines hmacroi as the value of hexpressioni L A TEX in points. |
|
28 |
|
|
|
29 |
|
|
|
30 |
|
\tikzset{ |
|
31 |
|
matrix/.append style={column sep=0.4cm} % Adding some distance between the attributes. |
|
32 |
|
} |
|
33 |
|
\tikzstyle{TxtBook}=[% Style to mimic the textbook Fundamentals of Database Systems. |
|
34 |
|
column sep=0cm, % No distance between two attributes. |
|
35 |
|
nodes={% |
|
36 |
|
fill=gray!20, |
|
37 |
|
draw=black, |
|
38 |
|
inner xsep=3ex, |
|
39 |
|
inner ysep=1ex |
|
40 |
|
} |
|
41 |
|
] |
|
42 |
|
|
|
43 |
|
|
|
44 |
|
\begin{dependency} |
|
45 |
|
\begin{deptext} |
|
46 |
|
Ename \& \underline{Ssn} \& BDate \& Address \& Dnumber \& Dname \& Dmgr\_ssn \\ |
|
47 |
|
\end{deptext} |
|
48 |
|
\depedge[lvl=1]{2}{1}{} % Edge are organized by level. |
|
49 |
|
\depedge[lvl=1]{2}{3}{} |
|
50 |
|
\depedge[lvl=1]{2}{4}{} |
|
51 |
|
\depedge[lvl=1]{2}{5}{} |
|
52 |
|
\depedge[lvl=2]{5}{6}{} |
|
53 |
|
\depedge[lvl=2]{5}{7}{} |
|
54 |
|
\end{dependency} |
|
55 |
|
|
|
56 |
|
|
|
57 |
|
\begin{dependency} |
|
58 |
|
\begin{deptext}[TxtBook] % Applying the TxtBook style. |
|
59 |
|
\underline{Ssn} \& \underline{Pnumber} \& Hours \& Ename \& Pname \& Plocation \\ |
|
60 |
|
\end{deptext} |
|
61 |
|
\depedge[lvl=1]{1}{3}{} |
|
62 |
|
\depedge[lvl=1]{2}{3}{} |
|
63 |
|
\depedge[lvl=2]{1}{4}{} |
|
64 |
|
\depedge[lvl=3]{2}{5}{} |
|
65 |
|
\depedge[lvl=3]{2}{6}{} |
|
66 |
|
\end{dependency} |
|
67 |
|
|
|
68 |
|
\end{document} |
|
File notes/fig/rel_mod/ACTOR.tex changed (mode: 100644) (index eda6c9d..1d996c9) |
11 |
11 |
\Frame(0,0){1}[ACTOR]{ |
\Frame(0,0){1}[ACTOR]{ |
12 |
12 |
Id/PK, |
Id/PK, |
13 |
13 |
Name/A, |
Name/A, |
14 |
|
Birthdate/A}; |
|
|
14 |
|
Birthdate/A}; |
15 |
15 |
|
|
16 |
16 |
\Frame(0,-2.5){2}[MOVIE]{ |
\Frame(0,-2.5){2}[MOVIE]{ |
17 |
17 |
Title/PK, |
Title/PK, |
|
28 |
28 |
|
|
29 |
29 |
\Frame(8,0){4}[ACTING]{ |
\Frame(8,0){4}[ACTING]{ |
30 |
30 |
ActorId/PK, |
ActorId/PK, |
31 |
|
MovieTitle/PK}; |
|
|
31 |
|
MovieTitle/PK}; |
32 |
32 |
|
|
33 |
33 |
\Frame(8,-2.5){5}[SHOWING]{ |
\Frame(8,-2.5){5}[SHOWING]{ |
34 |
34 |
MovieTitle/PK, |
MovieTitle/PK, |
35 |
35 |
TheaterName/PK, |
TheaterName/PK, |
36 |
36 |
Day/PK, |
Day/PK, |
37 |
|
Time/PK}; |
|
|
37 |
|
Time/PK}; |
38 |
38 |
|
|
39 |
39 |
\draw[FK] % From ACTING.ActorID to ACTOR.Id |
\draw[FK] % From ACTING.ActorID to ACTOR.Id |
40 |
40 |
(Id1) -- ++(0,-.55) coordinate (inter) |
(Id1) -- ++(0,-.55) coordinate (inter) |
41 |
41 |
-- (ActorId4 |- inter) --++(0, 0.5); |
-- (ActorId4 |- inter) --++(0, 0.5); |
42 |
42 |
|
|
43 |
43 |
\draw[FK] % From ACTING.MovieTitle to MOVIE.Title |
\draw[FK] % From ACTING.MovieTitle to MOVIE.Title |
44 |
|
(Title2)++(0.1,0) -- ++(0,-.55) -- ++(4,0) |
|
|
44 |
|
(Title2)++(0.1,0) -- ++(0,-.55) -- ++(4,0) |
|
45 |
|
-- ++(0,2) |
45 |
46 |
coordinate (inter) |
coordinate (inter) |
46 |
47 |
-- (MovieTitle4 |- inter) --++(0, 1); |
-- (MovieTitle4 |- inter) --++(0, 1); |
47 |
48 |
|
|
File notes/fig/rel_mod/ADDRESS.tex changed (mode: 100644) (index 52ea763..a92eaca) |
4 |
4 |
% NAME(FName, LName, Id(PK)) |
% NAME(FName, LName, Id(PK)) |
5 |
5 |
% ADDRESS(StreetName (PK), Number (PK), Habitants (FK referencing NAME.Id)) |
% ADDRESS(StreetName (PK), Number (PK), Habitants (FK referencing NAME.Id)) |
6 |
6 |
|
|
7 |
|
\Frame(0,0){1}[NAME]{ |
|
|
7 |
|
\Frame(0,0){1}[NAME]{ |
8 |
8 |
FName/A, |
FName/A, |
9 |
9 |
LName/A, |
LName/A, |
10 |
|
Id/PK}; |
|
|
10 |
|
Id/PK}; |
11 |
11 |
|
|
12 |
12 |
\Frame(5, 0){2}[ADDRESS]{ |
\Frame(5, 0){2}[ADDRESS]{ |
13 |
13 |
StreetName/PK, |
StreetName/PK, |
|
15 |
15 |
Habitants/A}; |
Habitants/A}; |
16 |
16 |
|
|
17 |
17 |
\draw[FK] % From Habitants2 to Id1 |
\draw[FK] % From Habitants2 to Id1 |
18 |
|
(Id1)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter) |
|
19 |
|
-- (Habitants2 |- inter) --++(0,0.6); |
|
|
18 |
|
(Id1)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter) |
|
19 |
|
-- (Habitants2 |- inter) --++(0,0.6); |
20 |
20 |
\end{tikzpicture} |
\end{tikzpicture} |
21 |
21 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/BOOK_Sol.tex changed (mode: 100644) (index 47d8504..401f1ee) |
5 |
5 |
% BOOK(ISSN (PK), AuthorRef (FK to AUTHOR.REF), Title) |
% BOOK(ISSN (PK), AuthorRef (FK to AUTHOR.REF), Title) |
6 |
6 |
% GAINED-AWARD(Ref (PK), Name, BookISSN (FK to BOOK.ISSN), Year) |
% GAINED-AWARD(Ref (PK), Name, BookISSN (FK to BOOK.ISSN), Year) |
7 |
7 |
|
|
8 |
|
\Frame(0,0){1}[AUTHOR]{ |
|
9 |
|
Ref/PK, |
|
10 |
|
Name/A, |
|
11 |
|
Address/A}; |
|
|
8 |
|
\Frame(0,0){1}[AUTHOR]{ |
|
9 |
|
Ref/PK, |
|
10 |
|
Name/A, |
|
11 |
|
Address/A}; |
12 |
12 |
|
|
13 |
|
\Frame(0,-2.5){2}[BOOK]{ |
|
14 |
|
ISSN/PK, |
|
15 |
|
AuthorRef/A, |
|
16 |
|
Title/A}; |
|
|
13 |
|
\Frame(0,-2.5){2}[BOOK]{ |
|
14 |
|
ISSN/PK, |
|
15 |
|
AuthorRef/A, |
|
16 |
|
Title/A}; |
17 |
17 |
|
|
18 |
18 |
\Frame(0,-5){3}[GAINED-AWARD]{ |
\Frame(0,-5){3}[GAINED-AWARD]{ |
19 |
19 |
Ref/PK, |
Ref/PK, |
|
22 |
22 |
Year/A}; |
Year/A}; |
23 |
23 |
|
|
24 |
24 |
\draw[FK] % From AuthorRef2 to Ref1 |
\draw[FK] % From AuthorRef2 to Ref1 |
25 |
|
(Ref1)++(0.1,0) -- ++(0,-.55) -- ++(4.5,0) coordinate (inter) |
|
26 |
|
-- (AuthorRef2 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
27 |
|
-- (AuthorRef2 |- inter) --++(0,0.5); |
|
|
25 |
|
(Ref1)++(0.1,0) -- ++(0,-.55) -- ++(4.5,0) coordinate (inter) |
|
26 |
|
-- (AuthorRef2 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
27 |
|
-- (AuthorRef2 |- inter) --++(0,0.5); |
28 |
28 |
|
|
29 |
29 |
\draw[FK] % From BookISSN3 to ISSN2 |
\draw[FK] % From BookISSN3 to ISSN2 |
30 |
|
(ISSN2)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter) |
|
31 |
|
-- (BookISSN3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
32 |
|
-- (BookISSN3 |- inter) --++(0,0.5); |
|
|
30 |
|
(ISSN2)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter) |
|
31 |
|
-- (BookISSN3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
32 |
|
-- (BookISSN3 |- inter) --++(0,0.5); |
33 |
33 |
|
|
34 |
34 |
\end{tikzpicture} |
\end{tikzpicture} |
35 |
35 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/CAR1.tex changed (mode: 100644) (index 43367a7..acf80b4) |
7 |
7 |
% Insured-Driver-Num (FK to DRIVER.Licence-number), Rate) |
% Insured-Driver-Num (FK to DRIVER.Licence-number), Rate) |
8 |
8 |
% PRICE(Stock-number (PK), Car-Vin (FK to CAR.VIN), Price, Margin) |
% PRICE(Stock-number (PK), Car-Vin (FK to CAR.VIN), Price, Margin) |
9 |
9 |
|
|
10 |
|
\Frame(0,0){1}[CAR]{ |
|
11 |
|
VIN/PK, |
|
12 |
|
Make/A, |
|
13 |
|
Model/A, |
|
14 |
|
Year/A}; |
|
15 |
|
|
|
16 |
|
\Frame(0,-2.5){2}[DRIVER]{ |
|
17 |
|
State/PK, |
|
18 |
|
Licence-Num/PK, |
|
19 |
|
Name/A, |
|
20 |
|
Address/A}; |
|
|
10 |
|
\Frame(0,0){1}[CAR]{ |
|
11 |
|
VIN/PK, |
|
12 |
|
Make/A, |
|
13 |
|
Model/A, |
|
14 |
|
Year/A}; |
|
15 |
|
|
|
16 |
|
\Frame(0,-2.5){2}[DRIVER]{ |
|
17 |
|
State/PK, |
|
18 |
|
Licence-Num/PK, |
|
19 |
|
Name/A, |
|
20 |
|
Address/A}; |
21 |
21 |
|
|
22 |
22 |
\Frame(0,-5){3}[INSURANCE]{ |
\Frame(0,-5){3}[INSURANCE]{ |
23 |
23 |
Policy-Num/PK, |
Policy-Num/PK, |
|
30 |
30 |
Car-VIN/A, |
Car-VIN/A, |
31 |
31 |
Price/A, |
Price/A, |
32 |
32 |
Margin/A, |
Margin/A, |
33 |
|
Stock-Num/PK}; |
|
|
33 |
|
Stock-Num/PK}; |
34 |
34 |
|
|
35 |
35 |
|
|
36 |
36 |
\draw[FK] % From Insured-Car3 to VIN1 |
\draw[FK] % From Insured-Car3 to VIN1 |
37 |
|
(VIN1)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter) |
|
38 |
|
-- (Insured-Car3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
39 |
|
-- (Insured-Car3 |- inter) --++(0,0.4); |
|
|
37 |
|
(VIN1)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter) |
|
38 |
|
-- (Insured-Car3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
39 |
|
-- (Insured-Car3 |- inter) --++(0,0.4); |
40 |
40 |
|
|
41 |
41 |
\draw[FK] % From Car-VIN4 to VIN1 |
\draw[FK] % From Car-VIN4 to VIN1 |
42 |
|
(VIN1)++(-0.1,0) -- ++(0,-.45) -- ++(-1.1,0) coordinate (inter) |
|
43 |
|
-- (Car-VIN4 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
44 |
|
-- (Car-VIN4 |- inter) --++(0,0.5); |
|
|
42 |
|
(VIN1)++(-0.1,0) -- ++(0,-.45) -- ++(-1.1,0) coordinate (inter) |
|
43 |
|
-- (Car-VIN4 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
44 |
|
-- (Car-VIN4 |- inter) --++(0,0.5); |
45 |
45 |
|
|
46 |
46 |
\draw[FK] % From Insured-Driver-State3 to State2 |
\draw[FK] % From Insured-Driver-State3 to State2 |
47 |
|
(State2) -- ++(0,-.7) coordinate (inter) -- (Insured-Driver-State3 |- inter) --++(0,-1.1); |
|
|
47 |
|
(State2) -- ++(0,-.7) coordinate (inter) -- (Insured-Driver-State3 |- inter) --++(0,-1.1); |
48 |
48 |
|
|
49 |
49 |
\draw[FK] % From Insured-Driver-Licence-Num3 to Licence-Num2 |
\draw[FK] % From Insured-Driver-Licence-Num3 to Licence-Num2 |
50 |
|
(Licence-Num2) -- ++(0,-.5) coordinate (inter) -- (Insured-Driver-Licence-Num3 |- inter) --++(0,-1.3); |
|
|
50 |
|
(Licence-Num2) -- ++(0,-.5) coordinate (inter) -- (Insured-Driver-Licence-Num3 |- inter) --++(0,-1.3); |
51 |
51 |
|
|
52 |
52 |
\end{tikzpicture} |
\end{tikzpicture} |
53 |
53 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/CINEMA.tex changed (mode: 100644) (index bda2741..2d79ea6) |
9 |
9 |
%SHOWTIME(Id (PK), MovieId (FK to MOVIE.Id), AuditoriumId (FK to AUDITORIUM.Id), StartTime) |
%SHOWTIME(Id (PK), MovieId (FK to MOVIE.Id), AuditoriumId (FK to AUDITORIUM.Id), StartTime) |
10 |
10 |
%TICKETS(Id (PK), ShowTimeId (FK to SHOWTIME.Id), Price) |
%TICKETS(Id (PK), ShowTimeId (FK to SHOWTIME.Id), Price) |
11 |
11 |
|
|
12 |
|
\Frame(0,0){1}[STAR]{ |
|
13 |
|
Id/PK, |
|
14 |
|
Name/A, |
|
15 |
|
BirthDate/A}; |
|
16 |
|
|
|
17 |
|
\Frame(0,-2.5){2}[MOVIE]{ |
|
18 |
|
Id/PK, |
|
19 |
|
Title/A, |
|
20 |
|
Year/A, |
|
21 |
|
Length/A, |
|
22 |
|
Genre/A}; |
|
|
12 |
|
\Frame(0,0){1}[STAR]{ |
|
13 |
|
Id/PK, |
|
14 |
|
Name/A, |
|
15 |
|
BirthDate/A}; |
|
16 |
|
|
|
17 |
|
\Frame(0,-2.5){2}[MOVIE]{ |
|
18 |
|
Id/PK, |
|
19 |
|
Title/A, |
|
20 |
|
Year/A, |
|
21 |
|
Length/A, |
|
22 |
|
Genre/A}; |
23 |
23 |
|
|
24 |
24 |
\Frame(0,-5){3}[FEATURE-IN]{ |
\Frame(0,-5){3}[FEATURE-IN]{ |
25 |
25 |
StarId/PK, |
StarId/PK, |
|
28 |
28 |
\Frame(8,0){4}[THEATER]{ |
\Frame(8,0){4}[THEATER]{ |
29 |
29 |
Id/PK, |
Id/PK, |
30 |
30 |
Name/A, |
Name/A, |
31 |
|
Address/A}; |
|
|
31 |
|
Address/A}; |
32 |
32 |
|
|
33 |
33 |
\Frame(8,-2.5){5}[AUDITORIUM]{ |
\Frame(8,-2.5){5}[AUDITORIUM]{ |
34 |
34 |
Id/PK, |
Id/PK, |
35 |
35 |
Capacity/A, |
Capacity/A, |
36 |
|
Theater/A}; |
|
|
36 |
|
Theater/A}; |
37 |
37 |
|
|
38 |
38 |
\Frame(8,-5){6}[SHOWTIME]{ |
\Frame(8,-5){6}[SHOWTIME]{ |
39 |
39 |
Id/PK, |
Id/PK, |
40 |
40 |
MovieId/A, |
MovieId/A, |
41 |
41 |
AuditoriumId/A, |
AuditoriumId/A, |
42 |
|
StartTime/A}; |
|
|
42 |
|
StartTime/A}; |
43 |
43 |
|
|
44 |
44 |
|
|
45 |
45 |
\Frame(8,-7.5){7}[TICKET]{ |
\Frame(8,-7.5){7}[TICKET]{ |
46 |
46 |
Id/PK, |
Id/PK, |
47 |
47 |
ShowTimeId/A, |
ShowTimeId/A, |
48 |
|
Price/A}; |
|
|
48 |
|
Price/A}; |
49 |
49 |
|
|
50 |
50 |
\draw[FK] % From StarId3 to Id1 |
\draw[FK] % From StarId3 to Id1 |
51 |
|
(Id1)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter) |
|
52 |
|
-- (StarId3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
53 |
|
-- (StarId3 |- inter) --++(0, 0.4); |
|
54 |
|
|
|
|
51 |
|
(Id1)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter) |
|
52 |
|
-- (StarId3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
53 |
|
-- (StarId3 |- inter) --++(0, 0.4); |
|
54 |
|
|
55 |
55 |
\draw[FK] % From MovieId3 to Id2 |
\draw[FK] % From MovieId3 to Id2 |
56 |
|
(Id2)++(-0.1,0) -- ++(0,-.75) -- ++(3,0) coordinate (inter) |
|
57 |
|
-- (MovieId3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
58 |
|
-- (MovieId3 |- inter) --++(0,0.4); |
|
|
56 |
|
(Id2)++(-0.1,0) -- ++(0,-.75) -- ++(3,0) coordinate (inter) |
|
57 |
|
-- (MovieId3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
58 |
|
-- (MovieId3 |- inter) --++(0,0.4); |
59 |
59 |
|
|
60 |
60 |
\draw[FK] % From Theater5 to Id4 |
\draw[FK] % From Theater5 to Id4 |
61 |
|
(Id4)++(0.1,0) -- ++(0,-.55) -- ++(3.5,0) coordinate (inter) |
|
62 |
|
-- (Theater5 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
63 |
|
-- (Theater5 |- inter) --++(0,0.3); |
|
|
61 |
|
(Id4)++(0.1,0) -- ++(0,-.55) -- ++(3.5,0) coordinate (inter) |
|
62 |
|
-- (Theater5 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
63 |
|
-- (Theater5 |- inter) --++(0,0.3); |
64 |
64 |
|
|
65 |
65 |
\draw[FK] % From MovieId6 to Id2 |
\draw[FK] % From MovieId6 to Id2 |
66 |
|
(Id2)++(0.1,0) -- ++(0,-.55) -- ++(3.2,0) coordinate (inter) |
|
67 |
|
-- (MovieId6 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
68 |
|
-- (MovieId6 |- inter) --++(0,0.5); |
|
|
66 |
|
(Id2)++(0.1,0) -- ++(0,-.55) -- ++(3.2,0) coordinate (inter) |
|
67 |
|
-- (MovieId6 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
68 |
|
-- (MovieId6 |- inter) --++(0,0.5); |
69 |
69 |
|
|
70 |
70 |
\draw[FK] % From AuditoriumId6 to Id5 |
\draw[FK] % From AuditoriumId6 to Id5 |
71 |
|
(Id5)++(0.1,0) -- ++(0,-.55) -- ++(6,0) coordinate (inter) |
|
72 |
|
-- (AuditoriumId6 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
73 |
|
-- (AuditoriumId6 |- inter) --++(0,0.3); |
|
|
71 |
|
(Id5)++(0.1,0) -- ++(0,-.55) -- ++(6,0) coordinate (inter) |
|
72 |
|
-- (AuditoriumId6 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
73 |
|
-- (AuditoriumId6 |- inter) --++(0,0.3); |
74 |
74 |
|
|
75 |
75 |
|
|
76 |
76 |
\draw[FK] % From ShowTimeId7 to Id6 |
\draw[FK] % From ShowTimeId7 to Id6 |
77 |
|
(Id6)++(0.1,0) -- ++(0,-.8) -- ++(-.7,0) coordinate (inter) |
|
78 |
|
-- (ShowTimeId7 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
79 |
|
-- (ShowTimeId7 |- inter) --++(0,0.3); |
|
80 |
|
|
|
|
77 |
|
(Id6)++(0.1,0) -- ++(0,-.8) -- ++(-.7,0) coordinate (inter) |
|
78 |
|
-- (ShowTimeId7 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
79 |
|
-- (ShowTimeId7 |- inter) --++(0,0.3); |
|
80 |
|
|
81 |
81 |
\end{tikzpicture} |
\end{tikzpicture} |
82 |
82 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/EMPLOYEE.tex changed (mode: 100644) (index f94a019..aab5c3d) |
1 |
1 |
\documentclass[border=20pt]{standalone} |
\documentclass[border=20pt]{standalone} |
2 |
2 |
\input{template.def} |
\input{template.def} |
3 |
3 |
|
|
4 |
|
\Frame(0,0){1}[PKLOYEE]{ |
|
5 |
|
Fname/A, |
|
6 |
|
Minit/A, |
|
7 |
|
Lname/A, |
|
8 |
|
Ssn/PK, |
|
9 |
|
Bdate/A, |
|
10 |
|
Address/A, |
|
11 |
|
Sex/A, |
|
12 |
|
Salary/A, |
|
13 |
|
Super-Ssn/A, |
|
14 |
|
Dno/A}; |
|
|
4 |
|
\Frame(0,0){1}[PKLOYEE]{ |
|
5 |
|
Fname/A, |
|
6 |
|
Minit/A, |
|
7 |
|
Lname/A, |
|
8 |
|
Ssn/PK, |
|
9 |
|
Bdate/A, |
|
10 |
|
Address/A, |
|
11 |
|
Sex/A, |
|
12 |
|
Salary/A, |
|
13 |
|
Super-Ssn/A, |
|
14 |
|
Dno/A}; |
15 |
15 |
|
|
16 |
|
\Frame(0,-2.5){2}[DEPARTMENT]{ |
|
17 |
|
Dname/A, |
|
18 |
|
Dnumber/PK, |
|
19 |
|
Mgr-ssn/A, |
|
20 |
|
Mgr-Start-date/A}; |
|
|
16 |
|
\Frame(0,-2.5){2}[DEPARTMENT]{ |
|
17 |
|
Dname/A, |
|
18 |
|
Dnumber/PK, |
|
19 |
|
Mgr-ssn/A, |
|
20 |
|
Mgr-Start-date/A}; |
21 |
21 |
|
|
22 |
|
\Frame(0,-5){3}[DEPT-LOCATIONS]{ |
|
23 |
|
Dnumber/PK, |
|
24 |
|
Dlocations/PK}; |
|
|
22 |
|
\Frame(0,-5){3}[DEPT-LOCATIONS]{ |
|
23 |
|
Dnumber/PK, |
|
24 |
|
Dlocations/PK}; |
25 |
25 |
|
|
26 |
|
\Frame(0,-7.5){4}[PROJECT]{ |
|
27 |
|
Pname/A, |
|
28 |
|
Pnumber/PK, |
|
29 |
|
Plocation/A, |
|
30 |
|
Dnum/A}; |
|
|
26 |
|
\Frame(0,-7.5){4}[PROJECT]{ |
|
27 |
|
Pname/A, |
|
28 |
|
Pnumber/PK, |
|
29 |
|
Plocation/A, |
|
30 |
|
Dnum/A}; |
31 |
31 |
|
|
32 |
|
\Frame(0,-10){5}[WORKS ON]{ |
|
33 |
|
Essn/PK, |
|
34 |
|
Pno/PK, |
|
35 |
|
Hours/A}; |
|
|
32 |
|
\Frame(0,-10){5}[WORKS ON]{ |
|
33 |
|
Essn/PK, |
|
34 |
|
Pno/PK, |
|
35 |
|
Hours/A}; |
36 |
36 |
|
|
37 |
|
\Frame(0,-12.5){6}[DEPENDENT]{ |
|
38 |
|
Essn/PK, |
|
39 |
|
Dependent-Name/A, |
|
40 |
|
Sex/A, |
|
41 |
|
Bdate/A, |
|
42 |
|
Relationship/A}; |
|
|
37 |
|
\Frame(0,-12.5){6}[DEPENDENT]{ |
|
38 |
|
Essn/PK, |
|
39 |
|
Dependent-Name/A, |
|
40 |
|
Sex/A, |
|
41 |
|
Bdate/A, |
|
42 |
|
Relationship/A}; |
43 |
43 |
|
|
44 |
44 |
\draw[FK] % From Essn6 to Ssn1 |
\draw[FK] % From Essn6 to Ssn1 |
45 |
|
(Ssn1)++(0.1,0) -- ++(0,-.55) -- ++(4.5,0) coordinate (inter) %inter is the name of coordinate register |
|
46 |
|
-- (Essn6 -| inter) -- ++(0,-0.4) coordinate (inter) % to calculate intersections. |
|
47 |
|
-- (Essn6 |- inter) --++(0,0.4); % |
|
48 |
|
%Essn -- Ssn id 5 |
|
49 |
|
\draw[FK] |
|
50 |
|
(Ssn1)++(-0.1,0) -- ++(0,-.7) -- ++(4.55,0) coordinate (inter) %some shift using (Ssn1)++(shiftx,shifty) |
|
51 |
|
-- (Essn5 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
52 |
|
-- (Essn5 |- inter) --++(0,0.4); % |
|
53 |
|
\draw[FK] |
|
54 |
|
(Pnumber4) -- ++(0,-.5) -- ++(1,0) coordinate (inter) |
|
55 |
|
-- (Pno5 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
56 |
|
-- (Pno5 |- inter) --++(0,0.2); % |
|
|
45 |
|
(Ssn1)++(0.1,0) -- ++(0,-.55) -- ++(4.5,0) coordinate (inter) %inter is the name of coordinate register |
|
46 |
|
-- (Essn6 -| inter) -- ++(0,-0.4) coordinate (inter) % to calculate intersections. |
|
47 |
|
-- (Essn6 |- inter) --++(0,0.4); % |
|
48 |
|
%Essn -- Ssn id 5 |
|
49 |
|
\draw[FK] |
|
50 |
|
(Ssn1)++(-0.1,0) -- ++(0,-.7) -- ++(4.55,0) coordinate (inter) %some shift using (Ssn1)++(shiftx,shifty) |
|
51 |
|
-- (Essn5 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
52 |
|
-- (Essn5 |- inter) --++(0,0.4); % |
|
53 |
|
\draw[FK] |
|
54 |
|
(Pnumber4) -- ++(0,-.5) -- ++(1,0) coordinate (inter) |
|
55 |
|
-- (Pno5 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
56 |
|
-- (Pno5 |- inter) --++(0,0.2); % |
57 |
57 |
|
|
58 |
|
\draw[FK] |
|
59 |
|
(Dnumber2) -- ++(0,-.75) -- ++(4,0) coordinate (inter) |
|
60 |
|
-- (Dnum4 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
61 |
|
-- (Dnum4|- inter) --++(0,0.2); % |
|
|
58 |
|
\draw[FK] |
|
59 |
|
(Dnumber2) -- ++(0,-.75) -- ++(4,0) coordinate (inter) |
|
60 |
|
-- (Dnum4 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
61 |
|
-- (Dnum4|- inter) --++(0,0.2); % |
62 |
62 |
|
|
63 |
|
\draw[FK] |
|
64 |
|
(Dnumber2)++(-.2,0) -- ++(0,-.9) -- ++(1.75,0) coordinate (inter) |
|
65 |
|
-- (Dnumber3 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
66 |
|
-- (Dnumber3 |- inter) --++(0,0.2); % |
|
|
63 |
|
\draw[FK] |
|
64 |
|
(Dnumber2)++(-.2,0) -- ++(0,-.9) -- ++(1.75,0) coordinate (inter) |
|
65 |
|
-- (Dnumber3 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
66 |
|
-- (Dnumber3 |- inter) --++(0,0.2); % |
67 |
67 |
|
|
68 |
|
\draw[FK] |
|
69 |
|
(Ssn1)++(-0.3,0) -- ++(0,-0.85) -- ++(3.5,0) coordinate (inter) |
|
70 |
|
-- (Mgr-ssn2 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
71 |
|
-- (Mgr-ssn2 |- inter) --++(0,0.3); % |
|
|
68 |
|
\draw[FK] |
|
69 |
|
(Ssn1)++(-0.3,0) -- ++(0,-0.85) -- ++(3.5,0) coordinate (inter) |
|
70 |
|
-- (Mgr-ssn2 -| inter) -- ++(0,-0.2) coordinate (inter) |
|
71 |
|
-- (Mgr-ssn2 |- inter) --++(0,0.3); % |
72 |
72 |
|
|
73 |
|
\draw[FK] |
|
74 |
|
(Dnumber2)++(0.2,0) -- ++(0,-.6) coordinate (inter) -- (Dno1 |- inter) -- (Dno1); % |
|
|
73 |
|
\draw[FK] |
|
74 |
|
(Dnumber2)++(0.2,0) -- ++(0,-.6) coordinate (inter) -- (Dno1 |- inter) -- (Dno1); % |
75 |
75 |
|
|
76 |
|
\draw[FK] |
|
77 |
|
(Ssn1)++(0.3,0) -- ++(0,-.4) coordinate (inter) -- (Super-Ssn1 |- inter) -- (Super-Ssn1); % |
|
|
76 |
|
\draw[FK] |
|
77 |
|
(Ssn1)++(0.3,0) -- ++(0,-.4) coordinate (inter) -- (Super-Ssn1 |- inter) -- (Super-Ssn1); % |
78 |
78 |
|
|
79 |
79 |
\end{tikzpicture} |
\end{tikzpicture} |
80 |
80 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/PROF_DEPARTMENT.tex changed (mode: 100644) (index dd96070..36149dc) |
4 |
4 |
% PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code)) |
% PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code)) |
5 |
5 |
% DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login)) |
% DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login)) |
6 |
6 |
|
|
7 |
|
\Frame(0,0){1}[PROF]{ |
|
|
7 |
|
\Frame(0,0){1}[PROF]{ |
8 |
8 |
Login/PK, |
Login/PK, |
9 |
9 |
Name/A, |
Name/A, |
10 |
|
Department/A}; |
|
|
10 |
|
Department/A}; |
11 |
11 |
|
|
12 |
12 |
\Frame(5, 0){2}[DEPARTMENT]{ |
\Frame(5, 0){2}[DEPARTMENT]{ |
13 |
13 |
Code/PK, |
Code/PK, |
|
15 |
15 |
Head/A}; |
Head/A}; |
16 |
16 |
|
|
17 |
17 |
\draw[FK] % From Department1 to Code2 |
\draw[FK] % From Department1 to Code2 |
18 |
|
(Code2)++(0.1,0) -- ++(0,-.5) -- ++(-1,0) coordinate (inter) |
|
19 |
|
-- (Department1 |- inter) --++(0,0.6); |
|
20 |
|
|
|
|
18 |
|
(Code2)++(0.1,0) -- ++(0,-.5) -- ++(-1,0) coordinate (inter) |
|
19 |
|
-- (Department1 |- inter) --++(0,0.6); |
|
20 |
|
|
21 |
21 |
\draw[FK] % From Head2 to Login1 |
\draw[FK] % From Head2 to Login1 |
22 |
|
(Login1)++(0.1,0) -- ++(0,-1) coordinate (inter) |
|
23 |
|
-- (Head2 |- inter) --++(0, 1.1); |
|
|
22 |
|
(Login1)++(0.1,0) -- ++(0,-1) coordinate (inter) |
|
23 |
|
-- (Head2 |- inter) --++(0, 1.1); |
24 |
24 |
|
|
25 |
25 |
\end{tikzpicture} |
\end{tikzpicture} |
26 |
26 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/TRAIN_Exo.tex changed (mode: 100644) (index 08d0c89..ac18919) |
5 |
5 |
% CONDUCTOR(CompanyID (PK), Name, ExperienceLevel) |
% CONDUCTOR(CompanyID (PK), Name, ExperienceLevel) |
6 |
6 |
% ASSIGNED-TO(TrainRef (PK, FK to TRAIN.REF), ConductorID (PK, FK to CONDUCTOR.CompanyID), Date (PK)) |
% ASSIGNED-TO(TrainRef (PK, FK to TRAIN.REF), ConductorID (PK, FK to CONDUCTOR.CompanyID), Date (PK)) |
7 |
7 |
|
|
8 |
|
\Frame(0,0){1}[TRAIN]{ |
|
|
8 |
|
\Frame(0,0){1}[TRAIN]{ |
9 |
9 |
Ref/PK, |
Ref/PK, |
10 |
10 |
Model/A, |
Model/A, |
11 |
|
Year/A}; |
|
|
11 |
|
Year/A}; |
12 |
12 |
|
|
13 |
13 |
\Frame(0,-2.5){2}[CONDUCTOR]{ |
\Frame(0,-2.5){2}[CONDUCTOR]{ |
14 |
14 |
CompanyID/PK, |
CompanyID/PK, |
|
21 |
21 |
Date/PK}; |
Date/PK}; |
22 |
22 |
|
|
23 |
23 |
\draw[FK] % From TrainRef3 to Ref1 |
\draw[FK] % From TrainRef3 to Ref1 |
24 |
|
(Ref1)++(0.1,0) -- ++(0,-.55) -- ++(-1,0) coordinate (inter) |
|
25 |
|
-- (TrainRef3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
26 |
|
-- (TrainRef3 |- inter) --++(0,0.4); |
|
|
24 |
|
(Ref1)++(0.1,0) -- ++(0,-.55) -- ++(-1,0) coordinate (inter) |
|
25 |
|
-- (TrainRef3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
26 |
|
-- (TrainRef3 |- inter) --++(0,0.4); |
27 |
27 |
|
|
28 |
28 |
|
|
29 |
29 |
\draw[FK] % From ConductorID3 to CompanyID2 |
\draw[FK] % From ConductorID3 to CompanyID2 |
30 |
|
(CompanyID2)++(0.1,0) -- ++(0,-.55) -- ++(4,0) coordinate (inter) |
|
31 |
|
-- (ConductorID3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
32 |
|
-- (ConductorID3 |- inter) --++(0,0.4); |
|
|
30 |
|
(CompanyID2)++(0.1,0) -- ++(0,-.55) -- ++(4,0) coordinate (inter) |
|
31 |
|
-- (ConductorID3 -| inter) -- ++(0,-0.4) coordinate (inter) |
|
32 |
|
-- (ConductorID3 |- inter) --++(0,0.4); |
33 |
33 |
|
|
34 |
34 |
\end{tikzpicture} |
\end{tikzpicture} |
35 |
35 |
\end{document} |
\end{document} |
File notes/fig/uml/Car_Info.tex changed (mode: 100644) (index 432cacd..0fd2c88) |
4 |
4 |
Needs to be rewritten. |
Needs to be rewritten. |
5 |
5 |
|
|
6 |
6 |
\begin{tikzpicture} |
\begin{tikzpicture} |
7 |
|
\node (person) at (0,0){\begin{tabular}{| r l |} |
|
8 |
|
\hline |
|
9 |
|
\multicolumn{2}{| c |}{**Person**}\\ |
|
10 |
|
\hline |
|
11 |
|
id &: String\\ |
|
12 |
|
name &: String\\ |
|
13 |
|
address &: Street\\ |
|
14 |
|
& City\\ |
|
15 |
|
\hline |
|
16 |
|
getAge()&: Int\\ |
|
17 |
|
\hline |
|
18 |
|
\end{tabular} |
|
19 |
|
}; |
|
20 |
|
\node (phone) at (8, 1){\begin{tabular}{| r l |} |
|
21 |
|
\hline |
|
22 |
|
\multicolumn{2}{| c |}{**Phone**}\\ |
|
23 |
|
\hline |
|
24 |
|
number &: String\\ |
|
25 |
|
\hline |
|
26 |
|
\end{tabular} |
|
27 |
|
}; |
|
28 |
|
\draw[open diamond-] (person) -- node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1..1$} (phone); |
|
29 |
|
\node (car) at (8, -3){\begin{tabular}{| r l |} |
|
30 |
|
\hline |
|
31 |
|
\multicolumn{2}{| c |}{**Car**}\\ |
|
32 |
|
\hline |
|
33 |
|
vin &: String\\ |
|
34 |
|
make &: String\\ |
|
35 |
|
year &: Year\\ |
|
36 |
|
brand &: String\\ |
|
37 |
|
\hline |
|
38 |
|
\end{tabular} |
|
39 |
|
}; |
|
40 |
|
\draw[-] ($(person)+(2.5,-0.5)$) -- node[above, pos=0.1]{$0..1$} node[above, pos=0.5]{drives} node[above, pos=0.9]{$0..1$} (car); |
|
41 |
|
%\draw[-] (person) -- node[below, pos=0.1]{$0..1$} node[below, pos=0.9]{$0..4$} ($(car)+(-2.5, 0.5)$); |
|
42 |
|
\node (seat) at (3.5, -5){\begin{tabular}{| r l |} |
|
43 |
|
\hline |
|
44 |
|
\multicolumn{2}{| c |}{**Seats In**}\\ |
|
45 |
|
\hline |
|
46 |
|
position &: String\\ |
|
47 |
|
\hline |
|
48 |
|
\end{tabular} |
|
49 |
|
}; |
|
50 |
|
\draw[dashed] (seat) -- (3.5, -1.6); |
|
|
7 |
|
\node (person) at (0,0){\begin{tabular}{| r l |} |
|
8 |
|
\hline |
|
9 |
|
\multicolumn{2}{| c |}{**Person**} \\ |
|
10 |
|
\hline |
|
11 |
|
id & : String \\ |
|
12 |
|
name & : String \\ |
|
13 |
|
address & : Street \\ |
|
14 |
|
& City \\ |
|
15 |
|
\hline |
|
16 |
|
getAge() & : Int \\ |
|
17 |
|
\hline |
|
18 |
|
\end{tabular} |
|
19 |
|
}; |
|
20 |
|
\node (phone) at (8, 1){\begin{tabular}{| r l |} |
|
21 |
|
\hline |
|
22 |
|
\multicolumn{2}{| c |}{**Phone**} \\ |
|
23 |
|
\hline |
|
24 |
|
number & : String \\ |
|
25 |
|
\hline |
|
26 |
|
\end{tabular} |
|
27 |
|
}; |
|
28 |
|
\draw[open diamond-] (person) -- node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1..1$} (phone); |
|
29 |
|
\node (car) at (8, -3){\begin{tabular}{| r l |} |
|
30 |
|
\hline |
|
31 |
|
\multicolumn{2}{| c |}{**Car**} \\ |
|
32 |
|
\hline |
|
33 |
|
vin & : String \\ |
|
34 |
|
make & : String \\ |
|
35 |
|
year & : Year \\ |
|
36 |
|
brand & : String \\ |
|
37 |
|
\hline |
|
38 |
|
\end{tabular} |
|
39 |
|
}; |
|
40 |
|
\draw[-] ($(person)+(2.5,-0.5)$) -- node[above, pos=0.1]{$0..1$} node[above, pos=0.5]{drives} node[above, pos=0.9]{$0..1$} (car); |
|
41 |
|
%\draw[-] (person) -- node[below, pos=0.1]{$0..1$} node[below, pos=0.9]{$0..4$} ($(car)+(-2.5, 0.5)$); |
|
42 |
|
\node (seat) at (3.5, -5){\begin{tabular}{| r l |} |
|
43 |
|
\hline |
|
44 |
|
\multicolumn{2}{| c |}{**Seats In**} \\ |
|
45 |
|
\hline |
|
46 |
|
position & : String \\ |
|
47 |
|
\hline |
|
48 |
|
\end{tabular} |
|
49 |
|
}; |
|
50 |
|
\draw[dashed] (seat) -- (3.5, -1.6); |
51 |
51 |
|
|
52 |
|
\node (insu) at (14.3, -2){\begin{tabular}{| r l |} |
|
53 |
|
\hline |
|
54 |
|
\multicolumn{2}{| c |}{**Car Insurance**}\\ |
|
55 |
|
\hline |
|
56 |
|
policy number &: String\\ |
|
57 |
|
covered amount &: int\\ |
|
58 |
|
compagny name &: String\\ |
|
59 |
|
\hline |
|
60 |
|
\end{tabular} |
|
61 |
|
}; |
|
|
52 |
|
\node (insu) at (14.3, -2){\begin{tabular}{| r l |} |
|
53 |
|
\hline |
|
54 |
|
\multicolumn{2}{| c |}{**Car Insurance**} \\ |
|
55 |
|
\hline |
|
56 |
|
policy number & : String \\ |
|
57 |
|
covered amount & : int \\ |
|
58 |
|
compagny name & : String \\ |
|
59 |
|
\hline |
|
60 |
|
\end{tabular} |
|
61 |
|
}; |
62 |
62 |
|
|
63 |
|
\draw[diamond -] (car) -- node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1$} (insu); |
|
|
63 |
|
\draw[diamond -] (car) -- node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1$} (insu); |
64 |
64 |
\end{tikzpicture} |
\end{tikzpicture} |
65 |
65 |
\end{document} |
\end{document} |
File notes/fig/uml/Driver.tex changed (mode: 100644) (index cfdad2b..1c13fc1) |
2 |
2 |
\input{template.def} |
\input{template.def} |
3 |
3 |
|
|
4 |
4 |
\begin{tikzpicture} |
\begin{tikzpicture} |
5 |
|
\node (movie) at (0,0){\begin{tabular}{| r l |} |
|
6 |
|
\hline |
|
7 |
|
\multicolumn{2}{| c |}{**DRIVER**}\\ |
|
8 |
|
\hline |
|
9 |
|
id &: String\\ |
|
10 |
|
dob &: Date\\ |
|
11 |
|
name &: String\\ |
|
12 |
|
address &: Street\\ |
|
13 |
|
& City\\ |
|
14 |
|
\hline |
|
15 |
|
getAge()&: Int\\ |
|
16 |
|
\hline |
|
17 |
|
\end{tabular} |
|
18 |
|
}; |
|
19 |
|
\node (cdriver) at (8, 1){\begin{tabular}{| r l |} |
|
20 |
|
\hline |
|
21 |
|
\multicolumn{2}{| c |}{**COMMERCIAL\_DRIVER**}\\ |
|
22 |
|
\hline |
|
23 |
|
Class &: String\\ |
|
24 |
|
\hline |
|
25 |
|
\end{tabular} |
|
26 |
|
}; |
|
27 |
|
%\draw[open diamond-] (movie) -- node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1..1$} (cdriver); |
|
28 |
|
\draw[{Triangle[open]}-] (movie) -- %node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1..1$} |
|
29 |
|
(cdriver); |
|
30 |
|
\node (car) at (9, -2){\begin{tabular}{| r l |} |
|
31 |
|
\hline |
|
32 |
|
\multicolumn{2}{| c |}{**CAR**}\\ |
|
33 |
|
\hline |
|
34 |
|
vin &: String\\ |
|
35 |
|
make &: String\\ |
|
36 |
|
year &: Year\\ |
|
37 |
|
brand &: String\\ |
|
38 |
|
\hline |
|
39 |
|
\end{tabular} |
|
40 |
|
}; |
|
41 |
|
\draw[-] ($(movie)+(2.5,-0.5)$) -- node[above, pos=0.1]{$0..*$} node[above=0.5em]{POSSESSES} node[above, pos=0.9]{$0..*$} (car); |
|
42 |
|
%\draw[-] (movie) -- node[below, pos=0.1]{$0..1$} node[below, pos=0.9]{$0..4$} ($(car)+(-2.5, 0.5)$); |
|
43 |
|
\node (seat) at (3.5, -5){\begin{tabular}{| r l |} |
|
44 |
|
\hline |
|
45 |
|
\multicolumn{2}{| c |}{**POSSESSION\_HISTORY**}\\ |
|
46 |
|
\hline |
|
47 |
|
date of purchase &: Date\\ |
|
48 |
|
\hline |
|
49 |
|
\end{tabular} |
|
50 |
|
}; |
|
51 |
|
\draw[dashed] (seat) -- (3.5, -1.2); |
|
|
5 |
|
\node (movie) at (0,0){\begin{tabular}{| r l |} |
|
6 |
|
\hline |
|
7 |
|
\multicolumn{2}{| c |}{**DRIVER**} \\ |
|
8 |
|
\hline |
|
9 |
|
id & : String \\ |
|
10 |
|
dob & : Date \\ |
|
11 |
|
name & : String \\ |
|
12 |
|
address & : Street \\ |
|
13 |
|
& City \\ |
|
14 |
|
\hline |
|
15 |
|
getAge() & : Int \\ |
|
16 |
|
\hline |
|
17 |
|
\end{tabular} |
|
18 |
|
}; |
|
19 |
|
\node (cdriver) at (8, 1){\begin{tabular}{| r l |} |
|
20 |
|
\hline |
|
21 |
|
\multicolumn{2}{| c |}{**COMMERCIAL\_DRIVER**} \\ |
|
22 |
|
\hline |
|
23 |
|
Class & : String \\ |
|
24 |
|
\hline |
|
25 |
|
\end{tabular} |
|
26 |
|
}; |
|
27 |
|
%\draw[open diamond-] (movie) -- node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1..1$} (cdriver); |
|
28 |
|
\draw[{Triangle[open]}-] (movie) -- %node[above, pos=0.1]{$0..\star$} node[above, pos=0.9]{$1..1$} |
|
29 |
|
(cdriver); |
|
30 |
|
\node (car) at (9, -2){\begin{tabular}{| r l |} |
|
31 |
|
\hline |
|
32 |
|
\multicolumn{2}{| c |}{**CAR**} \\ |
|
33 |
|
\hline |
|
34 |
|
vin & : String \\ |
|
35 |
|
make & : String \\ |
|
36 |
|
year & : Year \\ |
|
37 |
|
brand & : String \\ |
|
38 |
|
\hline |
|
39 |
|
\end{tabular} |
|
40 |
|
}; |
|
41 |
|
\draw[-] ($(movie)+(2.5,-0.5)$) -- node[above, pos=0.1]{$0..*$} node[above=0.5em]{POSSESSES} node[above, pos=0.9]{$0..*$} (car); |
|
42 |
|
%\draw[-] (movie) -- node[below, pos=0.1]{$0..1$} node[below, pos=0.9]{$0..4$} ($(car)+(-2.5, 0.5)$); |
|
43 |
|
\node (seat) at (3.5, -5){\begin{tabular}{| r l |} |
|
44 |
|
\hline |
|
45 |
|
\multicolumn{2}{| c |}{**POSSESSION\_HISTORY**} \\ |
|
46 |
|
\hline |
|
47 |
|
date of purchase & : Date \\ |
|
48 |
|
\hline |
|
49 |
|
\end{tabular} |
|
50 |
|
}; |
|
51 |
|
\draw[dashed] (seat) -- (3.5, -1.2); |
52 |
52 |
|
|
53 |
|
\node (insu) at (15.5, 2){\begin{tabular}{| r l |} |
|
54 |
|
\hline |
|
55 |
|
\multicolumn{2}{| c |}{**CAR\_INSURANCE**}\\ |
|
56 |
|
\hline |
|
57 |
|
policy number &: String\\ |
|
58 |
|
covered amount &: int\\ |
|
59 |
|
compagny name &: String\\ |
|
60 |
|
\hline |
|
61 |
|
\end{tabular} |
|
62 |
|
}; |
|
|
53 |
|
\node (insu) at (15.5, 2){\begin{tabular}{| r l |} |
|
54 |
|
\hline |
|
55 |
|
\multicolumn{2}{| c |}{**CAR\_INSURANCE**} \\ |
|
56 |
|
\hline |
|
57 |
|
policy number & : String \\ |
|
58 |
|
covered amount & : int \\ |
|
59 |
|
compagny name & : String \\ |
|
60 |
|
\hline |
|
61 |
|
\end{tabular} |
|
62 |
|
}; |
63 |
63 |
|
|
64 |
|
\draw[diamond -] (car) -- node[below, pos=0.1, right=.2]{$1..1$} node[below, pos=0.9, right=0.2]{$1..\star$} node[right=0.2]{IS\_COVERED\_BY} (insu); |
|
|
64 |
|
\draw[diamond -] (car) -- node[below, pos=0.1, right=.2]{$1..1$} node[below, pos=0.9, right=0.2]{$1..\star$} node[right=0.2]{IS\_COVERED\_BY} (insu); |
65 |
65 |
\end{tikzpicture} |
\end{tikzpicture} |
66 |
66 |
|
|
67 |
67 |
\end{document} |
\end{document} |
File notes/fig/uml/Flight.tex changed (mode: 100644) (index 033ec52..27f992c) |
3 |
3 |
|
|
4 |
4 |
\begin{tikzpicture} |
\begin{tikzpicture} |
5 |
5 |
\begin{class}[text width=7cm]{Flight}{0,0} |
\begin{class}[text width=7cm]{Flight}{0,0} |
6 |
|
\attribute{flightNumber : Integer} |
|
7 |
|
\attribute{departureTime : Date} |
|
8 |
|
\attribute{flightDuration : Minutes} |
|
9 |
|
\attribute{departingAirport : String} |
|
10 |
|
\attribute{arrivingAirport : String} |
|
11 |
|
\operation{delayFlight(numberOfMinutes : Minutes)} |
|
12 |
|
\operation{getArrivalTime( ) : Date} |
|
|
6 |
|
\attribute{flightNumber : Integer} |
|
7 |
|
\attribute{departureTime : Date} |
|
8 |
|
\attribute{flightDuration : Minutes} |
|
9 |
|
\attribute{departingAirport : String} |
|
10 |
|
\attribute{arrivingAirport : String} |
|
11 |
|
\operation{delayFlight(numberOfMinutes : Minutes)} |
|
12 |
|
\operation{getArrivalTime( ) : Date} |
13 |
13 |
\end{class} |
\end{class} |
14 |
14 |
\begin{class}{Plane}{11, -0.8} |
\begin{class}{Plane}{11, -0.8} |
15 |
|
\attribute{airPlaneType : String} |
|
16 |
|
\attribute{maximumSpeed : MPH} |
|
17 |
|
\attribute{maximumDistance : Miles} |
|
18 |
|
\attribute{tailID : String} |
|
|
15 |
|
\attribute{airPlaneType : String} |
|
16 |
|
\attribute{maximumSpeed : MPH} |
|
17 |
|
\attribute{maximumDistance : Miles} |
|
18 |
|
\attribute{tailID : String} |
19 |
19 |
\end{class} |
\end{class} |
20 |
20 |
\association{Plane}{}{0..1}{Flight}{0..*}{} |
\association{Plane}{}{0..1}{Flight}{0..*}{} |
21 |
21 |
\end{tikzpicture} |
\end{tikzpicture} |