homework2_ans - Homework 2 School Answers 1 Revoke all...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 2 School Answers 1. Revoke all privileges granted in the previous exercise. SQL> REVOKE SELECT ON STUDENT FROM able; Revoke succeeded. SQL> REVOKE UPDATE ON STUDENT FROM baker; Revoke succeeded. SQL> REVOKE INSERT ON STUDENT FROM charles; Revoke succeeded. SQL> REVOKE DELETE ON STUDENT FROM drake; Revoke succeeded. SQL> REVOKE UPDATE ON STUDENT FROM elliot; Revoke succeeded. SQL> REVOKE SELECT, UPDATE ON FACULTY FROM martin; Revoke succeeded. SQL> REVOKE INSERT, DELETE ON FACULTY FROM seaver; Revoke succeeded. SQL> REVOKE UPDATE ON FACULTY FROM looney; Revoke succeeded. SQL> REVOKE UPDATE, INSERT ON FACULTY FROM mills; Revoke succeeded.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2. Create Roles Student and Faculty. Grant the Student Role Select on Student, Grant the Faculty Role Select on Faculty. Grant all Students the Student role and all Faculty the faculty role. SQL> CREATE ROLE student; Role created. SQL> CREATE ROLE faculty Role created. SQL> GRANT SELECT ON student TO student Grant succeeded. SQL> GRANT SELECT ON faculty TO faculty Grant succeeded. SQL> GRANT student TO elliot, drake, able, charles, baker Grant succeeded. SQL> GRANT faculty TO seaver, martin, looney, mills Grant succeeded.
Background image of page 2
3. Demonstrate the results of a student query on the student table and of a faculty query on the faculty table. SQL > Connect Able/a /* Note if you connected as the DBA or using you main student account it does not prove that the controls work since that account has all permissions for tables it created. If you did this I took off points */ /* Note that the following all work because I created a public synonym for the tables */ Connected. SQL> SELECT * FROM student STUDENTID NAME MAJOR ST GPA ---------- ---------- ---------------- -- ---------- 100 ABLE HISTORY SR 3 200 BAKER ACCOUNTING JR 2.7 300 CHARLES MATH SR 3.5 400 DRAKE COMPUTER SCIENCE FR 2.8 500 ELLIOT COMPUTER SCIENCE SM 3.25 SQL> SELECT * FROM faculty;
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 12

homework2_ans - Homework 2 School Answers 1 Revoke all...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online