0% found this document useful (0 votes)
10 views7 pages

Database

The document describes a hospital's patient information system consisting of four tables: Patient, Doctor, Room, and Bill. It outlines the database design, including field types and relationships, and provides sample queries for retrieving and modifying patient information. The system aims to facilitate easy access to patient details, such as room numbers and charges.

Uploaded by

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

Database

The document describes a hospital's patient information system consisting of four tables: Patient, Doctor, Room, and Bill. It outlines the database design, including field types and relationships, and provides sample queries for retrieving and modifying patient information. The system aims to facilitate easy access to patient details, such as room numbers and charges.

Uploaded by

zwe zwe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Chapter 1

Introduction
The system is a hospital’s patient information system. In this system, there are
four tables. They are Patient,Doctor,Room and Bill tables. Patient table has (Pid,
Pname,Age,Weight,Gender,Address,PhoneNo,Disease,DoctorId). Doctor table has
(DoctorId, DoctorName,Dept).Room table has (RoomId,
Pid ,RoomNo,RoomType,NumberOfDays). Bill table has (Cid, Pid,
MedicineCharge,OperationCharge, NursingCharge, RoomCharge, DoctorCharge,
Total).
This system can easily show the information of patients in a hospital. This
system intends to describe the information of patients in a hospital when a person
want to know about some information of patient such as room number, medicine
charge, doctor name, etc.

1
Chapter 2
Database Design
Patient
Field Type Null Key Default
Pid Varchar(5) No PK Null
Pname Varchar(15) Yes Null
Address Varchar(20) Yes Null

Room
Field Type Null Key Default
RoomId Varchar(10) No PK Null
RoomName Varchar(30) Yes Null
Pid Varchar(5) No FK Null
RoomType Varchar(30) Yes Null

Doctor
Field Type Null Key Default
Doctorid Varchar(10) No PK Null
DoctorName Varchar(20) Yes Null
dept Varchar(30) Yes Null

Bill
Field Type Null Key Default
Bid Varchar(5) No PK Null
Pid Varchar(5) No FK Null
MedicineCharg Int Yes Null
e
RoomCharge Int Yes Null
NurseCharge Int Yes Null
Total Int Yes Null

2
Chapter 3
ER Diagram

3
Chapter 4
Sample Queries
(1) Get the names of patient by the doctor who works in ‘Surgery’.

Select Patient.Pname
Form Patient,Doctor
Where Patient.DoctorId=Doctor.DoctorId
And Doctor.Dept= ‘Surgery’;

(2) Get the details of patient who lives in “Hall”.


Select Pid, Pname, Address,
From Patient,Room
Where Patient.Pid=Room.RoomId
AND RoomType= ‘Hall’;

(3) Add a Patient whose Id is ‘P51’, Name is ‘Daw Hla Hla’, Address is ‘Yangon’.

4
Insert into Patient values (‘P51’,’Daw Hla Hla’, ’Yangon’);

(4) Delete the details of patient whose age is 25.


Delete from Patient where Age=25;

မှတ်ချက်။ ။ မဖျက်ခင်ပုံနှင့် ဖျက်ပြီးပုံအား နှစ်ပုံစလုံးထည့်


ရန်။

(5) Change the RoomType of Room that is ‘R10’ from ‘Hall’ to ‘Private’.
Update Room
Set RoomType=‘Private’
Where RoomNo=‘R10’;
မှတ်ချက်။ ။ update မလုပ်ခင်ပုံနှင့် update လုပ်ပြီးပုံအား နှစ်
ပုံစလုံးထည့်ရန်။

(6) Create a view of doctor without their department.


Create view doctor_view as

5
Select Doctorid, DoctorName
From Doctor;
မှတ်ချက်။ ။ ပုံထည့်ရန်။
ကိုယ့် system နှင့် ပတ်သတ်သော မေးခွန်းများကိုထည့်ရန်။

Chapter 5
Conclusion
The main purpose of this system is to make the users easier to search for their desire
patient information. We can search the information about patient such as bill for patients,
doctor name of patients and other information of patients.
မှတ်ချက်။ ။ စာပိုဒ် သုံးပိုဒ်ရအောင် ရေးရန်။

6
7

You might also like