SlideShare a Scribd company logo
1 of 27
HOSPITAL MANAGEMENT SYSTEM
Sasui Hidatyatullah lohar 2k12/BsIt/73
University of Sindh jamshoro
 As we know that the manual system is too much difficult
to handle the record in our daily life. In the present era
of globalization and advanced technology efficient
record keeping cannot be overemphasized. Imagine the
scenario when the manual processes and manual
modes of instruction get replaced with electronic
systems. One of such replacement can be done in the
area of patient’s database management system within a
hospital. Developing patient database management
system software would benefit the hospital management
who can have effortless access to the data securely and
more easilsy.Hospitals are not excluded in record
keeping. The records kept include patient data, which
help to maintain patient’s medical records.
TABLES USED IN DATABASE
 Patients table
 Doctors table
 Specialization table
 Ward table
 Disease table
QUERIES USED
 Insert into
 Delete row
 Update
 Alter
 Add colum
 Delete column
 Rename column
 Joining
 FK constraint
 PK constraint
 CHECK constraint
CREATE TABLE PATIENTS
 create table patients
(patient_no number(5) not null,name varchar(20)not
null,father_name varchar(20)not null,age
number(3),address varchar(20),gender
varchar(20),admitt_date date, dischar_date
date,fee_paid number (10)not null,nic varchar(20));
ADD COLUMN
 Alter table patients
add(Ward_No, Dr_Name varchar(30),Disease_No
varchar(30));
CONSTRAINTS IN PATIENTS TABLE
 alter table patients
add(constraint patient_pk PRIMARY
KEY(Patient_No));
 alter table patients
add(constraint wardp_fk FOREIGN
KEY(Ward_No)references Ward(Ward_No));
 alter table patients
 add constraint nic_unique UNIQUE (nic);
 alter table patients
add(constraint disease_fk FOREIGN
KEY(Disease_No)references
Disease(Disease_No));
 alter table patients
add constraint check_gender CHECK(gender
IN('F','M'));
UPDATE THE PATIENTS TABLE
 set update patients
disease_no='3'
where patient_no=4;
DELETE THE ROW FROM PATIENTS
 delete from patients
where patient_no=2;
DELETE COLUMN & RENAME
 Alter table patients
DROP column Age;
 Rename the column
 alter table patients
rename column feepaid to Fees_Paid;
JOINING
 select p.name,d.name
from patients p,doctors d
where p.patient_no=d.ward_no;
Result
DOCTORS TABLE
 Create table doctors
(name varchar(30)not null,duty_time
varchar(20),shift varchar(20),time
varchar(20),Ward_No number (2),Specialist_No
varchar(5));
CONSTRAINTS USED IN DOCTORS TABLE
 alter table doctors
add(constraint ward_fk FOREIGN
KEY(Ward_No)references Ward(Ward_No));
 alter table doctors
add(constraint special_fk FOREIGN
KEY(Specialist_No)references
specialization (Specialist_No));
 alter table doctors
