List of commits:
Subject Hash Author Date (UTC)
Some fixes and added quiz #3. d73c356f1bec9679f7123bc508c1863f8de40aef aubert@math.cnrs.fr 2019-02-28 20:34:04
Working on solutions for problems in Chapter 3. 0da378f97cea97fa2b3614f1b611a3b5bdf42632 aubert@math.cnrs.fr 2019-02-26 19:56:23
Forgot one exercise in exam. 611bbe4cc68f802bfffd7bdfc70c3433a70eceb5 aubert@math.cnrs.fr 2019-02-22 20:39:07
Quick fix c22751b88c377a40dd2c037a706409aa29ef3ce2 aubert@math.cnrs.fr 2019-02-22 20:37:21
Various editing, fixing some of the solutions in Chapter 3 and some of the exercises in Chapter 4. 1e1d8dd576329b20aa3b7f9344aaecb9d11fc6f4 aubert@math.cnrs.fr 2019-02-22 20:22:09
Added the rest of the first exam for Fall 2019. 0d5a839282b1ae6e6c07e7b12a74ff2f0f2f3b86 aubert@math.cnrs.fr 2019-02-22 20:03:02
Adding a problem and its solution, in the SQL chapter. d5bfcbb949a6acac68156a8b37d6f8d23375b1cb aubert@math.cnrs.fr 2019-02-19 19:53:27
Adding second quiz, and fixing some exercises and problems in Chapter 3. 062c9b46fad52848efbf61e08c91103c0bae4127 aubert@math.cnrs.fr 2019-02-06 20:04:16
Clarification on SQL constraints. 70e26a02aa344cc1bf009a089623be6baac79ba7 aubert@math.cnrs.fr 2019-01-29 22:46:26
Adding some minor SQL remarks + code for HW_FACULTY. 1d1b74302d29fb63c3c2bacca30533283f720997 aubert@math.cnrs.fr 2019-01-25 17:24:16
fixing small typo. 0feeb8df61e05d6d0990120628303cf31108f100 aubert@math.cnrs.fr 2019-01-22 18:23:34
Quick fix + adding macOS install instructions. ea3063e4e9225c8ce66838c8bfddb9a34aadacf8 aubert@math.cnrs.fr 2019-01-16 15:59:38
Fixing a few typos and adding a drawing. b335800d4129c8e29763a6c1d564243d485fa51b aubert@math.cnrs.fr 2019-01-15 19:03:38
Fixing first homework 3eeb05a78235274a330c780f4f26b5fed1a01aef aubert@math.cnrs.fr 2019-01-08 19:50:29
Added content of various exam, fixed intro, added references, solutions, fixed types. a8e9d2d4856133d68d882403cde42dfcc2f5cc69 aubert@math.cnrs.fr 2019-01-07 16:47:02
Cleaning files and makefile 7605a6530505ad69042413dd995d77f1814c2f30 au 2018-12-24 14:25:31
Fixed margin for PDF, added a couple of SVG images, fixed some problems, added some code. eb83d9f07d738df7ab2515b768d6165a3b7e5ca3 au 2018-12-24 02:28:36
Working on rel_mod for Prof_Department_Extended. 2b1eff83797fbda620189f014043d648c884e887 au 2018-12-23 22:38:07
Working on FD and various figures. 8fd7f8322e70ae252596aa9cb88918ac40d5aa84 au 2018-12-23 20:25:19
Added first drawing for fd. 2a0e4fc716d91c23c81346a0e3b568f7132284c9 au 2018-12-23 05:23:29
Commit d73c356f1bec9679f7123bc508c1863f8de40aef - Some fixes and added quiz #3.
Author: aubert@math.cnrs.fr
Author date (UTC): 2019-02-28 20:34
Committer name: aubert@math.cnrs.fr
Committer date (UTC): 2019-02-28 20:34
Parent(s): 0da378f97cea97fa2b3614f1b611a3b5bdf42632
Signing key:
Tree: 34242f5df5e6ce214d46b4bb0145e178554fc2e3
File Lines added Lines deleted
notes/fig/er/KeyOpensDoor.tex 10 0
notes/fig/er/Printer.tex 12 0
notes/fig/er/Produces.tex 11 0
notes/lectures_notes.md 45 8
File notes/fig/er/KeyOpensDoor.tex added (mode: 100644) (index 0000000..4403c1d)
1 \documentclass[border=20pt]{standalone}
2 \input{template.def}
3
4 \begin{tikzpicture}[node distance=5em]
5 \node [entity] (key) {KEY};
6 \node [relationship] (opens) [right=of key] {OPENS} edge[total] node[above]{$\cN$} (key);
7 \node [entity] (door) [right = of opens] {DOOR} edge node[above]{$1$} (opens);
8 \end{tikzpicture}
9
10 \end{document}
File notes/fig/er/Printer.tex added (mode: 100644) (index 0000000..7b799d9)
1 \documentclass[border=20pt]{standalone}
2 \input{template.def}
3
4 \begin{tikzpicture}[node distance=7em]
5 \node[entity] (printer) {PRINTER};
6 \node[attribute] (mid) [above left of=printer] {\key{Office}} edge (printer);
7 \node[attribute] (firmware) [above right of=printer] {Firmware} edge (printer);
8 \node[attribute] (carrier) [above right of=firmware] {Name} edge (firmware);
9 \node[attribute] (price) [above left of=firmware] {Version} edge (firmware);
10 \end{tikzpicture}
11
12 \end{document}
File notes/fig/er/Produces.tex added (mode: 100644) (index 0000000..05de23e)
1 \documentclass[border=20pt]{standalone}
2 \input{template.def}
3
4 \begin{tikzpicture}[node distance=5em]
5 \node [entity] (producer) {PRODUCER};
6 \node [relationship] (produces) [right=of producer] {PRODUCES} edge node[above]{$1$} (producer);
7 \node [entity] (movie) [right = of produces] {MOVIE} edge node[above]{$\cM$} (produces);
8 \node[attribute] (mid) [above of=movie] {Amount\_Given\_By\_Producer} edge (movie);
9 \end{tikzpicture}
10
11 \end{document}
File notes/lectures_notes.md changed (mode: 100644) (index 30bfe9d..5558261)
... ... Solution to [%D %n (%T)](#problem:repetition)
3389 3389 +-------+------+ +-------+------+
3390 3390 ~~~ ~~~
3391 3391
3392 This is an illustration of the fact that a table in sql is *not* a set, as opposed to a relation in the relation model.
3392 This is an illustration of the fact that a table in sql is *not* a set, as opposed to a relation in the relational model.
3393 3393
3394 3394 @problem:repetition -- Solution to Q. -.# @problem:repetition -- Solution to Q. -.#
3395 ~
3396
3397 The command
3395 ~ The command
3398 3396
3399 3397 ~~~{.sqlmysql} ~~~{.sqlmysql}
3400 3398 ALTER TABLE EXAMPLE ADD PRIMARY KEY (X); ALTER TABLE EXAMPLE ADD PRIMARY KEY (X);
 
... ... For binary relations, can be $1:1$, $N:1$, $M:N$ ($1$ is "at most", $M$, $N$, $O
3794 3792
3795 3793 We indicate the ratio on the edges: We indicate the ratio on the edges:
3796 3794
3797 ![](fig/er/Constraint1)
3795 ![](fig/er/Constraint2)
3798 3796
3799 3797 ##### Participation constraint ##### Participation constraint
3800 3798
 
... ... Example of Use Case
4339 4337
4340 4338 Exercise +.# Exercise +.#
4341 4339
4340 : Name the three high-level models we will be looking at in this class (expanding the acronyms).
4341
4342 Exercise +.#
4343
4342 4344 : What could be the decomposition of an attribute used to store an email address? When could that be useful? : What could be the decomposition of an attribute used to store an email address? When could that be useful?
4343 4345
4344 4346 Exercise +.# Exercise +.#
 
... ... Exercise +.#
4355 4357
4356 4358 Exercise +.# Exercise +.#
4357 4359
4358 : What is the difference between an entity type and a weak entity type?
4360 : Invent an entity type with at least one composite attribute and one atomic attribute, but no multi-valued attribute, identify a possible key attribute, and draw the entity type you obtained using the conventions we used in class.
4359 4361
4360 4362 Exercise +.# Exercise +.#
4361 4363
 
... ... Exercise +.#
4379 4381
4380 4382 Exercise +.# Exercise +.#
4381 4383
4384 : Suppose a "PRODUCES" relationship with an attribute "Amount" exists between a "PRODUCER" entity type and a "MOVIE" entity type, with ratio $1:M$.
4385 Migrate the "Amount" attribute to one of the entity and draw the resulting diagram.
4386
4387 Exercise +.#
4388
4389 : Express the constraints represented in the following diagram in plain English.
4390 ![](fig/er/KeyOpensDoor)
4391
4392 Exercise +.#
4393
4382 4394 : For the following binary relationships, suggest cardinality ratios based on the common-sense meaning of the entity types. : For the following binary relationships, suggest cardinality ratios based on the common-sense meaning of the entity types.
4383 4395
4384 4396 <!-- Bug with table --> <!-- Bug with table -->
 
... ... Exercise +.#
4415 4427
4416 4428 Exercise +.# Exercise +.#
4417 4429
4430 : What is the difference between an entity type and a weak entity type?
4431
4432 Exercise +.#
4433
4418 4434 : What is a partial key? : What is a partial key?
4419 4435
4420 4436 Exercise +.# Exercise +.#
 
... ... Exercise +.#
4583 4599
4584 4600 Solution +.# Solution +.#
4585 4601
4602 : **U**nified **M**odeling **L**anguage, **E**ntity **R**elationship and **E**nhanced **E**ntity–**R**elationship models.
4603
4604 Solution +.#
4605
4586 4606 : Name / extension. : Name / extension.
4587 4607 To have statistics about the extensions, to sort the username by length, etc. To have statistics about the extensions, to sort the username by length, etc.
4588 4608
 
... ... Solution +.#
4596 4616
4597 4617 Solution +.# Solution +.#
4598 4618
4599 : There can be more than one key in the ER model.
4619 : There can be more than one key in the ER model, but it has to be made of a single attribute, whereas a primary key can be made of multiple attributes.
4600 4620
4601 4621 Solution +.# Solution +.#
4602 4622
4603 : The weak entity type doesn't have a primary key.
4623 : ![](fig/er/Printer)
4604 4624
4605 4625 Solution +.# Solution +.#
4606 4626
 
... ... Solution +.#
4623 4643
4624 4644 : When the cardinality is $1:N$, $1:1$ or $N:1$. : When the cardinality is $1:N$, $1:1$ or $N:1$.
4625 4645
4646 Solution +.#
4647 ~
4648
4649 We could have the following:
4650
4651 ![](fig/er/Produces)
4652
4653
4654 Solution +.#
4655
4656 : A key opens only one door, and every key must open at least one door.
4657 A door can be opened by multiple key, and some doors may not be opened by keys (think of doors that cannot be locked).
4658
4626 4659 Solution +.# Solution +.#
4627 4660 ~ ~
4628 4661
 
... ... Solution +.#
4659 4692
4660 4693 Solution +.# Solution +.#
4661 4694
4695 : The weak entity type doesn't have a key attribute, it cannot be distinguised from the other weak entities based on a single attribute, for that we also need to know its relationship to some other entity type.
4696
4697 Solution +.#
4698
4662 4699 : For a weak entity attribute, it is the attribute that can uniquely identify weak entites that are related to the same owner entity. : For a weak entity attribute, it is the attribute that can uniquely identify weak entites that are related to the same owner entity.
4663 4700
4664 4701 Solution +.# Solution +.#
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