Sei sulla pagina 1di 8

Hospital Management System

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.

2. Data types and its description: Fields in database table have a data type. Some of the data types used in database table are explained below. a) Integer:One optional sign character (+ or -) followed by atleast one digit (0-9). Leading and trailing blanks are ignored. No other character is allowed. b) Varchar:It is used to store alpha numeric characters. In this data type we can set the maximum number of characters upto 8000 ranges by default SQL server will set the size to 50 characters large. 19

Hospital Management System c) Date/Time:Date/Time data type is used for representing data or time.

Patient Table:
Fields
Pid name age weight gender address phoneno disease doctorid

Data Type
Varchar(5) Varchar(20) int int Varchar(10) Varchar(50) int Varchar(20) Varchar(5)

Relationships
Primary Key Not Null Not Null Not Null Not null Not Null Not Null Not Null Not Null

Doctor Table:
Fields
doctorid doctorname dept

Data Type
Varchar(5) Varchar(15) Varchar(15)

Relationships
Primary Key Not Null Not Null

20

Hospital Management System

Lab Table:
Fields
labno pid weight doctorid date category patient_type amount

Data Type
Varchar(5) Varchar(5) int Varchar(5) Date/Time Varchar(15) Varchar(15) int

Relationships
Primary Key Not Null Not Null Foreign Key Not Null Not Null Not Null Not Null

Inpatient Table:
Fields
pid room_no date_of_adm date_of_dis advance labno

Data Type
Varchar(5) Varchar(50) Date/Time Date/Time int Varchar(5)

Relationships
Primary Key Not Null Not Null Not Null Not Null Foreign Key

Outpatient Table:
Fields
pid date labno

Data Type
Varchar(5) Date/Time Varchar(5)

Relationships
Primary Key Not Null Foreign Key

21

Hospital Management System

Room Table:
Fields
room_no room_type status

Data Type
Varchar(50) Varchar(10) Varchar(10)

Relationships
Primary Key Not Null Not Null

Bill Table:
Fields
bill_no pid patient_type doctor_charge medicine_charge room_charge oprtn_charge no_of_days nursing_charge advance health_card lab_charge bill

Data Type
Varchar(50) Varchar(5) Varchar(10) int int int int int int int Varchar(50) int int

Relationships
Primary Key Foreign Key Allow Null Not Null Not Null Not Null Allow Null Allow Null Allow Null Allow Null 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.

Entity:Entity is the thing which we want to store information. It is an elementary basic building block of storing information about business process. An entity represents an objects defined within the information system about which you want to store information.

Relationship:A relationship is named connection or association between entities used to relate two or more entities with some common attributes of meaningful interaction between the object.

Attributes:Attributes are the properties of the entities and relationship. Descriptor of the entity. Attributes are elementary pieces of information attached to an entity.

23

Hospital Management System Symbols Meaning Entity

Relationship

Attribute

Key Attribute

E1

E2

Cardinality Ratio N: 1 for E1: E2 in R

24

Hospital Management System

E-R Diagram
age gender address phone no disease dept patient

pid

name weight doctorid

Consults Doctorid doctor Doctor name

amount Checks category date pid advance


date of admission

lab no Pid

lab Report weight Decides doctorid pid lab no date

inpatient lab no room no Admitted to to issued_to


medicine charge
room charge

outpatient

date of discharge

bill no pid

status room no

room

bill
operation charge

lab charge patient type bill health card advance doctor charge

room type

no of days
nursing charge

25

Potrebbero piacerti anche