List of commits:
Subject Hash Author Date (UTC)
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
Cleaned latex code. 1cf04e85915d24fc0208b407eb0166803b2369cf au 2018-12-23 04:27:41
Working on drawing for functional dependencies. 7dc167021630c00be25881877c0921adbc87f482 au 2018-12-23 04:20:33
Working on style for functional dependencies graph. 029c32395ba1110ad2af980e248848e0877040d7 au 2018-12-23 00:17:54
Working on template for FD. 091bb061b6fea06f440e97a4c9ac0f69b4ea1392 au 2018-12-22 20:57:00
Started to work on Functional Dep. 2123fbafc3b8258184ad745d8f23521a3f477d0e au 2018-12-22 18:53:20
Fixing a couple of problem, adding some more correct figures. ef44b65f45fba2bd9a653b639287d872b9f7471d au 2018-12-22 04:27:34
Fixing two figures, and renaming them. 71f4ab9c4090e97da19089f2316e87a4ebe838d6 au 2018-12-22 02:37:15
Fixing some of the name of the problems + references. 67c6c669fbb952cdd92be94487f46774da086a59 au 2018-12-21 16:20:08
Exercises fix, naming problems. 2b00c9f2306dd4d05f6919b4c06bc61b5786917f au 2018-12-21 02:10:54
Fixing some exercises. d5053a4b04b16b1817f2e8edb67f9ca7a6c48eb9 au 2018-12-21 01:24:09
Started to externalize the code, fixed the makefile, added a style for HTML files, fixed a lot of solution / problem / exercise environment, cleaned some fig code cfc0c26c5fb9ea64dfd101b9a1a70bc34dfa7082 au 2018-12-20 07:19:10
Re-organization of the structure and of the makefile. d352a7419a507c83374d78c8723d3aaebbaf1e0d au 2018-12-19 02:36:38
Pushing to merge. 92a45b2d1f200221602d730030f87f26e65e335d au 2018-12-19 01:13:42
Commit 3eeb05a78235274a330c780f4f26b5fed1a01aef - Fixing first homework
Author: aubert@math.cnrs.fr
Author date (UTC): 2019-01-08 19:50
Committer name: aubert@math.cnrs.fr
Committer date (UTC): 2019-01-08 19:50
Parent(s): a8e9d2d4856133d68d882403cde42dfcc2f5cc69
Signer:
Signing key:
Signing status: N
Tree: b3e9b5a75ebfa433f5a424609027d94d2934b8a5
File Lines added Lines deleted
notes/lectures_notes.md 59 37
File notes/lectures_notes.md changed (mode: 100644) (index 043625d..56a1c9a)
... ... It's easier to move things around early in the conception.
297 297
298 298 ## Characteristics of the Database Approach ## Characteristics of the Database Approach
299 299
300 #. A database is more than just data: it also contains a complete description of the structure and constraints. ⇒ We have Data & Meta-data (or self-describing data).
300 #. A database is more than just data: it also contains a complete description of the structure and constraints. ⇒ We have Data & Meta-data (we can also have self-describing data, where meta-data and data are interleaved).
301 301 #. Data-abstraction: DBMS provides a conceptual representation, and hides implementation details. #. Data-abstraction: DBMS provides a conceptual representation, and hides implementation details.
302 302 #. Program-data independence: changing the database doesn't require to change the DBMS. Compare with changing a custom data-type in a program. #. Program-data independence: changing the database doesn't require to change the DBMS. Compare with changing a custom data-type in a program.
303 303 #. Program-operation independence: an operation has an interface (or signature) and an implementation (or method) #. Program-operation independence: an operation has an interface (or signature) and an implementation (or method)
 
... ... Solution +.#
346 346
347 347 Solution +.# Solution +.#
348 348
349 : The data is the information we want to store, the meta-data is its organization, how we are going to store it.
349 : The data is the information we want to store, the meta-data is its organization, how we are going to store it. Meta-data is information about the data, but of no use on its own.
350 350
351 351 Solution +.# Solution +.#
352 352
353 : No, data and programs are indepent. But actually, this is true only if the model doesn't change: shifting to a "less structured model", e.g., one of the NoSQL models, can require to change the DBMS.
353 : Normally no, data and programs are indepent. But actually, this is true only if the model doesn't change: shifting to a "less structured model", e.g., one of the NoSQL models, can require to change the DBMS.
354 354
355 355 Solution +.# Solution +.#
356 356
 
... ... Solution +.#
362 362
363 363 Solution +.# Solution +.#
364 364
365 : We can use the same program for various data. Because wo don't want to re-write a new DBMS every time we change the data we use!
365 : The application should not be sensible to the "internals" of the definition and organization of the data. It matters because having this independance means that changing the data will not require to change the programs.
366 366
367 367 ## Problems {-} ## Problems {-}
368 368
 
