Pages

Monday, 29 July 2019

Entity Relationship Diagram

Step1: Using MS-Access 
Create the data base for the below ERD diagram with four entity (patient, doctor, nurse and ward)using MS-Access database as shown 
Entity 1: 
patient
pat_idpat_namepat_disease
101rajutb
102ranicancer
103kanifever
104vanicough
105dhonityphoid


Entity 2:
doctor
doc_iddoc_namepat_id
201rk101
202pk102
203ck103
204dk104
205sk105


Entity 3:
            nurse
n_idward_idpat_id
301401101
302402102
303403103
304404104
305405105



Entity 4:
ward
ward_idpat_id
401101
402102
403103
404104
405105


Step1: Using MS-Visio
Draw the ERD as shown in fig using MS Visio 
click on file menu -> new -> Software and Database -> Database Model Diagram


Now draw the ERD Diagram as shown in MS-Visio
patient entity


doctor entity


nurse entity


ward entity


Step 2:
Now we shall establish hospital management system using the above four entity relations using the relationship component as shown 

Step 3:
click on Data menu bar -> Link Data to Shapes and then select Microsoft Access Database which will be as shown
 

Step 4:
Now patient entity database created in the ms access will be on to your ms visio  as shown

Step 5:
Repeat the same procedure for the remaining entities database  (doctor, nurse and ward) created in the ms access will be on to your ms visio  as shown


Step 6: 
How to run the query in MS-Visio 2007 : To run the query in MS-Visio we need to create a query in MS-Access as follows 
Click on Create menu bar -> Query Design



Step 7: Now add all the entity on to the query wizard


Step 8: Now write your query using the sql view by clicking on design menu bar -> View 

Queries:
1. select * from patient where pat_disease='tb';
2. select * from patient where pat_name like 'r%';
3. select * from patient where pat_id=105;
4. select * from patient where pat_name like '%i';
5. select * from doctor where doc_name like '%k';

No comments:

Post a Comment