9.22
Consider the Oracle Virtual Private Database (VPD) feature described in Section 9.8.5 and an application based on our university schema.
What predicate (using a subquery) should be generated to allow each faculty member to see only takes tuples corresponding to course sections that they have taught?
Give an SQL query such that the query with the predicate added gives a result that is a subset of the original query result without the added predicate.
Give an SQL query such that the query with the predicate added gives a result containing a tuple that is not in the result of the original query without the added predicate.
- What predicate (using a subquery) should be generated to allow each faculty member to see only takes tuples corresponding to course sections that they have taught?
The following predicate would be associated with the takes relation.
year) IN (
(course_id, sec_id, semester, SELECT course_id, sec_id, semester, year
FROM teaches
WHERE id = syscontext.user_id()
)
- Give an SQL query such that the query with the predicate added gives a result that is a subset of the original query result without the added predicate.
SELECT * FROM takes
- Give an SQL query such that the query with the predicate added gives a result containing a tuple that is not in the result of the original query without the added predicate.
No such query exists.