add constraint check_shift CHECK(shift IN(‘E','M'));
INSERT, UPDATE,DELETE IN DOCTORS
 insert into doctors
values('Ali','8:30to2:30','M','null','No',1,'p2');
 delete from doctors
where name='Ali'
 update doctors
set name='Ali Hydar'
where name='Ali'
DOCTORS TABLE
CREATE WARD TABLE
 Create table ward
(ward_No number (2),ward_name varchar(20));
 alter table ward
add (constraint wardNo_pk PRIMARY KEY
(ward_no));
 alter table ward
add (constraint wardName_unique UNIQUE
(ward_name));
INSERT,UPDATE,DELETE WARD
 insert into ward
values(1,'Surgery');
update ward
set ward_name='Daignostic'
where ward_no=1
delete from ward
where ward_no=1;
WARD TABLE
CREATE SPECIALIZATION TABLE
 Create table specialization
(specialist_No varchar(20),specialization_In
varchar(30));
Alter table specialization
add(constraint specialist_pk PRIMARY
KEY(Specialist_No));
INSERT INTO SPECIALIZATION
 insert into specialization
values('p1','paediatrics');
SPECIALIZATION TABLE
DELETE ROW FROM SPECIALIZATION
delete from specialization
where specialist_no='p1'
UPDATE SPECIALIZATION
 update specialization
set specailization_in='psycatrist'
where specialist_no='p2'
DISEASE TABLE
Alter table Disease
add(constraint disease_pk PRIMARY
KEY(Disease_No));
INSERT ,UPDATE IN DISEASE
 insert into disease
values(1,'fever');
 update disease
set disease_name='null'
where disease_no=10;
DELETE ROW FROM DISEASE
 delete from disease
where disease_no=1;

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

sasui73_DataBase_ASSIGNMENT

  • 1. HOSPITAL MANAGEMENT SYSTEM Sasui Hidatyatullah lohar 2k12/BsIt/73 University of Sindh jamshoro
  • 2.  As we know that the manual system is too much difficult to handle the record in our daily life. In the present era of globalization and advanced technology efficient record keeping cannot be overemphasized. Imagine the scenario when the manual processes and manual modes of instruction get replaced with electronic systems. One of such replacement can be done in the area of patient’s database management system within a hospital. Developing patient database management system software would benefit the hospital management who can have effortless access to the data securely and more easilsy.Hospitals are not excluded in record keeping. The records kept include patient data, which help to maintain patient’s medical records.
  • 3. TABLES USED IN DATABASE  Patients table  Doctors table  Specialization table  Ward table  Disease table
  • 4. QUERIES USED  Insert into  Delete row  Update  Alter  Add colum  Delete column  Rename column  Joining  FK constraint  PK constraint  CHECK constraint
  • 5. CREATE TABLE PATIENTS  create table patients (patient_no number(5) not null,name varchar(20)not null,father_name varchar(20)not null,age number(3),address varchar(20),gender varchar(20),admitt_date date, dischar_date date,fee_paid number (10)not null,nic varchar(20));
  • 6. ADD COLUMN  Alter table patients add(Ward_No, Dr_Name varchar(30),Disease_No varchar(30));
  • 7. CONSTRAINTS IN PATIENTS TABLE  alter table patients add(constraint patient_pk PRIMARY KEY(Patient_No));  alter table patients add(constraint wardp_fk FOREIGN KEY(Ward_No)references Ward(Ward_No));  alter table patients  add constraint nic_unique UNIQUE (nic);
  • 8.  alter table patients add(constraint disease_fk FOREIGN KEY(Disease_No)references Disease(Disease_No));  alter table patients add constraint check_gender CHECK(gender IN('F','M'));
  • 9. UPDATE THE PATIENTS TABLE  set update patients disease_no='3' where patient_no=4;
  • 10. DELETE THE ROW FROM PATIENTS  delete from patients where patient_no=2;
  • 11. DELETE COLUMN & RENAME  Alter table patients DROP column Age;  Rename the column  alter table patients rename column feepaid to Fees_Paid;
  • 12. JOINING  select p.name,d.name from patients p,doctors d where p.patient_no=d.ward_no; Result
  • 13. DOCTORS TABLE  Create table doctors (name varchar(30)not null,duty_time varchar(20),shift varchar(20),time varchar(20),Ward_No number (2),Specialist_No varchar(5));
  • 14. CONSTRAINTS USED IN DOCTORS TABLE  alter table doctors add(constraint ward_fk FOREIGN KEY(Ward_No)references Ward(Ward_No));  alter table doctors add(constraint special_fk FOREIGN KEY(Specialist_No)references specialization (Specialist_No));  alter table doctors add constraint check_shift CHECK(shift IN(‘E','M'));
  • 15. INSERT, UPDATE,DELETE IN DOCTORS  insert into doctors values('Ali','8:30to2:30','M','null','No',1,'p2');  delete from doctors where name='Ali'  update doctors set name='Ali Hydar' where name='Ali'
  • 17. CREATE WARD TABLE  Create table ward (ward_No number (2),ward_name varchar(20));  alter table ward add (constraint wardNo_pk PRIMARY KEY (ward_no));  alter table ward add (constraint wardName_unique UNIQUE (ward_name));
  • 18. INSERT,UPDATE,DELETE WARD  insert into ward values(1,'Surgery'); update ward set ward_name='Daignostic' where ward_no=1 delete from ward where ward_no=1;
  • 20. CREATE SPECIALIZATION TABLE  Create table specialization (specialist_No varchar(20),specialization_In varchar(30)); Alter table specialization add(constraint specialist_pk PRIMARY KEY(Specialist_No));
  • 21. INSERT INTO SPECIALIZATION  insert into specialization values('p1','paediatrics');
  • 23. DELETE ROW FROM SPECIALIZATION delete from specialization where specialist_no='p1'
  • 24. UPDATE SPECIALIZATION  update specialization set specailization_in='psycatrist' where specialist_no='p2'
  • 25. DISEASE TABLE Alter table Disease add(constraint disease_pk PRIMARY KEY(Disease_No));
  • 26. INSERT ,UPDATE IN DISEASE  insert into disease values(1,'fever');  update disease set disease_name='null' where disease_no=10;
  • 27. DELETE ROW FROM DISEASE  delete from disease where disease_no=1;