List of commits:
Subject Hash Author Date (UTC)
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
Working on exercises. 42549c8d28249f1ecf85dd21f6d004ae63c533ad aubert@math.cnrs.fr 2018-05-19 05:43:04
Commit 3fd56098f9022b48fadff8e3ea10fd7fcd49213a - Fixing minor typos
Author: au
Author date (UTC): 2018-12-16 04:05
Committer name: au
Committer date (UTC): 2018-12-16 04:05
Parent(s): ccb3e4e35a17076f72b836720948ba7cfe86155b
Signer:
Signing key:
Signing status: N
Tree: 98e057824cb87bb91413ecae2687eb58419b43c4
File Lines added Lines deleted
README.md 3 3
notes/lectures_notes.md 21 21
File README.md changed (mode: 100644) (index 84e7298..0d219c1)
1 1 # Lecture Notes for CSCI 3410 -- Database Systems # Lecture Notes for CSCI 3410 -- Database Systems
2 2
3 Here are the lecture notes, exercises and problems for a lecture on database taught at [Augusta University](https://github.com/chdemko/pandoc-numbering) by C. Aubert.
3 Here are the lecture notes, code, exercises and problems for a lecture on database taught at [Augusta University](https://www.augusta.edu/) by C. Aubert.
4 4
5 5 ## Getting Started ## Getting Started
6 6
7 Cf. the "Typesetting" subsection in the main document.
7 To compile this document, refer to the "Typesetting" subsection in the main document.
8 8
9 9 ## Contributing ## Contributing
10 10
11 To come.
11 You can submit bug reports at <https://rocketgit.com/user/caubert/CSCI_3410/bug> (requires an account).
12 12
13 13 ## Authors ## Authors
14 14
File notes/lectures_notes.md changed (mode: 100644) (index da47295..ef28ac5)
... ... The focus will be on design, but we will have to do a little bit of everything.
215 215
216 216 ## Design ## Design
217 217
218 ![The cycle of design](before/paper_screen/cycle_of_design.jpeg){#fig:cycle}
218 ![The cycle of design](img/cycle_of_design.jpeg){#fig:cycle}
219 219
220 Refer to the ["The cycle of design" figure](#fig:cycle}.
220 Refer to the ["The cycle of design" figure]{#fig:cycle}.
221 221
222 222 Add a line from SQL to Program, a line from NoSQL to CLI. Add a line from SQL to Program, a line from NoSQL to CLI.
223 223 Make the arrow from Bus. Statements to NoSQL dashed? Make the arrow from Bus. Statements to NoSQL dashed?
 
... ... If everything we knew about the campus came from that database, then
437 437
438 438 ## Concepts ## Concepts
439 439
440 ![Terminology](before/paper_screen/termimology.jpeg)
440 ![Terminology](img/termimology.jpeg)
441 441
442 442 The relational data model (or relational database schema) is: The relational data model (or relational database schema) is:
443 443
 
... ... We are dealing with moving aspects here: atributes on $1:1$, $1:N$, $N:1$ relati
3531 3531
3532 3532 To determine cardinality ratio: fix all but one, wonder how many can be in that relationship. To determine cardinality ratio: fix all but one, wonder how many can be in that relationship.
3533 3533
3534 ![](before/paper_screen/N_ary_relationship.jpeg){ width=100% }
3534 ![](img/N_ary_relationship.jpeg){ width=100% }
3535 3535
3536 ![](before/paper_screen/N_ary_relationship02.jpeg){ width=100% }
3536 ![](img/N_ary_relationship02.jpeg){ width=100% }
3537 3537
3538 3538 *Need to find a good $3$-ary example* *Need to find a good $3$-ary example*
3539 3539
 
... ... Two sorts of entity types:
3552 3552 Weak (child) entity types are identified by **identifying / owner** type that is related to it, in conjunction with one attribute (**the partial key**). Weak (child) entity types are identified by **identifying / owner** type that is related to it, in conjunction with one attribute (**the partial key**).
3553 3553 Relation is called identifiying relationship, and weak entities have a total participation constraint. Relation is called identifiying relationship, and weak entities have a total participation constraint.
3554 3554
3555 ![](before/paper_screen/Weak_Entity.jpeg){ width=100% }
3555 ![](img/Weak_Entity.jpeg){ width=100% }
3556 3556
3557 3557 Choice between two representation: if pet is involved in other relationships! Choice between two representation: if pet is involved in other relationships!
3558 3558
 
... ... Choice between two representation: if pet is involved in other relationships!
3564 3564
3565 3565 **Drawings** **Drawings**
3566 3566
3567 ![](before/paper_screen/Entity_Alt_notation01.jpeg){ width=100% }
3567 ![](img/Entity_Alt_notation01.jpeg){ width=100% }
3568 3568
3569 ![](before/paper_screen/Entity_Alt_notation02.jpeg){ width=100% }
3569 ![](img/Entity_Alt_notation02.jpeg){ width=100% }
3570 3570
3571 3571
3572 3572 Crow's foot notation: Crow's foot notation:
 
... ... Closer to OO programming.
3592 3592
3593 3593 From relational models to E.R. models (sometimes needed) From relational models to E.R. models (sometimes needed)
3594 3594
3595 ![](before/paper_screen/Reverse_Eng1.jpeg){ width=100% }
3595 ![](img/Reverse_Eng1.jpeg){ width=100% }
3596 3596
3597 ![](before/paper_screen/Reverse_Eng2.jpeg){ width=100% }
3597 ![](img/Reverse_Eng2.jpeg){ width=100% }
3598 3598
3599 ![](before/paper_screen/Reverse_Eng3.jpeg){ width=100% }
3599 ![](img/Reverse_Eng3.jpeg){ width=100% }
3600 3600
3601 3601 --- ---
3602 3602
 
... ... c. Cross-Reference or Relationship Relation Approach: Create a lookup table with
3634 3634
3635 3635 **Bogue: + Propagate option? Cascade, most of the time: weak entity type, lookup tables, etc.** **Bogue: + Propagate option? Cascade, most of the time: weak entity type, lookup tables, etc.**
3636 3636
3637 ![](before/paper_screen/ER_To_Rel1.jpeg){ width=100% }
3637 ![](img/ER_To_Rel1.jpeg){ width=100% }
3638 3638
3639 3639
3640 3640 ### Outro ### Outro
 
... ... Att. 1 → Att. 3 | Att. 2 → Att. 1
3797 3797 Functional dependencies list the constraints between two sets of attributes from the database. Functional dependencies list the constraints between two sets of attributes from the database.
3798 3798 X → Y reads "X fixes Y", and applier that values in Y are fixed by the value in X. X → Y reads "X fixes Y", and applier that values in Y are fixed by the value in X.
3799 3799
3800 ![](before/paper_screen/Fund_Dep.jpeg){ width=100% }
3800 ![](img/Fund_Dep.jpeg){ width=100% }
3801 3801
3802 3802
3803 3803 Note that: Note that:
 
... ... For each attribute $A$ of the relation whose primary key is $A_1, …, A_n$:
3884 3884 - Remove $A$ from the original relation - Remove $A$ from the original relation
3885 3885 - Add a foreign key from $\{A'_1, …, A'_k\}$ to their original counterparts in the original relation. - Add a foreign key from $\{A'_1, …, A'_k\}$ to their original counterparts in the original relation.
3886 3886
3887 ![](before/paper_screen/2NF1.jpeg){ width=100% }
3887 ![](img/2NF1.jpeg){ width=100% }
3888 3888
3889 3889 Refinment: note that if more than one attribute depends of the same subset $\{A'_1, …, A'_k\}$, we will create two relations: that is useless, we could have created just one. Refinment: note that if more than one attribute depends of the same subset $\{A'_1, …, A'_k\}$, we will create two relations: that is useless, we could have created just one.
3890 3890
3891 ![](before/paper_screen/2NF2.jpeg){ width=100% }
3891 ![](img/2NF2.jpeg){ width=100% }
3892 3892
3893 3893 Note also that if our primary key is a singleton, then there is nothing to do, we are in 2NF as soon as we are in 1NF. Note also that if our primary key is a singleton, then there is nothing to do, we are in 2NF as soon as we are in 1NF.
3894 3894
 
... ... Wide, powerful, but also intimidating.
3939 3939
3940 3940 You know UML from object-oriented programming language: You know UML from object-oriented programming language:
3941 3941
3942 ![](before/paper_screen/Class_diag.png){ width=100% }
3942 ![](img/Class_diag.png){ width=100% }
3943 3943
3944 3944 That's a class diagram, there are other types of diagrams, they are not unrelated! That's a class diagram, there are other types of diagrams, they are not unrelated!
3945 3945 For instance, using communication diagrams, deployment diagrams, and state chart diagrams, you can collect the requirements needed to draw a class diagram! For instance, using communication diagrams, deployment diagrams, and state chart diagrams, you can collect the requirements needed to draw a class diagram!
 
... ... They describe the behavioral, or dynamic, relationship, between components.
3973 3973 - **State machine diagram**, a.k.a., state chart diagram, describes how a system react to external events. You can picture yourself a complex form of finite state automata diagram. - **State machine diagram**, a.k.a., state chart diagram, describes how a system react to external events. You can picture yourself a complex form of finite state automata diagram.
3974 3974 - **Activity diagram** is a flow of control between activities. You may have seen them already, they are supposedly easy to follow: - **Activity diagram** is a flow of control between activities. You may have seen them already, they are supposedly easy to follow:
3975 3975
3976 ![](before/paper_screen/Activity_diag.png){ width=80% }
3976 ![](img/Activity_diag.png){ width=80% }
3977 3977
3978 3978 Then there is the sub-category of "Interaction diagrams": Then there is the sub-category of "Interaction diagrams":
3979 3979
 
... ... Associations are, to some extend, more expressive than relationship types:
4007 4007 - **As for relationship types** they can have attributes: actually, a whole class can be connected to an association. - **As for relationship types** they can have attributes: actually, a whole class can be connected to an association.
4008 4008 - **As for relationship types**, they can express a cardinality constraint on the relation between classes. They are written as `min .. max`, with `*` for "no maximum", and the following shorthands: `*` stands for `0..*` and `1` stands for `1..1`. An association with `1` on one side and `*` on the other (resp. `1` and `1`, `*` and `1`, `*` and `*`) is sometimes called "one-to-many" (resp., "one-to-one", "many-to-one", "many-to-many"). The notation in partially inverted w.r.t. ER diagrams: - **As for relationship types**, they can express a cardinality constraint on the relation between classes. They are written as `min .. max`, with `*` for "no maximum", and the following shorthands: `*` stands for `0..*` and `1` stands for `1..1`. An association with `1` on one side and `*` on the other (resp. `1` and `1`, `*` and `1`, `*` and `*`) is sometimes called "one-to-many" (resp., "one-to-one", "many-to-one", "many-to-many"). The notation in partially inverted w.r.t. ER diagrams:
4009 4009
4010 ![](before/paper_screen/Multiplicities.png){ width=60% }
4010 ![](img/Multiplicities.png){ width=60% }
4011 4011
4012 4012 - **As opposed to the relationship types**, they can have a direction, indicating that the user should be able to navigate them only in one direction, or in two (which is the default). This is used for security or privacy purposes. - **As opposed to the relationship types**, they can have a direction, indicating that the user should be able to navigate them only in one direction, or in two (which is the default). This is used for security or privacy purposes.
4013 4013 - **As opposed to the relationship types**, they come in various flavors: - **As opposed to the relationship types**, they come in various flavors:
 
... ... Problem (Reading the MOVIES database ER schema) +.#movie
4494 4494 Consider the ER schema for the MOVIES database ([@Textbook6, Figure 7.24]): Consider the ER schema for the MOVIES database ([@Textbook6, Figure 7.24]):
4495 4495
4496 4496 \begin{tikzpicture} \begin{tikzpicture}
4497 \node (a) at (0,0) {\includegraphics[page=1,width=1\textwidth]{images/te.pdf}};
4497 \node (a) at (0,0) {\includegraphics[page=1,width=1\textwidth]{img/te.pdf}};
4498 4498 \fill[white] (-8.3, 6.5) rectangle (-3.5, 4); \fill[white] (-8.3, 6.5) rectangle (-3.5, 4);
4499 4499 \end{tikzpicture} \end{tikzpicture}
4500 4500
 
... ... A driver has an id, an age, a name, and an address.
4531 4531 One of the interesting choice is: should "accident" be an entity type or a relationship type? One of the interesting choice is: should "accident" be an entity type or a relationship type?
4532 4532
4533 4533 Solution +.# Solution +.#
4534 ~ \includegraphics[page=1,width=1\textwidth]{images/p.pdf}
4534 ~ \includegraphics[page=1,width=1\textwidth]{img/p.pdf}
4535 4535
4536 4536 OR OR
4537 4537
 
... ... Java actually uses
5289 5289 - A **protocol** (the API, a class libarary), Java DataBase Connectivity (JDBC), common to all DBMS. Essentially, a collection of classes to send SQL statements, retriev and update the results of a query, handle exceptions, etc. - A **protocol** (the API, a class libarary), Java DataBase Connectivity (JDBC), common to all DBMS. Essentially, a collection of classes to send SQL statements, retriev and update the results of a query, handle exceptions, etc.
5290 5290 - A **subprotocol** (the driver, connector), Connector/J for MySQL. - A **subprotocol** (the driver, connector), Connector/J for MySQL.
5291 5291
5292 ![](before/paper_screen/Connector.png){ height=50% }
5292 ![](img/Connector.png){ height=50% }
5293 5293
5294 5294 And the routine is a bit more complex: And the routine is a bit more complex:
5295 5295
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