Privilege for view but not base tables
SQL
Medium
2 views
Problem Description
Create a view v_public_customers that exposes only customer_id and name. Then grant SELECT on the view to public_user without granting base table access.
Input Format
SQL DDL + DCL
Output Format
View created + privileges
Sample Test Case
Input:
Customers(customer_id, name, phone, email)
Output:
User can query view
Constraints
Assume view security rules of your DB
Official Solution
CREATE VIEW v_public_customers AS SELECT customer_id, name FROM Customers; GRANT SELECT ON v_public_customers TO public_user;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!