You are on page 1of 22

International Islamic University Chittagong

Final Project

Project name:Doctor’s Appointment System


Department:Computer Science & Engineering
Course Title:Database Management System
Course Code:CSE-2424
Semester: 4th
Section: 4AF
Email id:c191208@ugard.iiuc.ac.bd
Submission date:10th june ,2021
Submitted To:
Mohammad Aman Ullah Assistant Professor, CSE,IIUC
Submitted By-------->
Name:Israt Jahan Tamanna
ID:C191208
Project name: Doctor’s Appointment System
ID:C191208
Page no:01

Introduction of Doctor’s Appointment System:


A Doctor’s
appointment booking system ,available on the internet ,allows patients
to book an appointment from the comfort of their homes ,using their
computer,laptop or mobile,and at any time.No matter where they
are,they can contact doctors of their choice in any location.It is an
emotional association between the doctor and a patient which arises
when the doctor in a professional capacity:interact with the patient.
The relationship begins when a person who is ill or believe that he is ill
consult doctor.
The success or otherwise depend on various factors including the nature
of the relationship the exist between the doctors and the patients.
Shows that online appointment system is a system which a patient can
easily access to the website and book their appointments.
In this way the patient give the additional.Information to the doctor
when they arrives and giving the doctor time to prepare thw necessary
information.
Project name: Doctor’s Appointment System
ID:C191208
Page no:02

Doc Na Age
day me
_id
Doc_tim
e
Pat_id

Appoint
system Patient

Booking_i
Doc_id
d s

Name

Appointment specialit Pat_ Se


details y loca x
Health_iss tion
ue

Preferred
Doc_locat
Doc_speci time
ion
alization
Pat_id

Bill date

Time slot
Bill

Bill Range
Bill
status
number id
Project name: Doctor’s Appointment System
ID:C191208
Page no:03

Table: SQL

1.Doctor:
CREATE TABLE
“DOCTOR”(DOC_ID”VARCHAR2(40),”NAME”VRCHAR2(20),”DAYS”VARCHAR2(100)
,”DOC_TIME”VARCHAR2(24),”DOC_LOCATION”VARCHAR(40),”DOC_SPECIALITY”V
ARCHAR2(50),CONSTANT”DOCTOR_PK”PRIMARY KEY (“DOC_ID”)ENABLE)/

2.Patient:
CREATE TABLE “PATIENT”
( “PAT_ID “VARCAHR2(10),
“NAME”VARCHAR2(50),
“AGE”VRCHAR2(100),
“SEX”VARCHAR2(5),
“PAT_LOCTION”VARCHAR(40),
CONSTANT “PATIENT_PK”PRIMARY KEY (PAT_ID”)ENABLE,
)
Project name: Doctor’s Appointment System
ID:C191208
Page no:04

3.Appointment_Details:

CREATE TABLE”APPOINTMENT _DETAILS”


( “BOOKING_ID”VARCHAR2(20),
“HEALTH_ISSUE”VRCHAR2(100),

“PAT_ID”VARCHAR2(100),
“DOC_ID”VARCHAR2(15),
“PREFFERED_TIME”VARCHAR2(400),
CONSTRANT “APPOINTMENT_DETAILS_OK”PRIMARY KEY (“BOOKING_ID”)
ENABLE,

CONSTRANT “APPOINTMENT_DETAILS_OK”FOREIGN KEY “(DOC_ID”)


REFERENCES “DOCTORS” (“DOC_ID”)ENABLE,
CONSTRANT “APPOINTMENT_DETAILS_OK”FOREIGN KEY (“PAT_ID”)
REFERENCES “PATIENT”(PAT_ID”)ENABLE
)

4.Time Slots:

CREATE TABLE “TIME_SLOTS”(“ID”VARCHAR2(20),”RANGE”


VARCHAR2(12),CONSTRANT”TIME_SLOTS_PK”PRIMARY(“ID”)
ENABLE)/
Project name: Doctor’s Appointment System
ID:C191208
Page no:05

