Question: Use Oracle Sql to test your data definition language (ddl) and data manipulation language (dml) and Data Control Language (dcl). 1. Create user hospital
Use Oracle Sql to test your data definition language (ddl) and data manipulation language (dml) and Data Control Language (dcl). 1. Create user hospital and assign all necessary privileges. Use Akawe as password 2. Change password to ipmc_12345 3. Create Tables a. Ward characterized by Wid, Wname, Beds, DOA, DOD b. Patient characterized by Pid, Pname, DOB and Contact 4. Rename the column names in the tables OLD COLUMN Wid Wname Beds DOA DOD NEW COLUMN Ward_Id Ward_Name No_Of_Beds Date_Of_Admission Date_Of_Discharge OLD COLUMN Pid Pname DOB Contact NEW COLUMN Patient Id Patient_FullName Date Of Birth Telephone Number Create the following constraints a. Available ward names are Maternity,Accident and Children's only b. A ward at any time must not havemore than 10 beds c. A ward consists of many patients, but a patient can be admitted into only one ward. Create a relationship to this effect d. A patients full name and date of birth are required e. Create a sequence to generate a patient's ID. The ID which begins at 100 and has an incremental value of 2 should not exceed 200 f. Use a date function to a. Find a patient's age b. Find the number of days a patient spends in a ward after discharged (round days to the nearest whole number) c. Find the number of months a patient spends in a ward after discharge (round months to the nearest whole number) d. A patient will have to report for review every 3 months after discharged until fully fit g. Display the details of a ward and only patients on admission h. Display the details of all wards and all patients in the hospital i. Create a view that includes the ward ID, patient ID, ward name, patient full name, date of birth, date of admission and date of discharge
Step by Step Solution
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Answer1 Syntax CREATE USER IDENTIFIED BY SQL create user hospital iden... View full answer
Get step-by-step solutions from verified subject matter experts
