Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

1

PROBLEM STATEMENT

This project aims to build a web application that will facilitate the interaction
between the doctors and patients .This system will maintain the data base of
the patients that indicates the recovery of the previous treatment that builds a
reference to the upcoming doctors which helps for the prescription and fetch
the details of the patients.This medicard will also enables the particulars of the
upcoming doctors prescription in the web application.
2

DATA REQUIREMENTS

ENTITIES

 Patient
 Doctor
 Hospital

ATTRIBUTES

 Patient

1.mid
2.pname
3.ps
4.pd
5.pme
6.hid
7.did

 Doctor

1.mid
2.did
3.dname

 Hospital

1.hid
2.hname
3.haddress
3

ER Diagrams

dname
did mid

Doctor

Treats Present in
pme did

hid

mid Patient pname


Hospital

pd ps
hid hname haddress
4

E-R DIAGRAMS TO RELATIONS

Patient:

mid pname ps pd

Doctor:

did mid dname

Hospital:

hid hname haddress

Treats:

did hid pme


5

NORMALIZATION
First Normal Form:
A table is said to be in First Normal Form if and only if all attributes have atomic
values.
Patient:
mid  pname,ps,pd,pme,hid,did

It Is in First Normal Form

Doctor:

did  mid,dname

It is in first normal form

Hospital:

did  did,hname

It is in first normal form

Treats:
did  hid,pme

It is in first normal form


Second Normal Form:
A table is said to be in Second Normal Form if it is in First Normal Form and every
non-key attribute is irreducibly dependent on every key.

Patient:
mid  pname,ps,pd,pme,hid,did

It Is in Second Normal Form

Doctor:

did  mid,dname

It is in Second normal form

Hospital:

hid  did,hname

It is in Second normal form

Treats:
did  hid,pme

It is in Second normal form


Third Normal Form:
A table is said to be in Third Normal Form if it is in Second Normal Form and every non
key attribute is non transitively dependent on every non key.

Patient:
mid pname,ps,pd,pme,hid,did

It Is in Third Normal Form

Doctor:

did mid,dname

It is in Third normal form

Hospital:

hid did,hname

It is in Third normal form


Boyce–Codd normal form (BCNF):
A table is said to be in BCNF if every determinant is a key.

Patient:
mid  pname,ps,pd,pme,hid,did

It Is in BCNF Normal Form

Doctor:

did mid,dname

It is in BCNF normal form

Hospital:

hid did,hname

It is in BCNF normal form


Fourth Normal form:

A relation is said to be in 4NF then it should be in BCNF and it should not


contain multi valued dependency.

Patient:
mid pname,ps,pd,pme,hid,did

It Is in Fourth Normal Form

Doctor:

did  mid,dname

It is in Fourth normal form

Hospital:

hid did,hname

It is in Fourth normal form


CREATION OF TABLES
Patient table:

Create table patient (mid int, pname varchar2(50), ps varchar(20),pd


varchar2(20),primary key(cid));

Doctor table:

Create table doctor (did int, mid int, dname varchar2(50), primary key(did),
foreign key(mid) references patient(mid));

Hospital table:

Create table hospital (hid int,hname varchar2(50),haddress varchar2(50),primary


key(hid));

7.SAMPLE DATA

Patient:
insert into patient values (100000 , ’Rakesh’ ,’Male’ ,’HeartFailure’
,’Digoxin’, 200000,300000);

mid pname ps pd pme did hid


100000 Rakesh Male HeartFailure Digoxin 200 300
100001 Yaswanth Male Diptheria Erythromycin 201 301
100002 Pavan Male TB Rifamcin 202 302

Doctor:

insert into doctor values(200,100000,’Dr.Ramesh’);

did mid dname


200 100000 Dr.Ramesh
201 100001 Dr.Sharath Babu
202 100002 Dr.RajyaLakshmi

Hospital:
insert into hospital values(300,’Ramesh Hospitals’,’Vijayawada’);

hid hname address


300 Ramesh Hospitals Vijayawada
301 Vijaya Hospitals Machilipatnam
302 Shanthi Hospitals Amalapuram

You might also like