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