File notes/fig/rel_mod/car_01.tex renamed from notes/fig/rel_mod/CAR1.tex (similarity 96%) (mode: 100644) (index 499a2ec..acf80b4) |
1 |
|
\documentclass[border=20pt]{standalone}
|
|
2 |
|
\input{template.def}
|
|
3 |
|
|
|
4 |
|
% CAR(VIN (PK), Make, Model, Year)
|
|
5 |
|
% DRIVER(State (PK), Licence-number (PK), Name, Address)
|
|
6 |
|
% INSURANCE(Policy-Number (PK), Insured-Car (FK to CAR.VIN), Insured-Driver-State (FK to DRIVER.State),
|
|
7 |
|
% Insured-Driver-Num (FK to DRIVER.Licence-number), Rate)
|
|
8 |
|
% PRICE(Stock-number (PK), Car-Vin (FK to CAR.VIN), Price, Margin)
|
|
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};
|
|
21 |
|
|
|
22 |
|
\Frame(0,-5){3}[INSURANCE]{
|
|
23 |
|
Policy-Num/PK,
|
|
24 |
|
Insured-Car/A,
|
|
25 |
|
Insured-Driver-State/A,
|
|
26 |
|
Insured-Driver-Licence-Num/A,
|
|
27 |
|
Rate/A};
|
|
28 |
|
|
|
29 |
|
\Frame(0,-7.5){4}[PRICE]{
|
|
30 |
|
Car-VIN/A,
|
|
31 |
|
Price/A,
|
|
32 |
|
Margin/A,
|
|
33 |
|
Stock-Num/PK};
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
\draw[FK] % From Insured-Car3 to VIN1
|
|
37 |
|
(VIN1)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter)
|
|
38 |
|
|
|
39 |
|
\draw[FK] % From Car-VIN4 to VIN1
|
|
40 |
|
(VIN1)++(-0.1,0) -- ++(0,-.45) -- ++(-1.1,0) coordinate (inter)
|
|
41 |
|
|
|
42 |
|
\draw[FK] % From Insured-Driver-State3 to State2
|
|
43 |
|
(State2) -- ++(0,-.7) coordinate (inter) -- (Insured-Driver-State3 |- inter) --++(0,-1.1);
|
|
44 |
|
|
|
45 |
|
\draw[FK] % From Insured-Driver-Licence-Num3 to Licence-Num2
|
|
46 |
|
(Licence-Num2) -- ++(0,-.5) coordinate (inter) -- (Insured-Driver-Licence-Num3 |- inter) --++(0,-1.3);
|
|
47 |
|
|
|
48 |
|
\end{tikzpicture}
|
|
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
% CAR(VIN (PK), Make, Model, Year) |
|
5 |
|
% DRIVER(State (PK), Licence-number (PK), Name, Address) |
|
6 |
|
% INSURANCE(Policy-Number (PK), Insured-Car (FK to CAR.VIN), Insured-Driver-State (FK to DRIVER.State), |
|
7 |
|
% Insured-Driver-Num (FK to DRIVER.Licence-number), Rate) |
|
8 |
|
% PRICE(Stock-number (PK), Car-Vin (FK to CAR.VIN), Price, Margin) |
|
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}; |
|
21 |
|
|
|
22 |
|
\Frame(0,-5){3}[INSURANCE]{ |
|
23 |
|
Policy-Num/PK, |
|
24 |
|
Insured-Car/A, |
|
25 |
|
Insured-Driver-State/A, |
|
26 |
|
Insured-Driver-Licence-Num/A, |
|
27 |
|
Rate/A}; |
|
28 |
|
|
|
29 |
|
\Frame(0,-7.5){4}[PRICE]{ |
|
30 |
|
Car-VIN/A, |
|
31 |
|
Price/A, |
|
32 |
|
Margin/A, |
|
33 |
|
Stock-Num/PK}; |
|
34 |
|
|
|
35 |
|
|
|
36 |
|
\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); |
|
40 |
|
|
|
41 |
|
\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); |
|
45 |
|
|
|
46 |
|
\draw[FK] % From Insured-Driver-State3 to State2 |
|
47 |
|
(State2) -- ++(0,-.7) coordinate (inter) -- (Insured-Driver-State3 |- inter) --++(0,-1.1); |
|
48 |
|
|
|
49 |
|
\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); |
|
51 |
|
|
|
52 |
|
\end{tikzpicture} |
49 |
53 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/mapping_relationships_02.tex renamed from notes/fig/rel_mod/MappingRelationships2.tex (similarity 95%) (mode: 100644) (index c7337c7..65409b4) |
1 |
|
\documentclass[border=20pt]{standalone}
|
|
2 |
|
\input{template.def}
|
|
3 |
|
|
|
4 |
|
% ENT.A(KeyA (PK))
|
|
5 |
|
% ENT.B(KeyB (PK))
|
|
6 |
|
% MAPPING(KeyA (PK, FK referencing ENT.A.KeyA), KeyB(FK referencing ENT.B.KeyB))
|
|
7 |
|
|
|
8 |
|
\Frame(0,0){1}[ENT.A]{
|
|
9 |
|
KeyA/PK};
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
\Frame(4, 0){2}[MAPPING]{
|
|
13 |
|
KeyA/PK,
|
|
14 |
|
KeyB/A};
|
|
15 |
|
|
|
16 |
|
\Frame(8, 0){3}[ENT.B]{
|
|
17 |
|
KeyB/PK};
|
|
18 |
|
|
|
19 |
|
\draw[FK] % From MAPPING.KeyA to ENT.A.KeyA
|
|
20 |
|
(KeyA1)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter)
|
|
21 |
|
|
|
22 |
|
\draw[FK] % From MAPPING.KeyB to ENT.B.KeyB
|
|
23 |
|
(KeyB3)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter)
|
|
24 |
|
\end{tikzpicture}
|
|
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
% ENT.A(KeyA (PK)) |
|
5 |
|
% ENT.B(KeyB (PK)) |
|
6 |
|
% MAPPING(KeyA (PK, FK referencing ENT.A.KeyA), KeyB(FK referencing ENT.B.KeyB)) |
|
7 |
|
|
|
8 |
|
\Frame(0,0){1}[ENT.A]{ |
|
9 |
|
KeyA/PK}; |
|
10 |
|
|
|
11 |
|
|
|
12 |
|
\Frame(4, 0){2}[MAPPING]{ |
|
13 |
|
KeyA/PK, |
|
14 |
|
KeyB/A}; |
|
15 |
|
|
|
16 |
|
\Frame(8, 0){3}[ENT.B]{ |
|
17 |
|
KeyB/PK}; |
|
18 |
|
|
|
19 |
|
\draw[FK] % From MAPPING.KeyA to ENT.A.KeyA |
|
20 |
|
(KeyA1)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter) |
|
21 |
|
-- (KeyA2 |- inter) --++(0,0.5); |
|
22 |
|
|
|
23 |
|
\draw[FK] % From MAPPING.KeyB to ENT.B.KeyB |
|
24 |
|
(KeyB3)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter) |
|
25 |
|
-- (KeyB2 |- inter) --++(0,0.5); |
|
26 |
|
\end{tikzpicture} |
25 |
27 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/mapping_relationships_05.tex renamed from notes/fig/rel_mod/MappingRelationships5.tex (similarity 96%) (mode: 100644) (index e163add..b512773) |
1 |
|
\documentclass[border=20pt]{standalone}
|
|
2 |
|
\input{template.def}
|
|
3 |
|
|
|
4 |
|
% ENT.A(KeyA (PK))
|
|
5 |
|
% REL(KeyA1 (PK, FK referencing Ent.A.KeyA), KeyA2 (FK referencing Ent.A.KeyA))
|
|
6 |
|
|
|
7 |
|
\Frame(0,0){1}[ENT.A]{
|
|
8 |
|
KeyA/PK};
|
|
9 |
|
|
|
10 |
|
\Frame(4, 0){2}[REL]{
|
|
11 |
|
KeyA1/PK,
|
|
12 |
|
KeyA2/A};
|
|
13 |
|
|
|
14 |
|
\draw[FK] % From REL.KeyA to ENT.A.KeyA
|
|
15 |
|
(KeyA1)++(.1,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter)
|
|
16 |
|
|
|
17 |
|
\draw[FK] % From REL.KeyA to ENT.A.KeyA
|
|
18 |
|
(KeyA1)++(-.1,0) -- ++(0,-.8) -- ++(-0,0) coordinate (inter)
|
|
19 |
|
\end{tikzpicture}
|
|
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
% ENT.A(KeyA (PK)) |
|
5 |
|
% REL(KeyA1 (PK, FK referencing Ent.A.KeyA), KeyA2 (FK referencing Ent.A.KeyA)) |
|
6 |
|
|
|
7 |
|
\Frame(0,0){1}[ENT.A]{ |
|
8 |
|
KeyA/PK}; |
|
9 |
|
|
|
10 |
|
\Frame(4, 0){2}[REL]{ |
|
11 |
|
KeyA1/PK, |
|
12 |
|
KeyA2/A}; |
|
13 |
|
|
|
14 |
|
\draw[FK] % From REL.KeyA to ENT.A.KeyA |
|
15 |
|
(KeyA1)++(.1,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter) |
|
16 |
|
-- (KeyA12 |- inter) --++(0,0.5); |
|
17 |
|
|
|
18 |
|
\draw[FK] % From REL.KeyA to ENT.A.KeyA |
|
19 |
|
(KeyA1)++(-.1,0) -- ++(0,-.8) -- ++(-0,0) coordinate (inter) |
|
20 |
|
-- (KeyA22 |- inter) --++(0,0.8); |
|
21 |
|
\end{tikzpicture} |
20 |
22 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/professor_department.tex renamed from notes/fig/rel_mod/PROF_DEPARTMENT.tex (similarity 95%) (mode: 100644) (index 3641ca9..36149dc) |
1 |
|
\documentclass[border=20pt]{standalone}
|
|
2 |
|
\input{template.def}
|
|
3 |
|
|
|
4 |
|
% PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code))
|
|
5 |
|
% DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login))
|
|
6 |
|
|
|
7 |
|
\Frame(0,0){1}[PROF]{
|
|
8 |
|
Login/PK,
|
|
9 |
|
Name/A,
|
|
10 |
|
Department/A};
|
|
11 |
|
|
|
12 |
|
\Frame(5, 0){2}[DEPARTMENT]{
|
|
13 |
|
Code/PK,
|
|
14 |
|
Name/A,
|
|
15 |
|
Head/A};
|
|
16 |
|
|
|
17 |
|
\draw[FK] % From Department1 to Code2
|
|
18 |
|
(Code2)++(0.1,0) -- ++(0,-.5) -- ++(-1,0) coordinate (inter)
|
|
19 |
|
|
|
20 |
|
\draw[FK] % From Head2 to Login1
|
|
21 |
|
(Login1)++(0.1,0) -- ++(0,-1) coordinate (inter)
|
|
22 |
|
|
|
23 |
|
\end{tikzpicture}
|
|
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
% PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code)) |
|
5 |
|
% DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login)) |
|
6 |
|
|
|
7 |
|
\Frame(0,0){1}[PROF]{ |
|
8 |
|
Login/PK, |
|
9 |
|
Name/A, |
|
10 |
|
Department/A}; |
|
11 |
|
|
|
12 |
|
\Frame(5, 0){2}[DEPARTMENT]{ |
|
13 |
|
Code/PK, |
|
14 |
|
Name/A, |
|
15 |
|
Head/A}; |
|
16 |
|
|
|
17 |
|
\draw[FK] % From Department1 to Code2 |
|
18 |
|
(Code2)++(0.1,0) -- ++(0,-.5) -- ++(-1,0) coordinate (inter) |
|
19 |
|
-- (Department1 |- inter) --++(0,0.6); |
|
20 |
|
|
|
21 |
|
\draw[FK] % From Head2 to Login1 |
|
22 |
|
(Login1)++(0.1,0) -- ++(0,-1) coordinate (inter) |
|
23 |
|
-- (Head2 |- inter) --++(0, 1.1); |
|
24 |
|
|
|
25 |
|
\end{tikzpicture} |
24 |
26 |
\end{document} |
\end{document} |
File notes/fig/rel_mod/professor_department_extended.tex renamed from notes/fig/rel_mod/PROF_DEPARTMENT_EXTENDED.tex (similarity 96%) (mode: 100644) (index 985d926..bf21c04) |
1 |
|
\documentclass[border=20pt]{standalone}
|
|
2 |
|
\input{template.def}
|
|
3 |
|
|
|
4 |
|
% PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code))
|
|
5 |
|
% DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login))
|
|
6 |
|
% LECTURE (Code (PK), Year (PK), Name, Instructor (FK to PROF.Login)
|
|
7 |
|
% STUDENT(Login (PK), Name, Registered, Major (FK to DEPARTMENT.Code))
|
|
8 |
|
% GRADE (Login (PK, FK to STUDENT.Login), Grade (PK), LectureCode (FK to LECTURE.Code), LectureYear (FK to LECTURE.Year))
|
|
9 |
|
|
|
10 |
|
\Frame(0,0){1}[PROF]{
|
|
11 |
|
Login/PK,
|
|
12 |
|
Name/A,
|
|
13 |
|
Department/A};
|
|
14 |
|
|
|
15 |
|
\Frame(5, 0){2}[DEPARTMENT]{
|
|
16 |
|
Code/PK,
|
|
17 |
|
Name/A,
|
|
18 |
|
Head/A};
|
|
19 |
|
|
|
20 |
|
\Frame(0, -3){4}[LECTURE]{
|
|
21 |
|
Code/PK,
|
|
22 |
|
Year/PK,
|
|
23 |
|
Name/A,
|
|
24 |
|
Instructor/A};
|
|
25 |
|
|
|
26 |
|
|
|
27 |
|
\Frame(5, -3){3}[STUDENT]{
|
|
28 |
|
Login/PK,
|
|
29 |
|
Name/A,
|
|
30 |
|
Registered/A,
|
|
31 |
|
Major/A};
|
|
32 |
|
|
|
33 |
|
\Frame(2.5, -6){5}[GRADE]{
|
|
34 |
|
Login/PK,
|
|
35 |
|
Grade/PK,
|
|
36 |
|
LectureCode/A,
|
|
37 |
|
LectureYear/A};
|
|
38 |
|
|
|
39 |
|
\draw[FK] % From Department1 to Code2
|
|
40 |
|
(Code2)++(-0.1,0) -- ++(0,-.5) -- ++(-1,0) coordinate (inter)
|
|
41 |
|
|
|
42 |
|
\draw[FK] % From Major3 to Code2
|
|
43 |
|
(Code2)++(0.1,0) -- ++(0,-.5) -- ++(5,0) -- ++(0,-3) -- ++(-1.15, 0) -- (Major3);
|
|
44 |
|
|
|
45 |
|
\draw[FK] % From Head2 to Login1
|
|
46 |
|
(Login1)++(0.1,0) -- ++(0,-1) coordinate (inter)
|
|
47 |
|
|
|
48 |
|
%\draw[FK] % From Instructor4 to Login1
|
|
49 |
|
%(Login1)++(-0.1,0) -- ++(0, -.5) -- ++(-1,0) -- ++(0, -3) -- ++(4.36, 0) -- (Instructor4);
|
|
50 |
|
|
|
51 |
|
\draw[FK] % From Instructor4 to Login1
|
|
52 |
|
(Login1)++(-0.1,0) -- ++(0, -1.5) -- ++(4.4,0) -- ++(0, -2) -- ++(-1.04, 0) --
|
|
53 |
|
(Instructor4);
|
|
54 |
|
|
|
55 |
|
\draw[FK] % From Login5 to Login3
|
|
56 |
|
(Login3)-- ++(0, -1) -- ++(-3.5,0) -- ++(0, -2.5) -- ++(1, 0) -- (Login5);
|
|
57 |
|
|
|
58 |
|
\draw[FK] % From LectureCode5 to Code4
|
|
59 |
|
(Code4)-- ++(0, -4) -- ++(5.19,0) --(LectureCode5);
|
|
60 |
|
|
|
61 |
|
\draw[FK] % From LectureYear5 to Year4
|
|
62 |
|
(Year4)-- ++(0, -5) -- ++(6.3,0) --(LectureYear5);
|
|
63 |
|
\end{tikzpicture}
|
|
|
1 |
|
\documentclass[border=20pt]{standalone} |
|
2 |
|
\input{template.def} |
|
3 |
|
|
|
4 |
|
% PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code)) |
|
5 |
|
% DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login)) |
|
6 |
|
% LECTURE (Code (PK), Year (PK), Name, Instructor (FK to PROF.Login) |
|
7 |
|
% STUDENT(Login (PK), Name, Registered, Major (FK to DEPARTMENT.Code)) |
|
8 |
|
% GRADE (Login (PK, FK to STUDENT.Login), Grade (PK), LectureCode (FK to LECTURE.Code), LectureYear (FK to LECTURE.Year)) |
|
9 |
|
|
|
10 |
|
\Frame(0,0){1}[PROF]{ |
|
11 |
|
Login/PK, |
|
12 |
|
Name/A, |
|
13 |
|
Department/A}; |
|
14 |
|
|
|
15 |
|
\Frame(5, 0){2}[DEPARTMENT]{ |
|
16 |
|
Code/PK, |
|
17 |
|
Name/A, |
|
18 |
|
Head/A}; |
|
19 |
|
|
|
20 |
|
\Frame(0, -3){4}[LECTURE]{ |
|
21 |
|
Code/PK, |
|
22 |
|
Year/PK, |
|
23 |
|
Name/A, |
|
24 |
|
Instructor/A}; |
|
25 |
|
|
|
26 |
|
|
|
27 |
|
\Frame(5, -3){3}[STUDENT]{ |
|
28 |
|
Login/PK, |
|
29 |
|
Name/A, |
|
30 |
|
Registered/A, |
|
31 |
|
Major/A}; |
|
32 |
|
|
|
33 |
|
\Frame(2.5, -6){5}[GRADE]{ |
|
34 |
|
Login/PK, |
|
35 |
|
Grade/PK, |
|
36 |
|
LectureCode/A, |
|
37 |
|
LectureYear/A}; |
|
38 |
|
|
|
39 |
|
\draw[FK] % From Department1 to Code2 |
|
40 |
|
(Code2)++(-0.1,0) -- ++(0,-.5) -- ++(-1,0) coordinate (inter) |
|
41 |
|
-- (Department1 |- inter) --++(0,0.6); |
|
42 |
|
|
|
43 |
|
\draw[FK] % From Major3 to Code2 |
|
44 |
|
(Code2)++(0.1,0) -- ++(0,-.5) -- ++(5,0) -- ++(0,-3) -- ++(-1.15, 0) -- (Major3); |
|
45 |
|
|
|
46 |
|
\draw[FK] % From Head2 to Login1 |
|
47 |
|
(Login1)++(0.1,0) -- ++(0,-1) coordinate (inter) |
|
48 |
|
-- (Head2 |- inter) --++(0, 1.1); |
|
49 |
|
|
|
50 |
|
%\draw[FK] % From Instructor4 to Login1 |
|
51 |
|
%(Login1)++(-0.1,0) -- ++(0, -.5) -- ++(-1,0) -- ++(0, -3) -- ++(4.36, 0) -- (Instructor4); |
|
52 |
|
|
|
53 |
|
\draw[FK] % From Instructor4 to Login1 |
|
54 |
|
(Login1)++(-0.1,0) -- ++(0, -1.5) -- ++(4.4,0) -- ++(0, -2) -- ++(-1.04, 0) -- |
|
55 |
|
(Instructor4); |
|
56 |
|
|
|
57 |
|
\draw[FK] % From Login5 to Login3 |
|
58 |
|
(Login3)-- ++(0, -1) -- ++(-3.5,0) -- ++(0, -2.5) -- ++(1, 0) -- (Login5); |
|
59 |
|
|
|
60 |
|
\draw[FK] % From LectureCode5 to Code4 |
|
61 |
|
(Code4)-- ++(0, -4) -- ++(5.19,0) --(LectureCode5); |
|
62 |
|
|
|
63 |
|
\draw[FK] % From LectureYear5 to Year4 |
|
64 |
|
(Year4)-- ++(0, -5) -- ++(6.3,0) --(LectureYear5); |
|
65 |
|
\end{tikzpicture} |
64 |
66 |
\end{document} |
\end{document} |