Docsity

Database Management System Case Studies, Slides of Design of Wood Structures

Toggle sidebar
bg1
DatabaseManagementSystem
CaseStudies
CaseStudy1
HospitalManagementSystem
Aim: XYZhospitalisamultispecialtyhospitalthatincludesanumberofdepartments,rooms,
doctors,nurses,compounders,andotherstaffworkinginthehospital.Patientshavingdifferent
kindsofailmentscometothehospitalandgetcheckupdonefromtheconcerneddoctors.If
requiredtheyareadmittedinthehospitalanddischargedaftertreatment.
Theaimofthiscasestudyistodesignanddevelopadatabaseforthehospitaltomaintainthe
recordsofvariousdepartments,rooms,anddoctorsinthehospital.Italsomaintainsrecordsof
theregularpatients,patientsadmittedinthehospital,thecheckupofpatientsdonebythe
doctors,thepatientsthathavebeenoperated,andpatientsdischargedfromthehospital.
Description:Inhospital,therearemanydepartmentslikeOrthopedic,Pathology,Emergency,
Dental,Gynecology,Anesthetics,I.C.U.,BloodBank,OperationTheater,Laboratory,M.R.I.,
Neurology,Cardiology,CancerDepartment,Corpse,etc.ThereisanOPDwherepatientscome
andgetacard(thatis,entrycardofthepatient)forcheckupfromtheconcerneddoctor.After
makingentryinthecard,theygototheconcerneddoctor’sroomandthedoctorchecksup
theirailments.Accordingtotheailments,thedoctoreitherprescribesmedicineoradmitsthe
patientintheconcerneddepartment.Thepatientmaychooseeitherprivateorgeneralroom
accordingtohis/herneed.Butbeforegettingadmissioninthehospital,thepatienthastofulfill
certainformalitiesofthehospitallikeroomcharges,etc.Afterthetreatmentiscompleted,the
doctordischargesthepatient.Beforedischargingfromthehospital,thepatientagainhasto
completecertainformalitiesofthehospitallikebalancecharges,testcharges,operation
charges(ifany),bloodcharges,doctors’charges,etc.
Nextwetalkaboutthedoctorsofthehospital.Therearetwotypesofthedoctorsinthe
hospital,namely,regulardoctorsandcallondoctors.Regulardoctorsarethosedoctorswho
cometothehospitaldaily.Callsondoctorsarethosedoctorswhoarecalledbythehospitalif
theconcerneddoctorisnotavailable.
TableDescription:
FollowingarethetablesalongwithconstraintsusedinHospitalManagementdatabase.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Database Management System Case Studies and more Slides Design of Wood Structures in PDF only on Docsity!

Database Management System

Case Studies

Case Study 1

Hospital Management System

Aim: XYZ hospital is a multi specialty hospital that includes a number of departments, rooms,

doctors, nurses, compounders, and other staff working in the hospital. Patients having different

kinds of ailments come to the hospital and get checkup done from the concerned doctors. If

required they are admitted in the hospital and discharged after treatment.

The aim of this case study is to design and develop a database for the hospital to maintain the

records of various departments, rooms, and doctors in the hospital. It also maintains records of

the regular patients, patients admitted in the hospital, the check up of patients done by the

doctors, the patients that have been operated, and patients discharged from the hospital.

Description : In hospital, there are many departments like Orthopedic, Pathology, Emergency,

Dental, Gynecology, Anesthetics, I.C.U., Blood Bank, Operation Theater, Laboratory, M.R.I.,

Neurology, Cardiology, Cancer Department, Corpse, etc. There is an OPD where patients come

and get a card (that is, entry card of the patient) for check up from the concerned doctor. After

making entry in the card, they go to the concerned doctor’s room and the doctor checks up

their ailments. According to the ailments, the doctor either prescribes medicine or admits the

patient in the concerned department. The patient may choose either private or general room

according to his/her need. But before getting admission in the hospital, the patient has to fulfill

