File notes/lectures_notes.md changed (mode: 100644) (index 5e1e6c1..95b8c87) |
... |
... |
The following links could be useful: |
2646 |
2646 |
#. 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: |
2647 |
2647 |
#. Leave the first option on "Developer Default" and click on "Next", or click on "Custom", and select the following: |
#. Leave the first option on "Developer Default" and click on "Next", or click on "Custom", and select the following: |
2648 |
2648 |
|
|
2649 |
|
{width=90%} |
|
|
2649 |
|
{width=90%} |
2650 |
2650 |
|
|
2651 |
2651 |
#. Click on "Next" even if you do not meet all the requirements |
#. Click on "Next" even if you do not meet all the requirements |
2652 |
2652 |
#. Click on "Execute". The system will download and install several softwares (this may take some time). |
#. Click on "Execute". The system will download and install several softwares (this may take some time). |
|
... |
... |
Will not be able to represent it, because of https://stackoverflow.com/a/2126026 |
5340 |
5340 |
|
|
5341 |
5341 |
From relational models to ER models (sometimes needed) |
From relational models to ER models (sometimes needed) |
5342 |
5342 |
|
|
5343 |
|
{width=90%} |
|
|
5343 |
|
{width=90%} |
5344 |
5344 |
|
|
5345 |
|
{width=90%} |
|
|
5345 |
|
{width=90%} |
5346 |
5346 |
|
|
5347 |
5347 |
--- |
--- |
5348 |
5348 |
|
|
|
... |
... |
Wide, powerful, but also intimidating. |
5841 |
5841 |
|
|
5842 |
5842 |
You know UML from object-oriented programming language: |
You know UML from object-oriented programming language: |
5843 |
5843 |
|
|
5844 |
|
{width=90%} |
|
|
5844 |
|
{width=90%} |
5845 |
5845 |
|
|
5846 |
5846 |
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! |
5847 |
5847 |
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 each offer a viewpoint on a software that will help you in making sure the |
5851 |
5851 |
|
|
5852 |
5852 |
There are 14 different types of diagrams, divided between two categories: structural and behavioral. |
There are 14 different types of diagrams, divided between two categories: structural and behavioral. |
5853 |
5853 |
|
|
5854 |
|
 |
|
|
5854 |
|
 |
5855 |
5855 |
|
|
5856 |
5856 |
(Source: <https://commons.wikimedia.org/wiki/File:UML_diagrams_overview.svg>) |
(Source: <https://commons.wikimedia.org/wiki/File:UML_diagrams_overview.svg>) |
5857 |
5857 |
|
|
|
... |
... |
They describe the behavioral, or dynamic, relationship, between components. |
5877 |
5877 |
- **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. |
5878 |
5878 |
- **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: |
5879 |
5879 |
|
|
5880 |
|
 |
|
|
5880 |
|
 |
5881 |
5881 |
|
|
5882 |
5882 |
Then there is the sub-category of "Interaction diagrams": |
Then there is the sub-category of "Interaction diagrams": |
5883 |
5883 |
|
|
|
... |
... |
Associations are, to some extend, more expressive than relationship types: |
5911 |
5911 |
- **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. |
5912 |
5912 |
- **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: |
5913 |
5913 |
|
|
5914 |
|
 |
|
|
5914 |
|
 |
5915 |
5915 |
|
|
5916 |
5916 |
Additionaly, associations can be "extended", and they are not the only kind of relationship that can be expressed between two classes. |
Additionaly, associations can be "extended", and they are not the only kind of relationship that can be expressed between two classes. |
5917 |
5917 |
|
|
|
... |
... |
Pictures in the img/ folder. |
5940 |
5940 |
|
|
5941 |
5941 |
Qualified associations can be used for weak entities, but not only. |
Qualified associations can be used for weak entities, but not only. |
5942 |
5942 |
|
|
5943 |
|
 |
|
|
5943 |
|
 |
5944 |
5944 |
|
|
5945 |
5945 |
Some of those subtleties depend on your need, and are subjective, but are important tool to design properly a database, and relieving the programmer from the burden of figuring out many details. |
Some of those subtleties depend on your need, and are subjective, but are important tool to design properly a database, and relieving the programmer from the burden of figuring out many details. |
5946 |
5946 |
|
|
|
... |
... |
Problem (Reading the MOVIES database ER schema) +.#movie |
6653 |
6653 |
|
|
6654 |
6654 |
Consider the ER schema for the MOVIES database ([@Textbook6, Figure 7.24]): |
Consider the ER schema for the MOVIES database ([@Textbook6, Figure 7.24]): |
6655 |
6655 |
|
|
6656 |
|
 |
|
|
6656 |
|
 |
6657 |
6657 |
|
|
6658 |
6658 |
Given the constraints shown in the ER schema, respond to the following statements with *True* or *False*. |
Given the constraints shown in the ER schema, respond to the following statements with *True* or *False*. |
6659 |
6659 |
Justify each answer. |
Justify each answer. |
|
... |
... |
Solution to [%D %n (%T)](#problem:car-insurance) |
7234 |
7234 |
~ |
~ |
7235 |
7235 |
Two possible solutions are |
Two possible solutions are |
7236 |
7236 |
|
|
7237 |
|
 |
|
|
7237 |
|
 |
7238 |
7238 |
|
|
7239 |
7239 |
and |
and |
7240 |
7240 |
|
|
|
... |
... |
Solution to [%D %n (%T)](#problem:reverseeng) |
7559 |
7559 |
```{.sqlmysql .numberLines include=code/sql/HW_Person.sql} |
```{.sqlmysql .numberLines include=code/sql/HW_Person.sql} |
7560 |
7560 |
``` |
``` |
7561 |
7561 |
|
|
7562 |
|
 |
|
|
7562 |
|
 |
7563 |
7563 |
|
|
7564 |
7564 |
# Database Applications {#databases-applications} |
# Database Applications {#databases-applications} |
7565 |
7565 |
|
|