List of commits:
Subject Hash Author Date (UTC)
Finishing homework #5. e322bc945941083b0649557d9ad6bdbb8308c10c aubert@math.cnrs.fr 2019-03-04 15:10:15
Preparing homework 5 2b9ba64d1d36ae9f413929947cac5e6cddceb3dc aubert@math.cnrs.fr 2019-03-01 20:06:12
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
Commit e322bc945941083b0649557d9ad6bdbb8308c10c - Finishing homework #5.
Author: aubert@math.cnrs.fr
Author date (UTC): 2019-03-04 15:10
Committer name: aubert@math.cnrs.fr
Committer date (UTC): 2019-03-04 15:10
Parent(s): 2b9ba64d1d36ae9f413929947cac5e6cddceb3dc
Signing key:
Tree: 568c2be2f2937dcd2abd9595156e9a111ee6fd70
File Lines added Lines deleted
notes/fig/er/Example_of_Derived.tex 11 0
notes/fig/rel_mod/PERSON.tex 20 0
notes/lectures_notes.md 24 13
File notes/fig/er/Example_of_Derived.tex added (mode: 100644) (index 0000000..934287d)
1 \documentclass[border=20pt]{standalone}
2 \input{template.def}
3
4 \begin{tikzpicture}[node distance=7em]
5 \node[entity] (phone) {PHONE};
6 \node[attribute] [left of=phone] {Price} edge (phone);
7 \node[attribute] [above of=phone] {Weight in oz} edge (phone);
8 \node[derived attribute] [above right of=phone] {Weight in g} edge (phone);
9 \end{tikzpicture}
10
11 \end{document}
File notes/fig/rel_mod/PERSON.tex added (mode: 100644) (index 0000000..1528191)
1 \documentclass[border=20pt]{standalone}
2 \input{template.def}
3
4 % PERSON(SSN (PK), DOB, ADDRESS (FK to PLACE.Address)
5 % ADDRESS(Address (PK), Rooms)
6
7 \Frame(0,0){1}[NAME]{
8 SSN/PK,
9 DOB/A,
10 StaysAt/A};
11
12 \Frame(5, 0){2}[ADDRESS]{
13 Address/PK,
14 Rooms/A};
15
16 \draw[FK] % From Habitants2 to Id1
17 (Address2)++(0,0) -- ++(0,-.5) -- ++(-0,0) coordinate (inter)
18 -- (StaysAt1 |- inter) --++(0,0.6);
19 \end{tikzpicture}
20 \end{document}
File notes/lectures_notes.md changed (mode: 100644) (index 55fe01b..f6f8360)
... ... Exercise +.#
4428 4428
4429 4429 Exercise +.# Exercise +.#
4430 4430
4431 : Draw an ER diagram with a single entity type, with two stored attributes and one derived attribute. In your answer, it should be clear that the value for the derived attribute will always be obtained from the value(s) for the other attribute(s).
4431 : Draw an ER diagram with a single entity type, with two stored attributes and one derived attribute. In your answer, it should be clear that the value for the derived attribute can always be obtained from the value(s) for the other attribute(s).
4432 4432
4433 4433 Exercise +.# Exercise +.#
4434 4434
4435 4435 : Draw an ER diagram expressing the total participation of an entity type "BURGER" in a binary relation "CONTAINS" between "BURGER" and "INGREDIENT". : Draw an ER diagram expressing the total participation of an entity type "BURGER" in a binary relation "CONTAINS" between "BURGER" and "INGREDIENT".
4436 4436 What would be the ratio of such a relation? What would be the ratio of such a relation?
4437 4437
4438 Exercise +.#
4439 ~
4440 Convert the following ER diagram into a relational model:
4441
4442 ![](fig/er/Stays_At)
4443
4444 4438 Exercise +.# Exercise +.#
4445 4439
4446 4440 : What is the difference between an entity type and a weak entity type? : What is the difference between an entity type and a weak entity type?
 
... ... Exercise +.#
4453 4447
4454 4448 : Why do weak entity type have a total participation constraint? : Why do weak entity type have a total participation constraint?
4455 4449
4450 Exercise +.#
4451 ~
4452 Convert the following ER diagram into a relational model:
4453
4454 ![](fig/er/Stays_At)
4455
4456 4456 Exercise +.# Exercise +.#
4457 4457
4458 4458 : What is insertion anomaly? Give an example. : What is insertion anomaly? Give an example.
 
... ... Solution +.#
4695 4695
4696 4696 Solution +.# Solution +.#
4697 4697
4698 : ![](fig/er/Person)
4699
4698 : ![](fig/er/Example_of_Derived)
4700 4699
4701 4700 Solution +.# Solution +.#
4702 4701
 
... ... Solution +.#
4704 4703
4705 4704 Solution +.# Solution +.#
4706 4705
4707 : To be written.
4708
4709 Solution +.#
4710
4711 4706 : 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. : 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.
4712 4707
4713 4708 Solution +.# Solution +.#
 
... ... Solution +.#
4720 4715
4721 4716 Solution +.# Solution +.#
4722 4717
4718 ~
4719
4720 A possible option is:
4721
4722 ![
4723 PERSON(SSN (PK), DOB, Stays_At (FK to PLACE.Address)
4724 ADDRESS(Address (PK), Rooms)
4725 ](fig/rel_mod/PERSON)
4726 \
4727
4728 Note that "Stays_At" could also be a separate relation, with two attributes, "Address" and "Person", linked to respectively PLACE.Address and PERSON.SSN, and both being the primary key of the relation.
4729
4730 Solution +.#
4731
4723 4732 : When you have to invent a primary key or add a lot of `NULL` value to be able to add a tuple. I want to add a room in my DB, but the only place where rooms are listed are as an attribute on a Instructor table, so I have to "fake" an instructor to add a room. : When you have to invent a primary key or add a lot of `NULL` value to be able to add a tuple. I want to add a room in my DB, but the only place where rooms are listed are as an attribute on a Instructor table, so I have to "fake" an instructor to add a room.
4724 4733
4725 4734 Solution +.# Solution +.#
4726 4735
4727 4736 : A delete anomaly exists when certain attributes are lost because of the deletion of other attributes. It is not desirable, since it can lead to the loss of information. : A delete anomaly exists when certain attributes are lost because of the deletion of other attributes. It is not desirable, since it can lead to the loss of information.
4728 4737
4738
4729 4739 Solution +.# Solution +.#
4730 4740
4731 4741 : Because they waste space, and because they are ambiguous (N/A, or unknown, or not communicated?). No, it is necessary sometimes. : Because they waste space, and because they are ambiguous (N/A, or unknown, or not communicated?). No, it is necessary sometimes.
 
... ... Solution to [%D %n (%T)](#problem:consultation)
5275 5285
5276 5286 We could further infer that the treatment for a given diagnosis is functionally dependant, but we should be sure to allow the doctor to have some flexibility when prescribing cures. We could further infer that the treatment for a given diagnosis is functionally dependant, but we should be sure to allow the doctor to have some flexibility when prescribing cures.
5277 5287
5288 ---
5278 5289
5279 5290 Solution to [%D %n (%T)](#problem:book) Solution to [%D %n (%T)](#problem:book)
5280 5291 ~ ~
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