Question

In: Computer Science

I am doing a project and need an ER diagram, as well as some, create table...

I am doing a project and need an ER diagram, as well as some, create table statements in SQL.

Here is what I have so far.

My database will be a hospital management system. It will be able to keep track of patients and doctors, as well as each of their attributes, to better help organize the hospital's data. Each patient and doctor will be searchable via an id, and the user will be able to run reports as well. The goal of this database is to eliminate hard records and free up physical space.

There will be a homepage with information about the hospital along with a contact tab, and a login tab. Inside the login tab, there will be a new customer, new doctor, patient lookup, doctor lookup, and reports, allowing the user to pinpoint the exact data they need to locate at any given time.

User Requirements:

           The user will be able to search for the id or other attribute of the patient or doctor. The user will also be able to add, edit, and remove entries. They will be able to run reports and sort by type, I.D.s, alphabetically, or other. Each doctor, patient, or will have its own id, PID for patients and DID for doctors.

Data:

1.     Accumulating Data:

This data will be for things like how many beds have been used at the time the patient is admitted, how many visits the patient has had, how many patients the doctor has seen, etc.

2.     Unchangeable Data:

This data will be used for ensuring each patient and doctor has their own unique identifying number

3.     User Specified Data:

This data will be what the user types in that will be unique to each entry. For the patients, the user will have to enter things like: Patient name, the room number they are being admitted to, admission date, discharge date, contact phone number for the patient, DOB for the patient, their address, a description of their problem, gender, and other relevant information. Doctors will each have their own information too, such as name, what they specialize in, what kind of doctor they are (ENT, pediatrician, etc.), their contact information (email and phone number), and their physical address.

4.     Computer Calculated Data:

Lastly, this data will be what will be calculated based on certain factors. An example of something that will be able to be calculated is how long a patient has been in the hospital.

Solutions

Expert Solution

The ER diagram is attached:

The create table statements (in mySQL, some small syntactical changes may be required for other dbs) is below:

create table if not exists patient (
pid INT auto_increment primary key,
pname VARCHAR (50),
dob DATE,
phone VARCHAR (15),
email VARCHAR (50),
address VARCHAR (150),
gender VARCHAR (1),
symptoms VARCHAR (500)
);
create table if not exists doctor (
did INT auto_increment primary key,
dname VARCHAR (50),
email VARCHAR (50),
phone VARCHAR (15),
address VARCHAR (150),
specialization VARCHAR (30)
);
create table if not exists hospital_rooms (
rid INT primary key,
allocated VARCHAR(1)
);
create table if not exists admissions (
pid INT,
FOREIGN KEY (pid) REFERENCES patient(pid),
did INT,
FOREIGN KEY (did) REFERENCES doctor(did),
admitdate DATE,
room INT,
FOREIGN KEY (room) REFERENCES hospital_rooms(rid),
dischargedate DATE,
PRIMARY KEY (pid)
);


Related Solutions

I am doing a paper on same-gender? in need, some survey questions on are some gender...
I am doing a paper on same-gender? in need, some survey questions on are some gender couple receiving the same amount of help as heterosexual counterparts. The survey questionnaire will be answered by the general public.
I am doing a project for statistics and needed some clarification on the questions being asked....
I am doing a project for statistics and needed some clarification on the questions being asked. 1) Female height vs. male height             b) What method(s) of analysis may be appropriate for comparing female heights to male heights,             given the sample drawn? Explain.             c) Does it appear that the typical male COD student has a height that is similar to that of the             typical male in the USA? Explain.             d) Does it appear that the typical...
I just need 3 and 5. I am not sure what I am doing wrong. I...
I just need 3 and 5. I am not sure what I am doing wrong. I get different numbers every time. Superior Markets, Inc., operates three stores in a large metropolitan area. A segmented absorption costing income statement for the company for the last quarter is given below: Superior Markets, Inc. Income Statement For the Quarter Ended September 30 Total North Store South Store East Store Sales $ 4,800,000 $ 960,000 $ 1,920,000 $ 1,920,000 Cost of goods sold 2,640,000...
I need an example of a composite entity replacing a m:n relationship in an Er diagram....
I need an example of a composite entity replacing a m:n relationship in an Er diagram. Need atleast three entities being used.
project on hotel management in dbms with er diagram and table (sql) please give answer
project on hotel management in dbms with er diagram and table (sql) please give answer
I need to draw an ER diagram for a future database necessary to hold application data...
I need to draw an ER diagram for a future database necessary to hold application data for students wishing to apply for an internship at a tech company. The students will provide the following information on the application: first name, last name, email, phone number, address, city, state, postal code, major, currently enrolled in school?, expected date of graduation, web framework of choice, list of programming languages in which the student is proficient, SAT score, ACT score, GPA, 4 character...
I am currently doing an unknown salts project where I am given 2 vials. Vial A...
I am currently doing an unknown salts project where I am given 2 vials. Vial A contains 2 salts, and vial B contains the two salts found + another salt. Here are all the possible salts that can be mine: NaI MgCl2 K2SO4 NaCl KI Na2SO4 CaCO3 Al2(SO4)3 CaCl2 KCl Na2CO3 MgSO4 Al2O3 MgCO3 CaSO4 K2CO3 All Equipment that was provided are: • Each student will be provided with two small numbered vials, one containing powder sample (A) and the...
I am doing a green project for chemistry and I have to propose four reactions that...
I am doing a green project for chemistry and I have to propose four reactions that I would like to "green" and then propose a change (catalysis, solvent or reagent) of how I plan to do so. Can someone please help me come up with some reactions?
I am currently doing research and I need to find the correlation between "HOURS OF SLEEP"...
I am currently doing research and I need to find the correlation between "HOURS OF SLEEP" and "LPI SCORES" I want a table to look as below how would I achieve this on Excel. In short I want to find out what the average score someone gets when they get a certain amount of sleep. I have all the data in a spreadsheet but cannot get the table right. SLEEP HOURS                               LPI SCORES 4                                                      ?? 5 6 7 8 9...
I am doing a kids fishing game. right now I am doing it with 15 fish...
I am doing a kids fishing game. right now I am doing it with 15 fish and number them 1-5. prize one the lowest value and prize 5 the highest value. What do I need to do for this? You can work with a partner or by yourself. I want you to invent a game with at least 12 different possible monetary outcomes. These outcomes need to include prizes other than money. You are going to charge people money (you...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT