View for active products

View for active products

Easy SQL Views 13 views
Explanation Complexity

Problem Statement

Create view v_active_products that filters Products where is_active=1.

Input Format

SQL DDL

Output Format

View created

Example

Products(is_active)
View created

Constraints

None

Input / Output Format

Input Format
SQL DDL
Output Format
View created
Constraints
None

Examples

Input:
Products(is_active)
Output:
View created

Example Solution (Public)

SQL
CREATE VIEW v_active_products AS SELECT product_id, name, price FROM Products WHERE is_active = 1;

Official Solution Code

CREATE VIEW v_active_products AS SELECT product_id, name, price FROM Products WHERE is_active = 1;
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.