0% found this document useful (0 votes)
14 views16 pages

Practical#06

The document outlines the steps to create a Hospital database with Patient and Status tables, including how to input records, search for patients under a specific doctor, update prescriptions, and delete discharged patient records. It provides detailed procedures for creating tables, entering fields, establishing relationships, and performing queries. The instructions are aimed at guiding users through the database management process in a structured manner.

Uploaded by

tehreembuterfly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views16 pages

Practical#06

The document outlines the steps to create a Hospital database with Patient and Status tables, including how to input records, search for patients under a specific doctor, update prescriptions, and delete discharged patient records. It provides detailed procedures for creating tables, entering fields, establishing relationships, and performing queries. The instructions are aimed at guiding users through the database management process in a structured manner.

Uploaded by

tehreembuterfly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

PRACTICAL#06:

OBJECT:

Create Hospital database with following tables:

Patient table: (Patient_id, Name, Address, Doctor_Name, Admit_Date,


Discharge_Status, Discharge_Date & Charges).
Status table: (Patient_id, Date, Doctor_id, Test report & diseas).
i. Create Patient_id & input 10 records.
ii. Search all patient under the treatment of particular Doctor named Dr.
Amin.
iii. Update the prescription of a particular patient.
iv. Delete all Patient records, which are discharged.
Procedure:
A) Creating Tables:
1. Click File from menu bar and click New.
2. Click the Blank Database.

3. Write the file name for Database in file name box e.g. Hospital Database.

i) Creating Patient Table:


4. Click Table button form object panel from Database window. Double click “Create Table in
Design view” from three given option.

A window appears with three columns Field Name, Data type, Description.
I) Entering Fields:
5. Type Patient_id in first field & Press Tab key to switch to next column with heading
Data Type. A list triangle appears & selects a type from the list.
6. Press Tab key to go to Description column of the field. (Optional)
7. Repeat 4 & 5 for entering Name, Address, Doctor_Name, Admit_Date, Discharge_Status,
Discharge_Date & Charges fields.

8. Right click the field “Roll No”, click the primary key from this menu. It will set the Roll No
as a primary key.

9. Click save button or press CTRL+S. Save as dialog box appears.


10. Type table name Patient table, and click ok. Click close button.
II) Entering Record:
11. Double click in Patient table in Data base window. OR Click Patient table then view menu
then click Datasheet view. (A window appears). Enter records here.
12. Press CTRL+S to save records. Click Close button.

ii) Creating Status Table:


I) Entering Fields:
13. For creating Status table , Repeat steps 4 to 6 & enter fields Patient_id, Date, Doctor_id, Test
report, Prescription, & Diseases.
14. Click save button or press CTRL+S. (save as dialog box appears). Type table name Status &
click OK.
II) Entering Records:
15. Repeat Step 11 to 12 & enter records in Status table.

B) Creating relationship between tables:


16. Close Patient table & Status table by clicking close button.
17. Click tool from menu bar then click Relationship form pull down menu OR right the click
the bear area of Datasheet window, click Relationship from shortcut menu.
A window with title Relationship appears.

18. Click show table. All created tables appear in show table box.

19. Select Patient table & click Add. Click Status table, click Add. Click close button.
20. Click Patient field of Patient table, drag the mouse tills field of Status table.
21. Click Enforce Referential integrity then click create button.
A Relationship between two tables appear.
22. Click Enforce Referential integrity then click create button.

A Relationship between two tables appears.


23. Save Relationship by pressing CTRL+S & close the Relationship window.

Searching Dr. Amin’s Patient:


By Query:
24. Click Queries button in object panel. Double click Create Query In Design View.

Show Table dialog box opens.

25. Click Patient Table click Add, then click Status Table, click Add then close show Table
dialog Box. The tables appear boxes in select query window.
26. Double click the field Name, Dr_Name, Date, Dr.id, Test report, Prescription & diseases.
27. Select criteria, Dr_Name cell type Dr. Amin to see patients of Dr. Amin.

28. Press CTRL+S to save the Query. A saving window appears, enter a name for Query e.g.
Query1 & click OK.
29. Click Run button on tool bar Or choose Query, Run.
A query is performed & all Patients of Dr. Amin are displayed in a table.
Updating Desired Record:
By Query:
30. To create another Query repeat step 23 to 25.
31. Click in Patient Name, criteria cell. Type a Patient name e.g. “Danish” to update Prescription
of Particular patient.
37. Press CTRL+S to save the Query. A saving window appears, enter a name for Query e.g.
Query2 & click OK.
32. Click Run button on tool bar OR choose Query, Run.
A query is performed & Danish record is displayed in a table.
33. Replace the Prescription with Panadol.

Deleting Desired Records:


By Query:
34. To create another Query repeat step 23 to 25.
35. Click Discharge, criteria cell. Type Yes, to delete the records of discharged patients.
36. Click Run button on tool bar OR choose Query, Run.

37. Select records; Right click the button with triangle the left of record. Click delete.
38. Press CTRL+S to save the Query. A saving window appears, enter a name for Query e.g.
Query3 & click OK.

Now the records are:

You might also like