List of commits:
Subject Hash Author Date (UTC)
Changing vect. format from SVG to PDF. fa1276c21b6d139d52bd2c0405a9eb694e1a932d au 2018-12-16 05:25:50
Fixing minor typos 3fd56098f9022b48fadff8e3ea10fd7fcd49213a au 2018-12-16 04:05:47
Re-organization of the project. ccb3e4e35a17076f72b836720948ba7cfe86155b au 2018-12-16 03:16:19
Ending reporting notes on paper, added planned schedule, added meta-info and made tthe pdf TOC deeper. 96ffdff901b7e059471c34d7f7df6771ded38783 aubert@math.cnrs.fr 2018-05-30 15:46:13
Starting to work on ER def, adding some diagrams. 4a938b9a338846c988800a1cc4d0c5f9fcd31f8d aubert@math.cnrs.fr 2018-05-29 21:16:02
Finished SQL, started Design. 00c36f130c3f88bd548d009eb80e910db64ec823 aubert@math.cnrs.fr 2018-05-25 20:46:33
Adding the temp file, trying to patch the numbering of exercises inside problems. e4e4624cd1037e65a45e8690f2b92e183714b486 aubert@math.cnrs.fr 2018-05-24 19:22:13
Cleaned up the code, fixed some typos, added a list of problems, started working onthe problem for SQL. 701556c081df0bbf8e8800106c7aa4c997e560de aubert@math.cnrs.fr 2018-05-24 07:21:26
Finishing exo for chapter SQL aea58f58f06d99615ae7cb85247bdc08c5ce9d96 aubert@math.cnrs.fr 2018-05-23 17:52:51
Progress on the SQL chapter. e13cddc35a709c6714a90b21d8ed8db6b037793c aubert@math.cnrs.fr 2018-05-23 05:12:21
Started type some relational model examples in latex, reviewed chapter 1 and 2. 1ddf3000e0cb4f8f02b2b2de1ffd8ae14a81c9dc aubert@math.cnrs.fr 2018-05-22 21:09:12
Finished correcting Chapter 1. Added a preamble and tweaked a lot (math, references, titles of subsubsections, etc.) acdd1bb083cd6985763afd9b77e1b7995dc1ebd7 aubert@math.cnrs.fr 2018-05-22 07:02:51
Cleaning latex dependencies: removed colors, fonts, etc., added header and footer. b4c1232d6091e12bc2cdf038529921143a55b758 aubert@math.cnrs.fr 2018-05-22 05:06:04
Putting all latex material aside, changing class. e43fb54e6ecb0ec4669ed16feba940b47ee3e35c aubert@math.cnrs.fr 2018-05-21 15:14:48
Gathering references, fixing many small typos, adding references in bib. 4f5281a0770f07d2f48f36462ab25f0a3945f4e0 aubert@math.cnrs.fr 2018-05-21 04:54:59
Finished merging exercises into lecture notes! 36e1f79080a8ac56837632bcac2c119fc3efa24f aubert@math.cnrs.fr 2018-05-20 18:50:54
Almost done with the homeworks! f82824a2ca9769a0ecf8fc75d6bf1cae1ef3c7a4 aubert@math.cnrs.fr 2018-05-20 05:23:43
Travail sur intégration des exos dans les notes. c5a6676f85953c7bec9bb2de99bed3552ecf52af aubert@math.cnrs.fr 2018-05-20 05:04:30
Les exercises compilent :-) d4230fce5210d1d8905a42d11634e49e82217541 aubert@math.cnrs.fr 2018-05-19 19:09:56
Progrès sur exercises. 40dd86cdc624209a2282d4437921f46325c2cfa1 aubert@math.cnrs.fr 2018-05-19 18:34:07
Commit fa1276c21b6d139d52bd2c0405a9eb694e1a932d - Changing vect. format from SVG to PDF.
Author: au
Author date (UTC): 2018-12-16 05:25
Committer name: au
Committer date (UTC): 2018-12-16 05:25
Parent(s): 3fd56098f9022b48fadff8e3ea10fd7fcd49213a
Signer:
Signing key:
Signing status: N
Tree: d7714137948873bf4108f9cf1d71ad8a3e642d8b
File Lines added Lines deleted
notes/Makefile 7 8
notes/img/2NF2.jpeg 0 0
notes/lectures_notes.md 17 17
notes/svg/er/Bad_Design.tex 0 22
notes/svg/er/Constraint1.tex 0 12
notes/svg/er/Constraint2.tex 0 12
notes/svg/er/Entity_Instructor.tex 0 22
notes/svg/er/Naming.tex 0 18
notes/svg/er/Rel_Instance.tex 0 30
notes/svg/er/Role_Name1.tex 0 12
notes/svg/er/Role_Name2.tex 0 13
notes/svg/er/Role_Name3.tex 0 13
notes/svg/er/template.def 0 79
notes/svg/rel_mod/ADDRESS.tex 0 23
notes/svg/rel_mod/BOOK_Exo.tex 0 26
notes/svg/rel_mod/BOOK_Sol.tex 0 37
notes/svg/rel_mod/CAR.tex 0 55
notes/svg/rel_mod/CINEMA.tex 0 84
notes/svg/rel_mod/EMPLOYEE.tex 0 82
notes/svg/rel_mod/PROF_DEPARTMENT.tex 0 28
notes/svg/rel_mod/RPG.tex 0 70
notes/svg/rel_mod/TRAIN_Exo.tex 0 37
notes/svg/rel_mod/template.def 0 69
File notes/Makefile changed (mode: 100644) (index 1672f88..5f799ea)
2 2
3 3 # Makefile global options. # Makefile global options.
4 4
5 MAKEFLAGS := -j
5 MAKEFLAGS := -j
6 6 ## Maximize parallel execution whenever possible ## Maximize parallel execution whenever possible
7 7
8 8 # "Phony" rule to compile the SVG figures using latexmk # "Phony" rule to compile the SVG figures using latexmk
9 9
10 SVG = svg/er/*.tex svg/rel_mod/*.tex
11 .PHONY: svg $(SVG)
12 svg: $(SVG)
13 $(SVG):
14 latexmk -silent -cd $@
15
10 VEC = vec/rel_mod/*.tex vec/er/*.tex
11 .PHONY: vec $(VEC)
12 vec: $(VEC)
13 $(VEC):
14 latexmk -silent -cd -pdf $@
16 15
17 16 # Rule to compile the pdf # Rule to compile the pdf
18 17
19 pdf: lectures_notes.md | $(SVG) # $(SVG) is an "order-only" pre-requisite. Cf. http://www.gnu.org/software/make/manual/make.html#Types-of-Prerequisites
18 pdf: lectures_notes.md | $(PDF) # $(PDF) is an "order-only" pre-requisite. Cf. http://www.gnu.org/software/make/manual/make.html#Types-of-Prerequisites
20 19 pandoc --pdf-engine=xelatex --pdf-engine-opt=-shell-escape --toc --filter pandoc-numbering --filter pandoc-citeproc --top-level-division=chapter -V links-as-notes -M date="$$(LANG=en_us_88591 date '+%B %e, %Y (%r)')" -o lectures_notes.pdf $< pandoc --pdf-engine=xelatex --pdf-engine-opt=-shell-escape --toc --filter pandoc-numbering --filter pandoc-citeproc --top-level-division=chapter -V links-as-notes -M date="$$(LANG=en_us_88591 date '+%B %e, %Y (%r)')" -o lectures_notes.pdf $<
21 20
22 21 # #
File notes/img/2NF2.jpeg added (mode: 100644) (index 0000000..63164f1)
File notes/lectures_notes.md changed (mode: 100644) (index ef28ac5..d68c5c7)
... ... CAR(VIN (PK), Make, Model, Year)
549 549 DRIVER(State (PK), Licence\_number (PK), Name, Address) DRIVER(State (PK), Licence\_number (PK), Name, Address)
550 550 INSURANCE(Policy\_Number (PK), Insured\_Car (FK to CAR.VIN), Insured\_Driver\_State (FK to DRIVER.State), Insured\_Driver\_Num (FK to DRIVER.Licence\_number), Rate) INSURANCE(Policy\_Number (PK), Insured\_Car (FK to CAR.VIN), Insured\_Driver\_State (FK to DRIVER.State), Insured\_Driver\_Num (FK to DRIVER.Licence\_number), Rate)
551 551 PRICE(Stock\_number (PK), Car\_Vin (FK to CAR.VIN), Price, Margin) PRICE(Stock\_number (PK), Car\_Vin (FK to CAR.VIN), Price, Margin)
552 ](svg/rel_mod/CAR.svg){ width=100% }
552 ](vec/rel_mod/CAR.pdf){ width=100% }
553 553 \ \
554 554
555 555 (Yes, we do need the state *and* the licence number to uniquely identify a driver's licence, since [many states use the same licence format](https://ntsi.com/drivers-license-format/). (Yes, we do need the state *and* the licence number to uniquely identify a driver's licence, since [many states use the same licence format](https://ntsi.com/drivers-license-format/).
 
... ... Exercise +.#
662 662 AUTHOR(Ref, Name, Address) AUTHOR(Ref, Name, Address)
663 663 BOOK(ISSN, AuthorRef, Title) BOOK(ISSN, AuthorRef, Title)
664 664 GAINED-AWARD(Ref, Name, BookISSN, Year) GAINED-AWARD(Ref, Name, BookISSN, Year)
665 ](svg/rel_mod/BOOK_Exo.svg){ width=100% }
665 ](vec/rel_mod/BOOK_Exo.pdf){ width=100% }
666 666 \ \
667 667
668 668 For each relation, answer the following: For each relation, answer the following:
 
... ... Exercise +.#
678 678 TRAIN(Ref (PK), Model, Year) TRAIN(Ref (PK), Model, Year)
679 679 CONDUCTOR(CompanyID (PK), Name, ExperienceLevel) CONDUCTOR(CompanyID (PK), Name, ExperienceLevel)
680 680 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))
681 ](svg/rel_mod/TRAIN_Exo.svg){ width=100% }
681 ](vec/rel_mod/TRAIN_Exo.pdf){ width=100% }
682 682 \ \
683 683
684 684 #. What are the foreign keys in the ASSIGNED-TO relation? What are they refering? #. What are the foreign keys in the ASSIGNED-TO relation? What are they refering?
 
... ... Solution +.#
731 731 AUTHOR(Ref (PK), Name, Address) AUTHOR(Ref (PK), Name, Address)
732 732 BOOK(ISSN (PK), AuthorRef (FK to AUTHOR.REF), Title) BOOK(ISSN (PK), AuthorRef (FK to AUTHOR.REF), Title)
733 733 GAINED-AWARD(Ref (PK), Name, BookISSN (FK to BOOK.ISSN), Year) GAINED-AWARD(Ref (PK), Name, BookISSN (FK to BOOK.ISSN), Year)
734 ](svg/rel_mod/BOOK_Exo.svg){ width=100% }
734 ](vec/rel_mod/BOOK_Exo.pdf){ width=100% }
735 735 \ \
736 736
737 737 For the last question, the answer is yes: based on the ISSN of the book, we can retrieve the author of the book. Hence, knowing which book was awarded which year, by lookinq in the GAINED-AWARD table, gives us the answer to that question. For the last question, the answer is yes: based on the ISSN of the book, we can retrieve the author of the book. Hence, knowing which book was awarded which year, by lookinq in the GAINED-AWARD table, gives us the answer to that question.
 
... ... THEATER(Id (PK), Name, Address)
794 794 AUDITORIUM(Id (PK), Capacity, Theater (FK to THEATER.Id)) AUDITORIUM(Id (PK), Capacity, Theater (FK to THEATER.Id))
795 795 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)
796 796 TICKETS(Id (PK), ShowTimeId (FK to SHOWTIME.Id), Price) TICKETS(Id (PK), ShowTimeId (FK to SHOWTIME.Id), Price)
797 ](svg/rel_mod/CINEMA.svg){ width=100% }
797 ](vec/rel_mod/CINEMA.pdf){ width=100% }
798 798 \ \
799 799
800 800 # The SQL Programming Language # The SQL Programming Language
 
... ... MariaDB [HW_CONSTRAINTS_PART3]> SELECT * FROM Table_set_null;
1247 1247 ![ ![
1248 1248 PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code)) PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code))
1249 1249 DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login)) DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login))
1250 ](svg/rel_mod/PROF_DEPARTMENT.svg){ width=100% }
1250 ](vec/rel_mod/PROF_DEPARTMENT.pdf){ width=100% }
1251 1251 \ \
1252 1252
1253 1253 ~~~{.sqlmysql .numberLines} ~~~{.sqlmysql .numberLines}
 
... ... We then create the tables as in the problem.
2895 2895 ![ ![
2896 2896 NAME(FName, LName, Id(PK)) NAME(FName, LName, Id(PK))
2897 2897 ADDRESS(StreetName (PK), Number (PK), Habitants (FK referencing NAME.Id)) ADDRESS(StreetName (PK), Number (PK), Habitants (FK referencing NAME.Id))
2898 ](svg/rel_mod/ADDRESS.svg){ width=100% }
2898 ](vec/rel_mod/ADDRESS.pdf){ width=100% }
2899 2899 \ \
2900 2900
2901 2901 @problem:address -- Solution to Q. -.# @problem:address -- Solution to Q. -.#
 
... ... WEAPON(Name (PK), Bonus, Possessed-By (FK to CHARACTER.Name))
3317 3317 QUEST(Name (PK), XP) QUEST(Name (PK), XP)
3318 3318 COMPLETED-BY(Character (PK, FK to CHARACTER.Name), Quest (PK, FK to QUEST.Name)) COMPLETED-BY(Character (PK, FK to CHARACTER.Name), Quest (PK, FK to QUEST.Name))
3319 3319 SPECIAL-ITEM(Name (P), Quest (FK to QUEST.Name)) SPECIAL-ITEM(Name (P), Quest (FK to QUEST.Name))
3320 ](svg/rel_mod/RPG.svg){ width=100% }
3320 ](vec/rel_mod/RPG.pdf){ width=100% }
3321 3321 \ \
3322 3322
3323 3323 # Designing a Good Database # Designing a Good Database
 
... ... multivalued | the box have double lines |
3431 3431 derived | the box have dotted lines | derived | the box have dotted lines |
3432 3432 a key | the name of the attribute is underlined | a key | the name of the attribute is underlined |
3433 3433
3434 ![](svg/er/Naming.svg){ width=100% }
3434 ![](vec/er/Naming.pdf){ width=100% }
3435 3435 \ \
3436 3436
3437 ![](svg/er/Entity_Instructor.svg){ width=100% }
3437 ![](vec/er/Entity_Instructor.pdf){ width=100% }
3438 3438 \ \
3439 3439
3440 3440 --- ---
 
... ... Reminder: entity = actual thing, entity set = collection of entities, entity typ
3452 3452
3453 3453 $E_1$, … $E_n$ *participate* in R, $e_1$, …, $e_n$ *participate* in $r_1$, $n$ is the degree. $E_1$, … $E_n$ *participate* in R, $e_1$, …, $e_n$ *participate* in $r_1$, $n$ is the degree.
3454 3454
3455 ![](svg/er/Rel_Instance.svg){ width=100% }
3455 ![](vec/er/Rel_Instance.pdf){ width=100% }
3456 3456 \ \
3457 3457
3458 3458 Note that we can have Entity Set 1 = Entity Set 2, in which case we say the relation is recursive. Note that we can have Entity Set 1 = Entity Set 2, in which case we say the relation is recursive.
 
... ... Naming convention:
3465 3465 - Drawing usually reads right to left, and up to down. - Drawing usually reads right to left, and up to down.
3466 3466
3467 3467
3468 ![](svg/er/Bad_Design.svg){ width=100% }
3468 ![](vec/er/Bad_Design.pdf){ width=100% }
3469 3469 \ \
3470 3470
3471 3471
 
... ... Convenient, and sometimes mandatory, to give role names.
3475 3475
3476 3476 If we want to stress that we are considering only one aspect of an entity (that is, a person is not only an employee, a company is not only an employer, but this aspect is crucial for the "EMPLOYS" relation): If we want to stress that we are considering only one aspect of an entity (that is, a person is not only an employee, a company is not only an employer, but this aspect is crucial for the "EMPLOYS" relation):
3477 3477
3478 ![](svg/er/Role_Name1.svg){ width=100% }
3478 ![](vec/er/Role_Name1.pdf){ width=100% }
3479 3479
3480 3480 We can also use it to make the "right-side" and the "left-side" of a recursive relationship explicit: We can also use it to make the "right-side" and the "left-side" of a recursive relationship explicit:
3481 3481
3482 ![](svg/er/Role_Name2.svg){ width=100% }
3483 ![](svg/er/Role_Name3.svg){ width=100% }
3482 ![](vec/er/Role_Name2.pdf){ width=100% }
3483 ![](vec/er/Role_Name3.pdf){ width=100% }
3484 3484
3485 3485 Finally, we will sometimes use "Role Name of Entity 1 : Role Name of Entity 2" as a notation for the relation between them. Finally, we will sometimes use "Role Name of Entity 1 : Role Name of Entity 2" as a notation for the relation between them.
3486 3486 For instance, we can write "Employer:Employee" to denote the "EMPLOYS" relation, and we will also use this notation with entities, and write "PERSON:POSITION" for the "OCCUPIES" relation. For instance, we can write "Employer:Employee" to denote the "EMPLOYS" relation, and we will also use this notation with entities, and write "PERSON:POSITION" for the "OCCUPIES" relation.
 
... ... For binary relations, can be $1:1$, $N:1$, $M:N$ ($1$ is "at most", $M$, $N$, $O
3503 3503
3504 3504 We indicate the ratio on the edges: We indicate the ratio on the edges:
3505 3505
3506 ![](svg/er/Constraint1.svg){ width=100% }
3506 ![](vec/er/Constraint1.pdf){ width=100% }
3507 3507
3508 3508 ##### Participation constraint ##### Participation constraint
3509 3509
 
... ... The participation can be total (a.k.a. existence dependency) or partial.
3513 3513
3514 3514 Total is drawn with a double line, partial is drawn with a single line. Total is drawn with a double line, partial is drawn with a single line.
3515 3515
3516 ![](svg/er/Constraint1.svg){ width=100% }
3516 ![](vec/er/Constraint1.pdf){ width=100% }
3517 3517
3518 3518
3519 3519 #### Attributes #### Attributes
File notes/svg/er/Bad_Design.tex deleted (index 0a88db9..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=2em]
7 \node[entity] (people) {PEOPLE};
8 \node[relationship] (has) [right=of people] {HAS} edge (people);
9 \node[entity] (job) [right = of has] {JOB} edge (has);
10 \node[relationship] (in) [above=of job] {IN} edge (job);
11 \node[entity] (employer) [above=of in] {EMPLOYER} edge (in);
12
13 \draw [->, >=latex] (has)+(0, -1) -- ++(0, -2);
14
15 \node[entity] (person) [below right = 6.5 and -2.5 of people] {PERSON};
16 \node[relationship] (occupies) [right=of person] {OCCUPIES} edge (person);
17 \node[entity] (position) [right = of occupies] {POSITION} edge (occupies);
18 \node[relationship] (offers) [above=of position] {OFFERS} edge (position);
19 \node[entity] (company) [above=of offers] {COMPANY} edge (offers);
20 \end{tikzpicture}
21
22 \end{document}
File notes/svg/er/Constraint1.tex deleted (index 4864cb0..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=5em]
7 \node [entity] (course) {COURSE};
8 \node [relationship] (offeredby) [right=of course] {OFFERED\_BY} edge node[above]{$\cN$} (course);
9 \node [entity] (department) [right = of offeredby] {DEPARTMENT} edge node[above]{$1$} (offeredby);
10 \end{tikzpicture}
11
12 \end{document}
File notes/svg/er/Constraint2.tex deleted (index 1fac64e..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=5em]
7 \node [entity] (course) {COURSE};
8 \node [relationship] (offeredby) [right=of course] {OFFERED\_BY} edge[total] node[above]{$\cN$} (course);
9 \node [entity] (department) [right = of offeredby] {DEPARTMENT} edge node[above]{$1$} (offeredby);
10 \end{tikzpicture}
11
12 \end{document}
File notes/svg/er/Entity_Instructor.tex deleted (index 9f29d5f..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=7em]
7 \node[entity] (entity) {INSTRUCTOR};
8 \node[attribute] (pid) [left = 2em of entity] {\key{Login}} edge (entity);
9 \node[attribute] (name) [above left of=entity] {Position Title} edge (entity);
10 \node[attribute] (name) [above =5em of entity] {Name} edge (entity);
11 \node[attribute] (fname) [above left of = name] {First Name} edge (name);
12 \node[attribute] (lname) [above right of = name] {Last Name} edge (name);
13 \node[multi attribute] (mname) [above of = name] {Middle Name} edge (name);
14 \node[multi attribute] (phone) [right =2em of entity] {Phone} edge (entity);
15 \node[attribute] (address) [below =1em of entity] {Location} edge (entity);
16 \node[attribute] (street) [below right of=address] {Room \#} edge (address);
17 \node[attribute] (city) [below left of=address] {Building} edge (address);
18 \node[derived attribute] (age) [above right of=entity] {Tenured} edge (entity);
19
20 \end{tikzpicture}
21
22 \end{document}
File notes/svg/er/Naming.tex deleted (index 1437e16..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=7em]
7 \node[entity] (entity) {ENTITY TYPE NAME};
8 \node[attribute] (pid) [left = 2em of entity] {\key{Key}} edge (entity);
9 \node[attribute] (name) [above left of=entity] {Atomic} edge (entity);
10 \node[multi attribute] (phone) [right =2em of entity] {Multi-Valued} edge (entity);
11 \node[attribute] (address) [below =1em of entity] {Composite} edge (entity);
12 \node[attribute] (street) [below right of=address] {Attribute $n$} edge (address);
13 \node[attribute] (city) [below left of=address] {Attribute $1$} edge (address);
14 \node[derived attribute] (age) [above right of=entity] {Derived} edge (entity);
15 \node (dots) [right = 0.4em of city] {…};
16 \end{tikzpicture}
17
18 \end{document}
File notes/svg/er/Rel_Instance.tex deleted (index 348d484..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=2em]
7 \draw [fill= gray!20] (0,-1) ellipse (1cm and 2cm) node[above=2]{Entity Set 1};
8 \draw [fill= blue!20] (2.75, -1) ellipse (1cm and 2cm) node[above=2]{Relationship Set 1};
9 \draw [fill= green!20] (5.5, -1) ellipse (1cm and 2cm) node[above=2]{Entity Set 2};
10 %
11 \node (e1) {\(e_1\)};
12 \node (e2) [below of = e1] {\(e_2\)};
13 \node (dots) [below of = e2] {\(\vdots\)};
14 \node (en) [below of = dots] {\(e_n\)};
15 %
16 \node (c1) [right = 5 of e1]{\(c_1\)};
17 \node (c2) [below of = c1]{\(c_1\)};
18 \node (cdots) [below of = c2] {\(\vdots\)};
19 \node (cp) [below of = cdots] {\(c_p\)};
20 %
21 \node (r1) [right = 2.25 of e2] {\(r_1\)};
22 \draw (r1) to (e1);
23 \draw (r1) to (c2);
24 %
25 \node (r2) [below of = r1] {\(r_2\)};
26 \draw (r2) to (e2);
27 \draw (r2) to (cp);
28 \end{tikzpicture}
29
30 \end{document}
File notes/svg/er/Role_Name1.tex deleted (index 9c39784..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=5em]
7 \node [entity] (company) {COMPANY};
8 \node [relationship] (employs) [right=of company] {EMPLOYS} edge node[above]{Employer} (company);
9 \node [entity] (person) [right = of employs] {PERSON} edge node[above]{Employee} (employs);
10 \end{tikzpicture}
11
12 \end{document}
File notes/svg/er/Role_Name2.tex deleted (index b8a1710..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=5em]
7 \node [entity] (person) {PERSON};
8 \node [relationship] (hosts) [above=of person] {HOSTS};
9 \draw (hosts.east) -- node[right]{Guest} (person);
10 \draw (hosts.west) -- node[left]{Host} (person);
11 \end{tikzpicture}
12
13 \end{document}
File notes/svg/er/Role_Name3.tex deleted (index 1e0e6e1..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \begin{tikzpicture}[node distance=5em]
7 \node [entity] (professor) {PROFESSOR};
8 \node [relationship] (mentors) [above=of professor] {MENTORS};
9 \draw (mentors.east) -- node[right]{Mentor} (professor);
10 \draw (mentors.west) -- node[left]{Mentee} (professor);
11 \end{tikzpicture}
12
13 \end{document}
File notes/svg/er/template.def deleted (index e23f41a..0000000)
1 \renewcommand\familydefault{\sfdefault} % Default family: serif
2 %\usepackage[usenames,dvipsnames]{xcolor}
3 \usepackage[x11names]{xcolor}
4 \usepackage{tikz}
5 \usepackage{soul}
6 \usetikzlibrary{arrows,fit,positioning,shapes,calc}
7
8 %\definecolor{WIRE}{HTML}{002FA7} % Klein Blue
9 \usepackage[normalem]{ulem}
10
11 \tikzstyle{every entity} = []
12 \tikzstyle{every weak entity} = []
13 \tikzstyle{every attribute} = []
14 \tikzstyle{every relationship} = []
15 \tikzstyle{every link} = []
16 \tikzstyle{every isa} = []
17
18 \tikzstyle{link} = [>=triangle 60, draw, thick, every link]
19
20 \tikzstyle{total} = [link, double, double distance=3pt]
21
22 \tikzstyle{entity} = [rectangle, draw, black, very thick,
23 minimum width=6em, minimum height=3em,
24 every entity]
25
26 \tikzstyle{weak entity} = [entity, double, double distance=2pt,
27 every weak entity]
28
29 \tikzstyle{attribute} = [ellipse, draw, black, very thick,
30 minimum width=5em, minimum height=2em,
31 every attribute]
32
33 %\tikzstyle{key attribute} = [attribute, font=\bfseries]
34
35 \tikzstyle{multi attribute} = [attribute, double, double distance=2pt]
36
37 \tikzstyle{derived attribute} = [attribute, dashed]
38
39 %\tikzstyle{discriminator} = [attribute, font=\itshape]
40
41 \tikzstyle{relationship} = [diamond, draw, black, very thick,
42 minimum width=2em, aspect=1,
43 every relationship]
44
45 \tikzstyle{ident relationship} = [relationship, double, double distance=2pt]
46
47 \tikzstyle{isa} = [isosceles triangle, isosceles triangle apex angle=60,
48 shape border rotate=-90,
49 draw, black, very thick, minimum size=3em,
50 every isa]
51
52 % for text un key attributes
53 \newcommand{\key}[1]{\underline{#1}}
54 \newcommand{\pkey}[1]{\dashuline{#1}}
55
56 % for text in discriminator attributes
57 \def\discriminator{\bgroup
58 \ifdim\ULdepth=\maxdimen % Set depth based on font, if not set already
59 \settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi
60 \markoverwith{\kern.15em
61 \vtop{\kern\ULdepth \hrule width .3em}%
62 \kern.15em}\ULon}
63
64 %%
65
66
67 \definecolor{MediumPurple1}{rgb}{0.58, 0.44, 0.86}
68 \definecolor{Chartreuse2}{rgb}{0.5, 1.0, 0.0}
69 \tikzset{every entity/.style={draw=orange, fill=orange!20}}
70 \tikzset{every attribute/.style={draw=MediumPurple1, fill=MediumPurple1!20}}
71 \tikzset{every relationship/.style={draw=Chartreuse2, fill=Chartreuse2!20}}
72
73 %% Variable for participation constraint
74 \newcommand{\cM}{\mathrm{M}}
75 \newcommand{\cN}{\mathrm{N}}
76 \newcommand{\cO}{\mathrm{O}}
77 \newcommand{\cP}{\mathrm{P}}
78
79 \begin{document}
File notes/svg/rel_mod/ADDRESS.tex deleted (index 271b4dd..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 % NAME(FName, LName, Id(PK))
7 % ADDRESS(StreetName (PK), Number (PK), Habitants (FK referencing NAME.Id))
8
9 \Frame(0,0){1}[NAME]{
10 FName/A,
11 LName/A,
12 Id/PK};
13
14 \Frame(5, 0){2}[ADDRESS]{
15 StreetName/PK,
16 Number/PK,
17 Habitants/A};
18
19 \draw[FK] % From Habitants2 to Id1
20 (Id1)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter)
21 -- (Habitants2 |- inter) --++(0,0.6);
22 \end{tikzpicture}
23 \end{document}
File notes/svg/rel_mod/BOOK_Exo.tex deleted (index c77d14a..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 % AUTHOR(Ref, Name, Address)
7 % BOOK(ISSN, AuthorRef, Title)
8 % GAINED-AWARD(Ref, Name, BookISSN, Year)
9
10 \Frame(0,0){1}[AUTHOR]{
11 Ref/A,
12 Name/A,
13 Address/A};
14
15 \Frame(0,-2.5){2}[BOOK]{
16 ISSN/A,
17 AuthorRef/A,
18 Title/A};
19
20 \Frame(0,-5){3}[GAINED-AWARD]{
21 Ref/A,
22 Name/A,
23 BookISSN/A,
24 Year/A};
25 \end{tikzpicture}
26 \end{document}
File notes/svg/rel_mod/BOOK_Sol.tex deleted (index 1af159d..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 % AUTHOR(Ref (PK), Name, Address)
7 % BOOK(ISSN (PK), AuthorRef (FK to AUTHOR.REF), Title)
8 % GAINED-AWARD(Ref (PK), Name, BookISSN (FK to BOOK.ISSN), Year)
9
10 \Frame(0,0){1}[AUTHOR]{
11 Ref/PK,
12 Name/A,
13 Address/A};
14
15 \Frame(0,-2.5){2}[BOOK]{
16 ISSN/PK,
17 AuthorRef/A,
18 Title/A};
19
20 \Frame(0,-5){3}[GAINED-AWARD]{
21 Ref/PK,
22 Name/A,
23 BookISSN/A,
24 Year/A};
25
26 \draw[FK] % From AuthorRef2 to Ref1
27 (Ref1)++(0.1,0) -- ++(0,-.55) -- ++(4.5,0) coordinate (inter)
28 -- (AuthorRef2 -| inter) -- ++(0,-0.4) coordinate (inter)
29 -- (AuthorRef2 |- inter) --++(0,0.5);
30
31 \draw[FK] % From BookISSN3 to ISSN2
32 (ISSN2)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter)
33 -- (BookISSN3 -| inter) -- ++(0,-0.4) coordinate (inter)
34 -- (BookISSN3 |- inter) --++(0,0.5);
35
36 \end{tikzpicture}
37 \end{document}
File notes/svg/rel_mod/CAR.tex deleted (index 7ada079..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 % CAR(VIN (PK), Make, Model, Year)
7 % DRIVER(State (PK), Licence-number (PK), Name, Address)
8 % INSURANCE(Policy-Number (PK), Insured-Car (FK to CAR.VIN), Insured-Driver-State (FK to DRIVER.State),
9 % Insured-Driver-Num (FK to DRIVER.Licence-number), Rate)
10 % PRICE(Stock-number (PK), Car-Vin (FK to CAR.VIN), Price, Margin)
11
12 \Frame(0,0){1}[CAR]{
13 VIN/PK,
14 Make/A,
15 Model/A,
16 Year/A};
17
18 \Frame(0,-2.5){2}[DRIVER]{
19 State/PK,
20 Licence-Num/PK,
21 Name/A,
22 Address/A};
23
24 \Frame(0,-5){3}[INSURANCE]{
25 Policy-Num/PK,
26 Insured-Car/A,
27 Insured-Driver-State/A,
28 Insured-Driver-Licence-Num/A,
29 Rate/A};
30
31 \Frame(0,-7.5){4}[PRICE]{
32 Car-VIN/A,
33 Price/A,
34 Margin/A,
35 Stock-Num/PK};
36
37
38 \draw[FK] % From Insured-Car3 to VIN1
39 (VIN1)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter)
40 -- (Insured-Car3 -| inter) -- ++(0,-0.4) coordinate (inter)
41 -- (Insured-Car3 |- inter) --++(0,0.4);
42
43 \draw[FK] % From Car-VIN4 to VIN1
44 (VIN1)++(-0.1,0) -- ++(0,-.45) -- ++(-1.1,0) coordinate (inter)
45 -- (Car-VIN4 -| inter) -- ++(0,-0.4) coordinate (inter)
46 -- (Car-VIN4 |- inter) --++(0,0.5);
47
48 \draw[FK] % From Insured-Driver-State3 to State2
49 (State2) -- ++(0,-.7) coordinate (inter) -- (Insured-Driver-State3 |- inter) --++(0,-1.1);
50
51 \draw[FK] % From Insured-Driver-Licence-Num3 to Licence-Num2
52 (Licence-Num2) -- ++(0,-.5) coordinate (inter) -- (Insured-Driver-Licence-Num3 |- inter) --++(0,-1.3);
53
54 \end{tikzpicture}
55 \end{document}
File notes/svg/rel_mod/CINEMA.tex deleted (index 53d2e04..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 %STAR(Id (PK), Name, BirthDate)
7 %MOVIE(Id (PK), Title, Year, Length, Genre)
8 %FEATURE-IN(StarId (PK, FK to STAR.Id), MovieId (PK, FK to MOVIE.Id))
9 %THEATER(Id (PK), Name, Address)
10 %AUDITORIUM(Id (PK), Capacity, Theater (FK to THEATER.Id))
11 %SHOWTIME(Id (PK), MovieId (FK to MOVIE.Id), AuditoriumId (FK to AUDITORIUM.Id), StartTime)
12 %TICKETS(Id (PK), ShowTimeId (FK to SHOWTIME.Id), Price)
13
14 \Frame(0,0){1}[STAR]{
15 Id/PK,
16 Name/A,
17 BirthDate/A};
18
19 \Frame(0,-2.5){2}[MOVIE]{
20 Id/PK,
21 Title/A,
22 Year/A,
23 Length/A,
24 Genre/A};
25
26 \Frame(0,-5){3}[FEATURE-IN]{
27 StarId/PK,
28 MovieId/PK};
29
30 \Frame(8,0){4}[THEATER]{
31 Id/PK,
32 Name/A,
33 Address/A};
34
35 \Frame(8,-2.5){5}[AUDITORIUM]{
36 Id/PK,
37 Capacity/A,
38 Theater/A};
39
40 \Frame(8,-5){6}[SHOWTIME]{
41 Id/PK,
42 MovieId/A,
43 AuditoriumId/A,
44 StartTime/A};
45
46
47 \Frame(8,-7.5){7}[TICKET]{
48 Id/PK,
49 ShowTimeId/A,
50 Price/A};
51
52 \draw[FK] % From StarId3 to Id1
53 (Id1)++(0.1,0) -- ++(0,-.55) -- ++(-1.1,0) coordinate (inter)
54 -- (StarId3 -| inter) -- ++(0,-0.4) coordinate (inter)
55 -- (StarId3 |- inter) --++(0, 0.4);
56
57 \draw[FK] % From MovieId3 to Id2
58 (Id2)++(-0.1,0) -- ++(0,-.75) -- ++(3,0) coordinate (inter)
59 -- (MovieId3 -| inter) -- ++(0,-0.4) coordinate (inter)
60 -- (MovieId3 |- inter) --++(0,0.4);
61
62 \draw[FK] % From Theater5 to Id4
63 (Id4)++(0.1,0) -- ++(0,-.55) -- ++(3.5,0) coordinate (inter)
64 -- (Theater5 -| inter) -- ++(0,-0.2) coordinate (inter)
65 -- (Theater5 |- inter) --++(0,0.3);
66
67 \draw[FK] % From MovieId6 to Id2
68 (Id2)++(0.1,0) -- ++(0,-.55) -- ++(3.2,0) coordinate (inter)
69 -- (MovieId6 -| inter) -- ++(0,-0.4) coordinate (inter)
70 -- (MovieId6 |- inter) --++(0,0.5);
71
72 \draw[FK] % From AuditoriumId6 to Id5
73 (Id5)++(0.1,0) -- ++(0,-.55) -- ++(6,0) coordinate (inter)
74 -- (AuditoriumId6 -| inter) -- ++(0,-0.2) coordinate (inter)
75 -- (AuditoriumId6 |- inter) --++(0,0.3);
76
77
78 \draw[FK] % From ShowTimeId7 to Id6
79 (Id6)++(0.1,0) -- ++(0,-.8) -- ++(-.7,0) coordinate (inter)
80 -- (ShowTimeId7 -| inter) -- ++(0,-0.2) coordinate (inter)
81 -- (ShowTimeId7 |- inter) --++(0,0.3);
82
83 \end{tikzpicture}
84 \end{document}
File notes/svg/rel_mod/EMPLOYEE.tex deleted (index d5b4e45..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 \Frame(0,0){1}[PKLOYEE]{
7 Fname/A,
8 Minit/A,
9 Lname/A,
10 Ssn/PK,
11 Bdate/A,
12 Address/A,
13 Sex/A,
14 Salary/A,
15 Super-Ssn/A,
16 Dno/A};
17
18 \Frame(0,-2.5){2}[DEPARTMENT]{
19 Dname/A,
20 Dnumber/PK,
21 Mgr-ssn/A,
22 Mgr-Start-date/A};
23
24 \Frame(0,-5){3}[DEPT-LOCATIONS]{
25 Dnumber/PK,
26 Dlocations/PK};
27
28 \Frame(0,-7.5){4}[PROJECT]{
29 Pname/A,
30 Pnumber/PK,
31 Plocation/A,
32 Dnum/A};
33
34 \Frame(0,-10){5}[WORKS ON]{
35 Essn/PK,
36 Pno/PK,
37 Hours/A};
38
39 \Frame(0,-12.5){6}[DEPENDENT]{
40 Essn/PK,
41 Dependent-Name/A,
42 Sex/A,
43 Bdate/A,
44 Relationship/A};
45
46 \draw[FK] % From Essn6 to Ssn1
47 (Ssn1)++(0.1,0) -- ++(0,-.55) -- ++(4.5,0) coordinate (inter) %inter is the name of coordinate register
48 -- (Essn6 -| inter) -- ++(0,-0.4) coordinate (inter) % to calculate intersections.
49 -- (Essn6 |- inter) --++(0,0.4); %
50 %Essn -- Ssn id 5
51 \draw[FK]
52 (Ssn1)++(-0.1,0) -- ++(0,-.7) -- ++(4.55,0) coordinate (inter) %some shift using (Ssn1)++(shiftx,shifty)
53 -- (Essn5 -| inter) -- ++(0,-0.4) coordinate (inter)
54 -- (Essn5 |- inter) --++(0,0.4); %
55 \draw[FK]
56 (Pnumber4) -- ++(0,-.5) -- ++(1,0) coordinate (inter)
57 -- (Pno5 -| inter) -- ++(0,-0.2) coordinate (inter)
58 -- (Pno5 |- inter) --++(0,0.2); %
59
60 \draw[FK]
61 (Dnumber2) -- ++(0,-.75) -- ++(4,0) coordinate (inter)
62 -- (Dnum4 -| inter) -- ++(0,-0.2) coordinate (inter)
63 -- (Dnum4|- inter) --++(0,0.2); %
64
65 \draw[FK]
66 (Dnumber2)++(-.2,0) -- ++(0,-.9) -- ++(1.75,0) coordinate (inter)
67 -- (Dnumber3 -| inter) -- ++(0,-0.2) coordinate (inter)
68 -- (Dnumber3 |- inter) --++(0,0.2); %
69
70 \draw[FK]
71 (Ssn1)++(-0.3,0) -- ++(0,-0.85) -- ++(3.5,0) coordinate (inter)
72 -- (Mgr-ssn2 -| inter) -- ++(0,-0.2) coordinate (inter)
73 -- (Mgr-ssn2 |- inter) --++(0,0.3); %
74
75 \draw[FK]
76 (Dnumber2)++(0.2,0) -- ++(0,-.6) coordinate (inter) -- (Dno1 |- inter) -- (Dno1); %
77
78 \draw[FK]
79 (Ssn1)++(0.3,0) -- ++(0,-.4) coordinate (inter) -- (Super-Ssn1 |- inter) -- (Super-Ssn1); %
80
81 \end{tikzpicture}
82 \end{document}
File notes/svg/rel_mod/PROF_DEPARTMENT.tex deleted (index e8cf715..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 % PROF(Login (PK), Name, Department (FK to DEPARTMENT.Code))
7 % DEPARTMENT(Code (PK), Name, Head (FK to PROF.Login))
8
9 \Frame(0,0){1}[PROF]{
10 Login/PK,
11 Name/A,
12 Department/A};
13
14 \Frame(5, 0){2}[DEPARTMENT]{
15 Code/PK,
16 Name/A,
17 Head/A};
18
19 \draw[FK] % From Department1 to Code2
20 (Code2)++(0.1,0) -- ++(0,-.5) -- ++(-1,0) coordinate (inter)
21 -- (Department1 |- inter) --++(0,0.6);
22
23 \draw[FK] % From Head2 to Login1
24 (Login1)++(0.1,0) -- ++(0,-1) coordinate (inter)
25 -- (Head2 |- inter) --++(0, 1.1);
26
27 \end{tikzpicture}
28 \end{document}
File notes/svg/rel_mod/RPG.tex deleted (index 6f261c8..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 % CLASS(Name (PK), Bonus, Element)
7 % CHARACTER(Name (PK), Class (FK to CLASS.Name), XP, LVL)
8 % WEAPON(Name (PK), Bonus, Possessed-By (FK to CHARACTER.Name))
9 % QUEST(Name (PK), XP)
10 % COMPLETED-BY(Character (PK, FK to CHARACTER.Name), Quest (PK, FK to QUEST.Name))
11 % SPECIAL-ITEM(Name (P), Quest (FK to QUEST.Name))
12
13 \Frame(0,0){1}[CLASS]{
14 Name/PK,
15 Bonus/A,
16 Element/A};
17
18 \Frame(0,-2.5){2}[CHARACTER]{
19 Name/PK,
20 Class/A,
21 XP/A,
22 Lvl/A};
23
24 \Frame(0,-5){3}[WEAPON]{
25 Name/PK,
26 Bonus/A,
27 Possessed-By/A};
28
29 \Frame(8,0){4}[QUEST]{
30 Name/PK,
31 Xp/A};
32
33 \Frame(8,-2.5){5}[COMPLETED-BY]{
34 Character/PK,
35 Quest/PK};
36
37 \Frame(8,-5){6}[SPECIAL-ITEM]{
38 Name/PK,
39 Quest/A};
40
41
42 \draw[FK] % From Class2 to Name1
43 (Name1)++(0.1,0) -- ++(0,-.55) -- ++(4,0) coordinate (inter)
44
45
46 \draw[FK] % From Possessed-By3 to Name2
47 (Name2)++(-0.1,0) -- ++(0,-.75) -- ++(4.2,0) coordinate (inter)
48
49
50 \draw[FK] % From Character5 to Name2
51 (Name2)++(0.1,0) -- ++(0,-.55) -- ++(3.5,0) coordinate (inter)
52
53
54 \draw[FK] % From Quest5 to Name4
55 (Name4)++(-0.1,0) -- ++(0,-.7) -- ++(2.6,0) coordinate (inter)
56
57 \draw[FK] % From Quest6 to Name4
58 (Name4)++(0.1,0) -- ++(0,-.55) -- ++(2.6,0) coordinate (inter)
59
60 \end{tikzpicture}
61 \end{document}
File notes/svg/rel_mod/TRAIN_Exo.tex deleted (index 62fa1f7..0000000)
1 % !TeX document-id = {9fd243f0-f0ae-45f7-9f88-fa9555c363d3}
2 % !TeX TXS-program:compile = txs:///xelatex/[--shell-escape]
3 \documentclass[convert={outfile=\jobname.svg},border=20pt]{standalone}
4 \input{template.def}
5
6 % TRAIN(Ref (PK), Model, Year)
7 % CONDUCTOR(CompanyID (PK), Name, ExperienceLevel)
8 % ASSIGNED-TO(TrainRef (PK, FK to TRAIN.REF), ConductorID (PK, FK to CONDUCTOR.CompanyID), Date (PK))
9
10 \Frame(0,0){1}[TRAIN]{
11 Ref/PK,
12 Model/A,
13 Year/A};
14
15 \Frame(0,-2.5){2}[CONDUCTOR]{
16 CompanyID/PK,
17 Name/A,
18 ExperienceLevel/A};
19
20 \Frame(0,-5){3}[ASSIGNED-TO]{
21 TrainRef/PK,
22 ConductorID/PK,
23 Date/PK};
24
25 \draw[FK] % From TrainRef3 to Ref1
26 (Ref1)++(0.1,0) -- ++(0,-.55) -- ++(-1,0) coordinate (inter)
27 -- (TrainRef3 -| inter) -- ++(0,-0.4) coordinate (inter)
28 -- (TrainRef3 |- inter) --++(0,0.4);
29
30
31 \draw[FK] % From ConductorID3 to CompanyID2
32 (CompanyID2)++(0.1,0) -- ++(0,-.55) -- ++(4,0) coordinate (inter)
33 -- (ConductorID3 -| inter) -- ++(0,-0.4) coordinate (inter)
34 -- (ConductorID3 |- inter) --++(0,0.4);
35
36 \end{tikzpicture}
37 \end{document}
File notes/svg/rel_mod/template.def deleted (index f4ca1d8..0000000)
1 \renewcommand\familydefault{\sfdefault} % Default family: serif
2 \usepackage[usenames,dvipsnames]{xcolor}
3 \usepackage{tikz}
4 \usepackage{soul}
5 \usetikzlibrary{calc}
6 \usetikzlibrary{arrows, decorations.markings,positioning,backgrounds,shapes}
7 \definecolor{WIRE}{HTML}{002FA7} % Klein Blue
8 \usepackage{ulem}
9 \renewcommand{\ULdepth}{3pt}
10
11 \newcommand\whiteuline{\bgroup\markoverwith
12 {\textcolor{white}{\rule[-0.5ex]{2pt}{0.4pt}}}\ULon}
13
14 \tikzset{FK/.style={thick,<-,thick,>=latex}}
15
16 \newbox\ubox
17 \begin{document}
18 \begin{tikzpicture}[
19 PK/.style={% Style for empatized boxes
20 rectangle, line width =1pt,
21 anchor=west,
22 underline, % new property
23 align=center,
24 text=white,
25 minimum height=.8cm,
26 text height=1.5ex,
27 text depth=.25ex,
28 fill=WIRE!50,
29 draw=black,
30 },
31 A/.style={% Style for normal boxes.
32 rectangle,
33 line width =1pt,
34 anchor=west,
35 align=left,
36 minimum height=.6cm,
37 text height=1.5ex,
38 text depth=.25ex,
39 fill=WIRE!10,
40 draw=black,
41 inner ysep=5pt
42 },
43 underline/.append style={% define new style property
44 execute at begin node={%
45 \setbox\ubox=\hbox\bgroup
46 },
47 execute at end node={%
48 \egroup\whiteuline{\box\ubox}%
49 }
50 },
51 ] % Uff that is all the configuration for tickzpicture xD
52
53 % Define an brute force objet "Frame"
54 % Variables 1:Position, 2: Identifier, 3: Title of frame 4: Subframe/Boxtype
55 \def\Frame(#1)#2[#3]#4{%
56 \begin{scope}[shift={(#1)}]
57 \node[font=\bf, anchor=west] (Title) at (-0.2,0.7) {#3};
58 \edef\k{0}% Variable for box positión
59 \edef\x{0}% Variable for named coordinate centering - below box
60 \foreach \id/\style in {#4} {%enter sub frame data Name/Boxtype ,Name2/Boxtype | An space before Boxtype is needed
61 \node[\style] (h) at (\k pt,0) {\id}; % % Draw a node depending on the variables.
62 \pgfmathparse{\k+0.5*width{"\id"}+3.4pt} % Uses the textwidth to calculate named coordinate
63 \xdef\x{\pgfmathresult} % The resul is saved in the variable \x
64 \draw (\x pt,-0.4) coordinate (\id#2); %Create a named coordinate concatenated: "sub frame data Name"+"identifier"
65 \pgfmathparse{\k+width{"\id"}+6.8pt}% Calculate positión for each subframe box.
66 \xdef\k{\pgfmathresult}% Save the value to be added to the next iteration value.
67 }
68 \end{scope}
69 }% disadvantages: Is not posible to use Frame data Name like: Name_another_desc instead I use Name-another-desc
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/caubert/CSCI_3410

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/caubert/CSCI_3410

Clone this repository using git:
git clone git://git.rocketgit.com/user/caubert/CSCI_3410

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main