Professional Documents
Culture Documents
MidtermExam NW3C SaezJohnCarlo
MidtermExam NW3C SaezJohnCarlo
MIDTERM EXAM
BSIT – NW3C
2. Create a New User ITStaff with a password hospitalstaff. Prove that the new user is created.
IDENTIFIED BY hospitalstaff;
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
3. Provide privileges to the user ITStaff by allowing it to create table, sequence, and view. Make sure
to log-in to the Oracle server to allow these privileges. Confirm that the privileges are granted
successfully.
TO ITStaff;
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
3. Create all the necessary tables and insert the records based on the given table.
admission_date date
);
Doctors_information varchar2(20)
);
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
Symptoms varchar2(20),
Severity varchar2(20),
Laboratory varchar2(20),
Medication varchar2(20),
Treatment varchar2(20),
patient_id number,
doctor_id number);
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
Bills number,
Patient_DiagnosisID number
);
Status_of_payment varchar2(20),
billing_id number
);
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
Patient_ID number
);
payment_id number
);
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
A. Use the Select statement to display all the records of Filipino patients.
FROM PatientDiagnosis
G. How many patients are male? Female? Show the list of patients.
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
FROM PATIENT
GROUP BY Sex;
H. Count the number of Filipino patients. How many are Americans? Chinese?
FROM PATIENT
GROUP BY Nationality;
SAEZ, JOHN CARLO C. MIDTERM EXAM
BSIT – NW3C
RENAME COLUMN
admission_date TO adm_date;
DESCRIBE PATIENT;
SELECT MAX(Bills)
FROM BILLING;
Billing.billing_id = PATIENT.patient_id
PatientDiagnosis.Patient_DiagnosisID = PATIENT.patient_id;