Академический Документы
Профессиональный Документы
Культура Документы
com
www.buystudentprojects.com
DATABASE DESIGN
1. Description
A database is a collection of information and is systematically
stored in tables in the form of rows and columns. The table in the
database has unique name that identifies its contents. The
database in turn is further described in detail giving all the fields
used with the data types, constraints available, primary key and
foreign key.
Database design is used to manage large bodies of information.
In this database we describe all the 4 tables available in the
software, which are used to store all the records.
www.freestudentprojects.com www.sourcecodefiles.com
www.buystudentprojects.com
Patient Table:
Fields
Data Type
Relationships
Pid
name
age
weight
gender
address
phoneno
disease
doctorid
Varchar(5)
Varchar(20)
int
int
Varchar(10)
Varchar(50)
int
Varchar(20)
Varchar(5)
Primary Key
Not Null
Not Null
Not Null
Not null
Not Null
Not Null
Not Null
Not Null
Doctor Table:
Fields
Data Type
Relationships
doctorid
doctorname
dept
Varchar(5)
Varchar(15)
Varchar(15)
Primary Key
Not Null
Not Null
www.freestudentprojects.com www.sourcecodefiles.com
www.buystudentprojects.com
20
Hospital Management System
Lab Table:
Fields
Data Type
Relationships
labno
pid
weight
doctorid
date
category
patient_type
Varchar(5)
Varchar(5)
int
Varchar(5)
Date/Time
Varchar(15)
Varchar(15)
Primary Key
Not Null
Not Null
Foreign Key
Not Null
Not Null
Not Null
amount
int
Not Null
Inpatient Table:
Fields
Data Type
Relationships
pid
room_no
date_of_adm
date_of_dis
advance
Varchar(5)
Varchar(50)
Date/Time
Date/Time
int
Primary Key
Not Null
Not Null
Not Null
Not Null
www.freestudentprojects.com www.sourcecodefiles.com
www.buystudentprojects.com
labno
Varchar(5)
Foreign Key
Outpatient Table:
Fields
Data Type
Relationships
pid
date
labno
Varchar(5)
Date/Time
Varchar(5)
Primary Key
Not Null
Foreign Key
21
Room Table:
Fields
Data Type
Relationships
room_no
room_type
status
Varchar(50)
Varchar(10)
Varchar(10)
Primary Key
Not Null
Not Null
Bill Table:
Fields
Data Type
Relationships
bill_no
pid
patient_type
doctor_charge
medicine_charge
room_charge
oprtn_charge
no_of_days
nursing_charge
advance
Varchar(50)
Varchar(5)
Varchar(10)
int
int
int
int
int
int
int
Primary Key
Foreign Key
Allow Null
Not Null
Not Null
Not Null
Allow Null
Allow Null
Allow Null
Allow Null
www.freestudentprojects.com www.sourcecodefiles.com
www.buystudentprojects.com
health_card
lab_charge
bill
Varchar(50)
int
int
Allow Null
Allow Null
Not Null
E-R Diagram
Entity relationship diagram is used in modern database
software engineering to illustrate logical structure of database. It
is a relational schema database modeling method used to model
a system and approach. This approach commonly used in
database design. The diagram created using this method is called
E-R diagram.
22
Hospital Management System
The E-R diagram depicts the various relationships among
entities considering each object as entity. Entity is represented as
diamond shape and relationship is represented as rectangle. It
depicts the relationship between data objects. The E-R diagram is
the relation that is used to conduct the data modeling activity.
information
information.
system
about
which
you
want
to
store
www.freestudentprojects.com www.sourcecodefiles.com
www.buystudentprojects.com
23
Meaning
Entity
Relationship
www.freestudentprojects.com www.sourcecodefiles.com
www.buystudentprojects.com
Attribute
Key Attribute
E1
E2
24
E-R Diagram
pid
age
weight
gender
address
name
patient
doctorid
phone no
disease
Consults
Doctorid
www.freestudentprojects.com www.sourcecodefiles.com
www.buystudentprojects.com
dept
doctor
amount
Checks
lab no
category
Pid
date
lab
Report
pid
weight
Decides
advance
date of
admission
Doctor name
inpatient
doctorid
lab no
date
bill no
Admitted to to
status
medicine charge
room no
pid
room charge
room
room type
lab no
outpatient
room no
issued_to
date of
discharge
pid
lab charge
bill
patient type
operation charge
bill
no of days
nursing charge
health
card
25
advance
doctor charge