... ... Problem (A database catalog for a campus) +.#campus
404 404 Solution to @problem:campus Solution to @problem:campus
405 405 ~ ~
406 406
407 The database catalog should be similar to the following:
408
409 **RELATIONS**
410
411 | Relation\_name | No\_of\_columns |
412 --- | ---
413 `BUILDING` | 3
414 `ROOM` | 3
415 `PROF` | 4
416
417 **COLUMNS**
418
419 | Column\_name | Data\_type | Belongs\_to\_relation |
420 | --- | --- | ---
421 Building\_Name | Character(30) | `Building`
422 GPSLat | Decimal(9,6) | `Building`
423 GPSLon | Decimal(9,6) | `Building`
424 Building\_Name | Character(30) | `ROOM`
425 Room\_Number | Integer(1) | `ROOM`
426 Floor | Integer (1) | `ROOM`
427 Prof\_Name | Character (30) | `PROF`
428 Phone | Integer (10) | `PROF`
429 Email | Character (30) | `PROF`
430 Room\_Number | Integer (1) | `PROF`
431
407 @problem:campus -- Solution to Q. -.#
408 ~
409
410 The database catalog should be similar to the following:
411
412 <!-- Bug with table -->
413
414 **RELATIONS**
415
416 | Relation\_name | No\_of\_columns |
417 --- | ---
418 `BUILDING` | 3
419 `ROOM` | 3
420 `PROF` | 4
421
422 **COLUMNS**
423
424 | Column\_name | Data\_type | Belongs\_to\_relation |
425 | --- | --- | ---
426 Building\_Name | Character(30) | `Building`
427 GPSLat | Decimal(9,6) | `Building`
428 GPSLon | Decimal(9,6) | `Building`
429 Building\_Name | Character(30) | `ROOM`
430 Room\_Number | Integer(1) | `ROOM`
431 Floor | Integer (1) | `ROOM`
432 Prof\_Name | Character (30) | `PROF`
433 Phone | Integer (10) | `PROF`
434 Email | Character (30) | `PROF`
435 Room\_Number | Integer (1) | `PROF`
436
437 @problem:campus -- Solution to Q. -.#
438 ~
439
432 440 For the data, you could have: For the data, you could have:
441
442 - For the `BUILDING` file, we could have:
433 443
434 `(Allgood Hall, 33.47520, -82.02503)`, `(Institut Galilé, 48.959001, 2.339999)`
435 `(Allgood Hall, 128, 1)`, `(Institut Galilé, 205, 3)`, `(Allgood Hall, 228, 2)`
436 `(Aubert, 839401, dae@ipn.net, 128)`, (`Mazza, 938130, Dm@fai.net, 205)`
444 `(Allgood Hall, 33.47520, -82.02503)`,
445 `(Institut Galilé, 48.959001, 2.339999)`
446
447 - For the `ROOM` file, we could have:
448
449 `(Allgood Hall, 128, 1)`,
450 `(Institut Galilé, 205, 3)`,
451 `(Allgood Hall, 228, 2)`
452
453 - For the `PROF` file, we could have:
454
455 `(Aubert, 839401, dae@ipn.net, 128)`,
456 (`Mazza, 938130, Dm@fai.net, 205)`
457
458 @problem:campus -- Solution to Q. -.#
459 ~
437 460
438 461 If everything we knew about the campus came from that database, then If everything we knew about the campus came from that database, then
439 462
 
... ... Solution to @problem:campus
442 465 #. No, we could not get the office hours of a professor. #. No, we could not get the office hours of a professor.
443 466 #. Yes, we could list all the professors whose offices are in the same building. #. Yes, we could list all the professors whose offices are in the same building.
444 467 #. Yes, we could list all the rooms. #. Yes, we could list all the rooms.
445 #. If a new professor arrives, and has to share his office with another professor, we would not have to revise our database catalog (it is fine for two professor to have the same room number, in our model).
468 #. If a new professor arrives, and has to share his office with another professor, we would not have to revise our database catalog (it is fine for two professor to have the same room number, in our model).
446 469 #. Yes, we could list which professors are at the same floor. #. Yes, we could list which professors are at the same floor.
447 470 #. No, we could not tell which professor has the highest evaluations. #. No, we could not tell which professor has the highest evaluations.
448 471
449
450 472 # The Relational Model # The Relational Model
451 473
452 474 ## Resources {-} ## Resources {-}
 
... ... You will install the [MySQL](https://www.mysql.com/) DataBase Managment System,
1735 1757 Below are the instruction to install MySQL Community Edition on Windows 10, and MariaDB on Linux-based distribution, but both are developped for every major operating system (Mac OS, Windows, Debian, Ubuntu, etc.): feel free to pick one or the other, it won't really make a difference in this course (up to some minor aspects). MySQL is more common, MariaDB is growing, both are released under [GNU General Public License](https://www.gnu.org/licenses/licenses.html#GPL), well-documented and free of charge for their "community" versions. Below are the instruction to install MySQL Community Edition on Windows 10, and MariaDB on Linux-based distribution, but both are developped for every major operating system (Mac OS, Windows, Debian, Ubuntu, etc.): feel free to pick one or the other, it won't really make a difference in this course (up to some minor aspects). MySQL is more common, MariaDB is growing, both are released under [GNU General Public License](https://www.gnu.org/licenses/licenses.html#GPL), well-documented and free of charge for their "community" versions.
1736 1758
1737 1759 It is perfectly acceptable to install MySQL or MariaDB on a virtual machine for this class. It is perfectly acceptable to install MySQL or MariaDB on a virtual machine for this class.
1738 Remember that at <http://spots.augusta.edu/tschultz/resources/SWAvailable.html>, you can have access to [VMware](https://www.vmware.com/) and Windows licences, and that using [Virtual Box](https://www.virtualbox.org/wiki/Downloads) should also work fine.
1760 Remember that using your [on the hub](https://onthehub.com/) account, you should ave access to [VMware](https://www.vmware.com/) and Windows licences, and that using [Virtual Box](https://www.virtualbox.org/wiki/Downloads) should also work fine.
1739 1761 Once this step is completed, or if MySQL or MariaDB is already installed on your computer, go to the next step. Once this step is completed, or if MySQL or MariaDB is already installed on your computer, go to the next step.
1740 1762
1741 1763 I tried to give precise and up-to-date instructions below, follow them carefully, read the messages displayed on your screen, make sure a step was correctly executed before moving to the next one, and everything should be all right. I tried to give precise and up-to-date instructions below, follow them carefully, read the messages displayed on your screen, make sure a step was correctly executed before moving to the next one, and everything should be all right.
 
... ... The following links could be useful:
1757 1779
1758 1780 > Windows (x86, 32-bit), MSI Installer XXX YYY (mysql-installer-web-community-XXX.msi) > Windows (x86, 32-bit), MSI Installer XXX YYY (mysql-installer-web-community-XXX.msi)
1759 1781
1760 where XXX is a number version (e.g., 8.0.11), and YYY is the size of the file (e.g., 15.8M). On the next page, click on the (somewhat hidden) "No thanks, just start my download." button.
1782 where XXX is a number version (e.g., 8.0.13.0.), and YYY is the size of the file (e.g., 16.3M). On the next page, click on the (somewhat hidden) "No thanks, just start my download." button.
1761 1783 #. Save the "mysql-installer-web-community-XXX.msi" file, and open it. If there is an updated version of the installer available, agree to download it. Accept the license term. #. Save the "mysql-installer-web-community-XXX.msi" file, and open it. If there is an updated version of the installer available, agree to download it. Accept the license term.
1762 1784 #. We will now install the various components needed for this class, leaving all the choices by defaults. This means that you need to do the following: #. We will now install the various components needed for this class, leaving all the choices by defaults. This means that you need to do the following:
1763 1785 #. Leave the first option on "Developer Default" and click on "Next" #. Leave the first option on "Developer Default" and click on "Next"
 
... ... Using four tools: Relations, Attributes, Primary Keys, Foreign Keys.
3518 3540 #. Merged Relation Approach: If both participations are total, just merge them. Primary key = just pick one, and add a `NOT NULL` constraint on the other. #. Merged Relation Approach: If both participations are total, just merge them. Primary key = just pick one, and add a `NOT NULL` constraint on the other.
3519 3541 #. Cross-Reference or Relationship Relation Approach: Create a lookup table with two (or more!) foreign keys, pick one of them (or the one on the N side, or both if $M:N$, or all if $n$-ary) as the primary key. #. Cross-Reference or Relationship Relation Approach: Create a lookup table with two (or more!) foreign keys, pick one of them (or the one on the N side, or both if $M:N$, or all if $n$-ary) as the primary key.
3520 3542
3521 **Bogue: + Propagate option? Cascade, most of the time: weak entity type, lookup tables, etc.**
3543 **Bug: + Propagate option? Cascade, most of the time: weak entity type, lookup tables, etc.**
3522 3544
3523 3545 ![](img/ER_To_Rel1.jpeg) ![](img/ER_To_Rel1.jpeg)
3524 3546
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