View with security filter by city

View with security filter by city

Hard SQL Views 14 views
Explanation Complexity

Problem Statement

Create v_my_city_customers that only returns customers for city='Delhi'.

Input Format

SQL DDL

Output Format

View created

Example

Customers
View created

Constraints

Simple row-level filter

Input / Output Format

Input Format
SQL DDL
Output Format
View created
Constraints
Simple row-level filter

Examples

Input:
Customers
Output:
View created

Example Solution (Public)

SQL
CREATE VIEW v_my_city_customers AS SELECT customer_id, name, city FROM Customers WHERE city = 'Delhi';

Official Solution Code

CREATE VIEW v_my_city_customers AS SELECT customer_id, name, city FROM Customers WHERE city = 'Delhi';
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.