certain formalities of the hospital like room charges, etc. After the treatment is completed, the

doctor discharges the patient. Before discharging from the hospital, the patient again has to

complete certain formalities of the hospital like balance charges, test charges, operation

charges (if any), blood charges, doctors’ charges, etc.

Next we talk about the doctors of the hospital. There are two types of the doctors in the

hospital, namely, regular doctors and call on doctors. Regular doctors are those doctors who

come to the hospital daily. Calls on doctors are those doctors who are called by the hospital if

the concerned doctor is not available.

Table Description:

Following are the tables along with constraints used in Hospital Management database.

  1. DEPARTMENT: This table consists of details about the various departments in the

hospital. The information stored in this table includes department name, department location, and facilities available in that department.

Constraint : Department name will be unique for each department.

  1. ALL_DOCTORS: This table stores information about all the doctors working for the

hospital and the departments they are associated with. Each doctor is given an identity number starting with DR or DC prefixes only.

Constraint : Identity number is unique for each doctor and the corresponding department should exist in DEPARTMENT table.

  1. DOC_REG: This table stores details of regular doctors working in the hospital. Doctors

are referred to by their doctor number. This table also stores personal details of doctors like name, qualification, address, phone number, salary, date of joining, etc.

Constraint : Doctor’s number entered should contain DR only as a prefix and must exist in ALL_DOCTORS table.

  1. DOC_ON_CALL: This table stores details of doctors called by hospital when additional

doctors are required. Doctors are referred to by their doctor number. Other personal details like name, qualification, fees per call, payment due, address, phone number, etc., are also stored.

Constraint : Doctor’s number entered should contain DC only as a prefix and must exist in ALL_DOCTORS table.

  1. PAT_ENTRY: The record in this table is created when any patient arrives in the hospital

for a check up. When patient arrives, a patient number is generated which acts as a primary key. Other details like name, age, sex, address, city, phone number, entry date, name of the doctor referred to, diagnosis, and department name are also stored. After storing the necessary details patient is sent to the doctor for check up.

Constraint : Patient number should begin with prefix PT. Sex should be M or F only. Doctor’s name and department referred must exist.

  1. PAT_CHKUP: This table stores the details about the patients who get treatment from

the doctor referred to. Details like patient number from patient entry table, doctor number, date of check up, diagnosis, and treatment are stored. One more field status is used to indicate whether patient is admitted, referred for operation or is a regular patient to the hospital. If patient is admitted, further details are stored in PAT_ADMIT

E‐R Diagram

Relational Database Schema for Case Study

The relational database schema for Hospital Management database is as follows:

  1. DEPARTMENT (D_NAME, D_LOCATION, FACILITIES)
  2. ALL_DOCTORS (DOC_NO, DEPARTMENT)
  3. DOC_REG(DOC_NO, D_NAME, QUALIFICATION, SALARY, EN_TIME, EX_TIME, ADDRESS, PH_NO, DOJ)

4. DOC_ON_CALL (DOC_NO, D_NAME, QUALIFICATION, FS_PR_CL, PYMT_DU, ADDRESS,

PH_NO)

5. PAT_ENTRY (PAT_NO, PAT_NAME, CHKUP_DT, PT_AGE, SEX, RFRG_CSTNT, DIAGNOSIS,

RFD, ADDRESS, CITY, PH_NO, DEPARTMENT)

6. PAT_CHKUP (PAT_NO, DOC_NO, DIAGNOSIS, STATUS, TREATMENT)

7. PAT_ADMIT (PAT_NO, ADV_PYMT, MODE_PYMT, ROOM_NO, DEPTNAME, ADMTD_ON,

COND_ON, INVSTGTN_DN, TRMT_SDT, ATTDNT_NM)

8. PAT_DIS (PAT_NO, TR_ADVS, TR_GVN, MEDICINES, PYMT_GV, DIS_ON)

9. PAT_REG (PAT_NO, DATE_VIS, CONDITION, TREATMENT, MEDICINES, DOC_NO, PAYMT)

