Drawing ER Diagrams Using...
Transcript of Drawing ER Diagrams Using...
![Page 1: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/1.jpg)
Drawing ER Diagrams Using Draw.io
Draw.io is a drawing tool, not a Computer-Aided Software Engineering (CASE) tool.
Installation
Go to https://about.draw.io/integrations/ and download and install the desktop version. For Windows:
Running and Preparation
Start draw.io desktop, select to create a blank diagram.
![Page 2: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/2.jpg)
There are many shape templates.
After tidying up:
![Page 3: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/3.jpg)
Resources:
• How to draw ER in draw.io: https://about.draw.io/entity-relationship-diagrams-with-draw-io/.
Shapes needed in this courses
Use these in the ER template:
![Page 4: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/4.jpg)
In the general shape template:
![Page 5: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/5.jpg)
![Page 6: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/6.jpg)
Example
A simple Employees working for projects model.
[1] The employee entity:
1. EmpId: PK 2. LName 3. FName 4. Phone 5. EMail
![Page 7: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/7.jpg)
![Page 8: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/8.jpg)
[2] The Project Entity
1. ProjId: PK 2. Name: CK, must be unique 3. StartDate 4. Description
[3] Relationship between Employee and Project:
1. (0..many) to (0..many) relationship: a. An employee may work for zero or more projects. b. A Project may have zero or more worker member employee.
2. Relationship attributes: associative entities: a. Role b. StartDate
![Page 9: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/9.jpg)
[1] Add relationship
![Page 10: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/10.jpg)
[2] Add relationship attribute (associative entity)
Add an associative entity:
Add a dashed line connector.
![Page 11: Drawing ER Diagrams Using Drawdcm.uhcl.edu/yue/courses/csci4333/current/notes/er/er_in_drawio.pdf · z draw. i o Basic (I) Business (14) Charts (5) Engineering (3) Flcnvcharts (9)](https://reader033.fdocuments.net/reader033/viewer/2022050110/5f4794225d0a7a53d029e35e/html5/thumbnails/11.jpg)
Connect the connector to the new entity and the relationship.
Do not forget to save from time to time. Please do the example yourself to familiarize with the tool.