File notes/lectures_notes.md changed (mode: 100644) (index 6153e9e..d82f1f3) |
... |
... |
Normalize the relations to 2NF and 3NF. Show all relations at each stage (2NF an |
4546 |
4546 |
|
|
4547 |
4547 |
--- |
--- |
4548 |
4548 |
|
|
4549 |
|
Problem +.#book |
|
|
4549 |
|
Problem (Normal Form of the BOOK relation)+.#book |
4550 |
4550 |
~ |
~ |
4551 |
4551 |
|
|
4552 |
|
<!-- bug with table --> |
|
4553 |
|
|
|
4554 |
4552 |
Consider the following relation for published books: |
Consider the following relation for published books: |
4555 |
4553 |
|
|
4556 |
|
BOOK (Book\_title, Book\_type, Author\_name, List\_price, Author\_affil, Publisher) |
|
|
4554 |
|
BOOK(Book\_title, Book\_type, Author\_name, List\_price, Author\_affil, Publisher) |
4557 |
4555 |
|
|
4558 |
4556 |
Suppose we have the following dependencies: |
Suppose we have the following dependencies: |
4559 |
4557 |
|
|
|
4558 |
|
<!-- bug with table --> |
4560 |
4559 |
| | | |
| | | |
4561 |
4560 |
---: | :---: | --- | |
---: | :---: | --- | |
4562 |
4561 |
Book\_title | → | \{ Publisher, Book\_type \} |
Book\_title | → | \{ Publisher, Book\_type \} |
|
... |
... |
Author\_name | → | Author\_affil |
4570 |
4569 |
|
|
4571 |
4570 |
--- |
--- |
4572 |
4571 |
|
|
4573 |
|
Problem +.# |
|
|
4572 |
|
Problem (From Business Statements to E.R. Diagram -- UNIVERSITY) +.#BusinessToEr |
4574 |
4573 |
~ |
~ |
4575 |
4574 |
|
|
4576 |
4575 |
Consider the following requirements for a UNIVERSITY database, used to keep track of students' transcripts. |
Consider the following requirements for a UNIVERSITY database, used to keep track of students' transcripts. |
|
... |
... |
Problem +.# |
4588 |
4587 |
|
|
4589 |
4588 |
--- |
--- |
4590 |
4589 |
|
|
4591 |
|
Problem +.# |
|
|
4590 |
|
Problem (From UML to Relational Model -- DRIVER) +.#UMLtoRELDriver |
4592 |
4591 |
~ |
~ |
4593 |
4592 |
|
|
4594 |
4593 |
Consider the UML diagram below, and convert it to the relational model. |
Consider the UML diagram below, and convert it to the relational model. |
|
... |
... |
Problem +.# |
4598 |
4597 |
|
|
4599 |
4598 |
--- |
--- |
4600 |
4599 |
|
|
4601 |
|
Problem +.# |
|
|
4600 |
|
Problem (Normal Form of the CONTACT Relation)+.# |
4602 |
4601 |
~ |
~ |
4603 |
4602 |
|
|
4604 |
4603 |
Consider the relation |
Consider the relation |
|
... |
... |
Problem +.# |
4608 |
4607 |
and the following functional dependencies: |
and the following functional dependencies: |
4609 |
4608 |
|
|
4610 |
4609 |
<!-- bug with table --> |
<!-- bug with table --> |
4611 |
|
|
|
4612 |
4610 |
||| |
||| |
4613 |
4611 |
---: | :---: | --- | |
---: | :---: | --- | |
4614 |
4612 |
\{Zip, Brand\} | → | \{Phone\} |
\{Zip, Brand\} | → | \{Phone\} |
|
... |
... |
Give the relations, their primary keys, and functional dependencies for both ste |
4622 |
4620 |
|
|
4623 |
4621 |
--- |
--- |
4624 |
4622 |
|
|
4625 |
|
Problem +.#consultation |
|
|
4623 |
|
Problem (CONSULTATION Relation: Justification, Primary Key and Normal Form)+.#consultation |
4626 |
4624 |
~ |
~ |
4627 |
4625 |
|
|
4628 |
4626 |
Consider the relation |
Consider the relation |
|
... |
... |
Problem +.#consultation |
4632 |
4630 |
with the following functional dependencies: |
with the following functional dependencies: |
4633 |
4631 |
|
|
4634 |
4632 |
<!-- bug with table --> |
<!-- bug with table --> |
4635 |
|
|
|
4636 |
4633 |
||| |
||| |
4637 |
4634 |
---: | :---: | --- | |
---: | :---: | --- | |
4638 |
4635 |
\{Doctor\_no, Patient\_no, Date\} | → | \{Diagnosis\} |
\{Doctor\_no, Patient\_no, Date\} | → | \{Diagnosis\} |
|
... |
... |
Normalize it to the third normal form if necessary. |
4647 |
4644 |
|
|
4648 |
4645 |
--- |
--- |
4649 |
4646 |
|
|
4650 |
|
Problem +.#carinfo |
|
|
4647 |
|
Problem (From E.R. to Relational Schema and UML class diagram -- CAR\_INFO)+.#carinfo |
4651 |
4648 |
~ |
~ |
4652 |
4649 |
|
|
4653 |
4650 |
Consider the following E.R. schema for the CAR\_INFO database: |
Consider the following E.R. schema for the CAR\_INFO database: |
|
... |
... |
Problem +.#carinfo |
4662 |
4659 |
|
|
4663 |
4660 |
--- |
--- |
4664 |
4661 |
|
|
4665 |
|
Problem +.#mysqlw |
|
|
4662 |
|
Problem (Discovering MySQL Workbench)+.#mysqlw |
4666 |
4663 |
~ |
~ |
4667 |
4664 |
|
|
4668 |
4665 |
In this exercise, we will install and explore the basic functionalities of MySQL Workbench, which is a cross-platform, open-source, and free graphical interface for database design. |
In this exercise, we will install and explore the basic functionalities of MySQL Workbench, which is a cross-platform, open-source, and free graphical interface for database design. |
|
... |
... |
Problem +.#mysqlw |
4678 |
4675 |
|
|
4679 |
4676 |
--- |
--- |
4680 |
4677 |
|
|
4681 |
|
Problem +.#reverseeng |
|
|
4678 |
|
Problem (Using MySQL Workbench's Reverse Engineering)+.#reverseeng |
4682 |
4679 |
~ |
~ |
4683 |
4680 |
|
|
4684 |
|
*This problem requires you to have successfully completed @problem:mysqlw and @problem:ERtoREL.* |
|
|
4681 |
|
*This problem requires you to have successfully completed @problem:mysqlw and @problem:UMLtoRELDriver.* |
4685 |
4682 |
|
|
4686 |
|
Using the relational database schema you obtained in @problem:ERtoREL, write the `SQL` implementation of that database. |
|
4687 |
|
Then, using MySQL Workbench, use the "Reverse Engineering" function to obtain a E.E.R. diagram of your database, and compare it with the U.M.L. diagram you draw in question~ \ref{ERtoUML} of @problem:ERtoREL. |
|
4688 |
|
Apart from the difference inherent to the nature of the diagram (i.e., U.M.L. Vs E.E.R.), how are they the same? How do they differ? Is the automated tool as efficient and accurate as you are? |
|
|
4683 |
|
Using the relational database schema you obtained in @problem:UMLtoRELDriver, write the `SQL` implementation of that database. |
|
4684 |
|
Then, using MySQL Workbench, use the "Reverse Engineering" function to obtain a E.E.R. diagram of your database, and compare it with the U.M.L. diagram from @problem:UMLtoRELDriver. |
|
4685 |
|
Apart from the difference inherent to the nature of the diagram (i.e., U.M.L. Vs E.E.R.), how are they the same? |
|
4686 |
|
How do they differ? |
|
4687 |
|
Is the automated tool as efficient and accurate as you are? |
4689 |
4688 |
|
|
4690 |
4689 |
--- |
--- |
4691 |
4690 |
|
|
4692 |
|
Problem +.# |
|
|
4691 |
|
Problem (From Business Statements to Dependencies -- KEYBOARD) +.#BusinessToDependecies-KEYBOARD |
4693 |
4692 |
~ |
~ |
4694 |
4693 |
|
|
4695 |
4694 |
This exercise asks you to convert business statements into dependencies. |
This exercise asks you to convert business statements into dependencies. |
|
... |
... |
Problem +.# |
4709 |
4708 |
|
|
4710 |
4709 |
--- |
--- |
4711 |
4710 |
|
|
4712 |
|
Problem +.# |
|
|
4711 |
|
Problem (Reverse Engineering by Hand)+.# |
4713 |
4712 |
~ |
~ |
4714 |
4713 |
|
|
4715 |
4714 |
Look at the following relational model, and "reverse-engineer" it to obtain an E.R. diagram: |
Look at the following relational model, and "reverse-engineer" it to obtain an E.R. diagram: |
|
... |
... |
Problem +.# |
4720 |
4719 |
## Solution to Selected Problems |
## Solution to Selected Problems |
4721 |
4720 |
|
|
4722 |
4721 |
Solution to [%D %n (%T)](#problem:movie) |
Solution to [%D %n (%T)](#problem:movie) |
4723 |
|
~ |
|
|
4722 |
|
~ |
4724 |
4723 |
|
|
4725 |
4724 |
#. true |
#. true |
4726 |
4725 |
#. true |
#. true |