10. PAT_OPR (PAT_NO, DATE_OPR, IN_COND, AFOP_COND, TY_OPERATION, MEDICINES,

DOC_NO, OPTH_NO, OTHER_SUG)

11. ROOM_DETAILS (ROOM_NO, TYPE, STATUS, RM_DL_CRG, OTHER_CRG)

  1. The in‐between stoppage stations and their bookings are not considered.

Description of Tables and Procedures

Tables and procedures that will be created are as follows:

  1. TrainList: This table consists of details about all the available trains. The information stored in this table includes train number, train name, source, destination, fair for AC ticket, fair for general ticket, and weekdays on which train is available.

Constraint : The train number is unique.

  1. Train_Status: This table consists of details about the dates on which ticket can be booked for a train and the status of the availability of tickets. The information stored in this table includes train number, train date, total number of AC seats, total number of general seats, number of AC seats booked, and number of general seats booked.

Constraint : Train number should exist in TrainList table.

  1. Passenger: This table consists of details about the booked tickets. The information stored in this table includes ticket ID, train number, date for which ticket is booked, name, age, sex and address of the passenger, status of reservation (either confirmed or waiting), and category for which ticket is booked.

Constraint : Ticket ID is unique and the train number should exist in TrainList table.

  1. Booking: In this procedure, the train number, train date, and category is read from the passenger. On the basis of the values provided by the passenger, corresponding record is retrieved from the Train_Status table. If the desired category is AC, then total number of AC seats and number of booked AC seats are compared in order to find whether ticket can be booked or not. Similarly, it can be checked for the general category. If ticket can be booked, then passenger details are read and stored in the Passenger table.

5. Cancel: In this procedure, ticket ID is read from the passenger and corresponding record is

searched in the Passenger table. If the record exists, it is deleted from the table. After deleting the record (if it is confirmed), first record with waiting status for the same train and same category are searched from the Passenger table and its status is changed to confirm.

E‐R diagram

Pages to be created

Customer Rental Report

Artist Report

Return to Owner Report

department data by removing an employee who is the sole person assigned to a department.

Certain updates require careful propagation of changes throughout the database. Careful

decomposition can take care of these problems. The employee data makes an obvious grouping

and should be decomposed the get it into at least 2NF. It will actually go to BCNF as there are

no further problems. It is ready to become a table.

EMPLOYEE E# ENAME EADDR 12 DAVIS 111 FIRST ST 78 SPENCE 222 SECOND ST 66 MURPHY 100 MAIN ST 77 SMITH 300 BROAD ST 99 WILSON 111 FIRST ST

The Dept relation is another logical decomposition to remove the partial dependency and move

to 2NF. Careful examination reveals the transitive dependency still exists so further

decomposition is necessary.

DEPT D# DNAME DLOCN

1 PRESSING ALCOA

2 WELDING NIOTA

9 PACKING LOUDON

7 PAYROLL MEMPHIS

5 MAILROOM ONEIDA

Job‐Worked winds up looking like the original relation’s key. All three attributes are still the

composed key. Since there are no dependencies, there is nothing to prevent this relation from

being BSNF so it is ready too.

JOB- WORKED E#

D# JOB

12 1 HELPER

78 1 HELPER

66 2 ELECTRICIAN

77 9 FOREMAN

99 7 CLERK

12 1 CLERK

78 1 CLERK

12 5 CLERK

To remove the transitive dependency, we will decompose Dept into Department and Dept‐ Locn.

Each of these is now in BCNF.

DEPARTMENT D# DNAME 1 PRESSING 2 WELDING 9 PACKING 7 PAYROLL 5 MAILROOM

DEPT-LOCN D# DLOCN

1 ALCOA

2 NIOTA

9 LOUDON

7 MEMPHIS

5 ONEIDA

For the above business stories you are expected to create the following.

1. Analyze the data required.

2. Normalize the attributes.

3. Create the logical data model (ER diagrams).