Question: Using Oracle SQL Plus Write the Required DCL, DDL, and DML statements to do the following tasks: 1. Connect as a DBA, and do the

Using Oracle SQL Plus Write the Required DCL, DDL, and DML statements to do the following tasks: 1. Connect as a DBA, and do the following: a. create a user with a name "Ahmed" and define his password as "future". b. Give Ahmed privilege to tablespace to create tables. c. Give Ahmed privileges to create sessions and create tables. 2. As Ahmed, do the following: a. Use SQL Plus command to connect b. Create the following tables in a hospital DB: - Departments table that consists of the following attributes: - Department id (Numeric up to 3 digits) (Primary Key) - Department name (string up to 30 characters.) it cannot be left empty. - Doctors table that consists of the following attributes: Doctor id (Numeric up to 4 digits) (Primary key) - Doctor name (string up to 40 characters.) Doctor salary (Numeric: integer part up to 6 digits, and fractional part up to 2 digits) it cannot be left empty. Doctor birthdate. - Department no (Foreign key with delete cascade option) c. Insert 2 departments data into departments table. d. Insert 3 doctors data working in first department, and 2 doctors data in second department. e. List all departments data. f. List all doctors data. g. Modify the departments table schema, by adding a new column (attribute): Number of doctors (Numeric up to 2 digits) h. Set number of doctors in first second department to 7. i. Delete department that has a Cardiology name. j. Remove all the tuples (rows) in Doctors table. k. Remove Doctors table. I. Remove Departments table. 3. As DBA, remove the user, Ahmed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
