File notes/lectures_notes.md changed (mode: 100644) (index 7909cdc..7b457be) |
... |
... |
The quizzes are not indicated, but were generally a mix of up to five exercises |
150 |
150 |
- A series of small commands to explain, like @exercise:explainsql3, @exercise:explainsql4 and @exercise:explainsql5 |
- A series of small commands to explain, like @exercise:explainsql3, @exercise:explainsql4 and @exercise:explainsql5 |
151 |
151 |
- [%D %n (%T)](#problem:printing-station) |
- [%D %n (%T)](#problem:printing-station) |
152 |
152 |
- [%D %n (%T)](#problem:ComputerSelectTer) |
- [%D %n (%T)](#problem:ComputerSelectTer) |
153 |
|
|
|
|
153 |
|
- Exam #2: |
|
154 |
|
- A series of questions about database application and security |
|
155 |
|
- [%D %n (%T)](#problem:conf-er) |
|
156 |
|
- Converting the ER diagram in _the solution_ of [%D %n (%T)](#problem:job-offers) into a relational model |
|
157 |
|
- [%D %n (%T)](#problem:grade_report) |
|
158 |
|
|
154 |
159 |
### Fall 2020 {-} |
### Fall 2020 {-} |
155 |
160 |
|
|
156 |
161 |
- Project #1: [%D %n (%T)](#problem:project1bis) |
- Project #1: [%D %n (%T)](#problem:project1bis) |
|
... |
... |
The quizzes are not indicated, but were generally a mix of up to five exercises |
159 |
164 |
- [%D %n (%T)](#problem:rel_model_pet_shelter) |
- [%D %n (%T)](#problem:rel_model_pet_shelter) |
160 |
165 |
- Exam #2: |
- Exam #2: |
161 |
166 |
- [%D %n (%T)](#problem:teaching) |
- [%D %n (%T)](#problem:teaching) |
162 |
|
- [%D %n (%T)](#problem:grade_report) |
|
|
167 |
|
- A variation on [%D %n (%T)](#problem:grade_report) |
163 |
168 |
- [%D %n (%T)](#problem:cellphones) |
- [%D %n (%T)](#problem:cellphones) |
164 |
169 |
- Five small exercises about [data base application](#exercises-4). |
- Five small exercises about [data base application](#exercises-4). |
165 |
170 |
- Final: |
- Final: |
|
... |
... |
Problem (Normal form for the GRADE\_REPORT Relation) +.#grade_report |
7740 |
7745 |
|
|
7741 |
7746 |
Consider the following relation: |
Consider the following relation: |
7742 |
7747 |
|
|
7743 |
|
GRADE\_REPORT(StudentID, Term, StudentName, Address, Major, CourseID, CourseTitle, LetterGrade, Grade) |
|
|
7748 |
|
GRADE\_REPORT(StudentID, Term, StudentName, Department, Major, CourseNum, CourseTitle, LetterGrade, Grade) |
7744 |
7749 |
|
|
7745 |
7750 |
and the following functional dependencies: |
and the following functional dependencies: |
7746 |
7751 |
|
|
7747 |
7752 |
------------------------------------ ------- ------------- |
------------------------------------ ------- ------------- |
7748 |
7753 |
StudentID $\to$ StudentName |
StudentID $\to$ StudentName |
7749 |
|
Major $\to$ Address |
|
7750 |
|
{Major, CourseID} $\to$ CourseTitle |
|
|
7754 |
|
Major $\to$ Department |
|
7755 |
|
{Major, CourseNum} $\to$ CourseTitle |
7751 |
7756 |
Grade $\to$ LetterGrade |
Grade $\to$ LetterGrade |
7752 |
|
{StudentID, Term, CourseID, Major} $\to$ Grade |
|
|
7757 |
|
{StudentID, Term, CourseNum, Major} $\to$ Grade |
7753 |
7758 |
------------------------------------ ------- ------------- |
------------------------------------ ------- ------------- |
7754 |
7759 |
|
|
7755 |
|
Underline the primary key for that relation, then normalize it to the third normal form (you can indicate the second normal form if you want). |
|
|
7760 |
|
Identify a possible primary key for that relation. |
|
7761 |
|
Then, using that primary key, decide if this relation is in second normal form. If it is not, identify a functional depency that prevents the relation from being in second normal form. |
|
7762 |
|
Finally, normalize it to the third normal form. |
7756 |
7763 |
Try to pick meaningful names for your relations. |
Try to pick meaningful names for your relations. |
7757 |
7764 |
|
|
7758 |
7765 |
--- |
--- |
|
... |
... |
Solution to [%D %n (%T)](#problem:isp) |
8338 |
8345 |
Solution to [%D %n (%T)](#problem:grade_report) |
Solution to [%D %n (%T)](#problem:grade_report) |
8339 |
8346 |
~ |
~ |
8340 |
8347 |
|
|
8341 |
|
The primary key would be \{StudentID, Term, Major, CourseID\}. |
|
8342 |
|
|
|
|
8348 |
|
The primary key would be \{StudentID, Term, Major, CourseNum\}. |
|
8349 |
|
|
|
8350 |
|
Numerous functional dependencies prevent it from being in second normal form, for instance StudentID $\to$ StudentName prevents the functional dependency {StudentID, Term, CourseNum, Major} $\to$ StudentName from being full. |
|
8351 |
|
|
8343 |
8352 |
We obtain the following five relations when we normalize it to the third normal form: |
We obtain the following five relations when we normalize it to the third normal form: |
8344 |
8353 |
|
|
8345 |
8354 |
GRADE\_REPORT(S͟t͟u͟d͟e͟n͟t͟I͟D͟, T͟e͟r͟m͟, C͟o͟u͟r͟s͟e͟I͟D͟, M͟a͟j͟o͟r͟, Grade) |
GRADE\_REPORT(S͟t͟u͟d͟e͟n͟t͟I͟D͟, T͟e͟r͟m͟, C͟o͟u͟r͟s͟e͟I͟D͟, M͟a͟j͟o͟r͟, Grade) |