5.BILL:
CREATE TABLE “BILL”
( “BILL_NUMBER”VARCHAR2(40)’
“BILL_DATE”VARCHAR2(31),
“BILL_STATUS”VARCHAR2(40),

CONSTRANT”BILL_PK”PRIMARY KEY(“BILL_NUMBER”)ENABLE
)
/
Project name: Doctor’s Appointment System
ID:C191208
Page no:06

Table & Data 1:


For doctor:
Project name: Doctor’s Appointment System
ID:C191208
Page no:07

Table & Data 2:


For patient:
Project name: Doctor’s Appointment System
ID:C191208
Page no:08

Table & Data 3:


For Appointment details:
Project name: Doctor’s Appointment System
ID:C191208
Page no:09

Table & Data 4:


For Bill:
Project name: Doctor’s Appointment System
ID:C191208
Page no:10

Table & Data 5:


For Time Slots:
Project name: Doctor’s Appointment System
ID:C191208
Page no:11

DML STATEMENT:
QUERY: Search data from individual table
1.
select *
from DOCTOR;

2.
Select*
From PATIENT;
Project name: Doctor’s Appointment System
ID:C191208
Page no:12

3.
select *
from PATIENT
where pat_id='p1';

4.
select*
from PATIENT
where pat_id='p9';
Project name: Doctor’s Appointment System
ID:C191208
Page no:13
5.
select doc_id,name,doc_location
from DOCTOR;

6.
select *
from DOCTOR
where doc_location='chittagong';
Project name: Doctor’s Appointment System
ID:C191208
Page no:14

7.
select*
from BILL
where bill_date='6-MAY-21';

8.
select *
from PATIENT
where name LIKE'S%';
Project name: Doctor’s Appointment System
ID:C191208
Page no:15

9.
select health_issue,preferred_time
from APPOINTMENT_DETAILS;

10.
select *
from APPOINTMENT_DETAILS
where preferred_time='23-MAY-21';
Project name: Doctor’s Appointment System
ID:C191208
Page no:16

11.
select max(range),min(range)
from TIME_SLOTS;

Query: Search data from multiple table


1.
select distinct pat_id,name
from PATIENT
natural join APPOINTMENT_DETAILS;
Project name: Doctor’s Appointment System
ID:C191208
Page no:17

2.
select pat_id,name,preferred_time
from PATIENT natural join APPOINTMENT_DETAILS
where preferred_time='01-JAN-21';

3.
select P.pat_id,P.name,A.booking__id
from PATIENT P,APPOINTMENT_DETAILS A
where P.pat_id=A.pat_id and booking__id='b111';

4.
select doc_id,preferred_time
from DOCTOR natural join APPOINTMENT_DETAILS
where name='Maria';
Project name: Doctor’s Appointment System
ID:C191208
Page no:18
5.
select doc_id,pat_id,doc_location,doc_specilization
from DOCTOR natural join APPOINTMENT_DETAILS;

Sub-Query:
1.
select *
from DOCTOR
where name Like(select name
from DOCTOR
where name ='Tina');
Project name: Doctor’s Appointment System
ID:C191208
Page no:19

2.
select pat_id,name,age
from PATIENT
where age>(select AVG (age)
from PATIENT);

3.
select pat_id,name,sex
from PATIENT
where pat_id=(select pat_id
from APPOINTMENT_DETAILS
where doc_id='d1');
Project name: Doctor’s Appointment System
ID:C191208
Page no:20

4.
select pat_id,name,age
from PATIENT
where age=(select min(age)
from PATIENT);

PL/SQL:
DECLARE
docid DOCTOR.doc_id%type;
dname DOCTOR.d_name%type;
days DOCTOR.days%type;
BEGIN

SELECT doc_id,d_name,days INTO docid,dname,days


FROM DOCTOR
WHERE doc_id=:docid ;
dbms_output.put_line('the details of '||dname||' is:');
dbms_output.put_line('docid:'||docid);

dbms_output.put_line('days:'||days);
END;
Project name: Doctor’s Appointment System
ID:C191208
Page no:21

The details of Megna is :

Docid:d123

Days:Tuesday

Statement processed.
0.00 second

You might also like