SQL COMMAND LINE 1. Create two database users: The first is a concatenation of f
ID: 3891496 • Letter: S
Question
SQL COMMAND LINE
1. Create two database users: The first is a concatenation of first name "joe" and last name "smith". The second is a concatenation of first name "sally" and last name "may".
2. Assign the two users privileges to connect to the database.
3. Assign the user "joesmith" the privilege to select data from the employees table.
4. Assign the user "sallymay" all privileges to the Departments table.
5. Assign the user "joesmith" the privilege to execute any procedure.
6 Take away "sallymay" privilege to execute any SQL commands on the Departments table.
Explanation / Answer
Q1) Create two database users: The first is a concatenation of first name "joe" and last name "smith". The second is a concatenation of first name "sally" and last name "may".
CREATE USER 'JOE' || 'SMITH' IDENTIFIED BY '123';
CREATE USER 'SALLY' || 'MAY' IDENTIFIED BY '321';
Q2) Assign the two users privileges to connect to the database
GRANT CONNECT TO SALLYMAY;
Q3) Assign the user "joesmith" the privilege to select data from the employees table.
GRANT SELECT ON EMPLOYEES TO JOESMITH;
Q4) Assign the user "sallymay" all privileges to the Departments table.
Q5) Assign the user "joesmith" the privilege to execute any procedure
GRANT EXECUTE ANY PROCEDURE TO JOESMITH;
Q6) Take away "sallymay" privilege to execute any SQL commands on the Departments table
REVOKE ALL PRIVILEGES ON DEPARTMENTS FROM SALLYMAY;
Please let me know in case of any clarifications required. Thanks!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.