View with join for reporting

View with join for reporting

Medium SQL Views 12 views
Explanation Complexity

Problem Statement

Create v_order_summary showing order_id, customer_name, total_amount, order_date.

Input Format

SQL DDL

Output Format

View created

Example

Orders, Customers
View created

Constraints

None

Input / Output Format

Input Format
SQL DDL
Output Format
View created
Constraints
None

Examples

Input:
Orders, Customers
Output:
View created

Example Solution (Public)

SQL
CREATE VIEW v_order_summary AS SELECT o.order_id, c.name AS customer_name, o.total_amount, o.order_date FROM Orders o JOIN Customers c ON c.customer_id = o.customer_id;

Official Solution Code

CREATE VIEW v_order_summary AS SELECT o.order_id, c.name AS customer_name, o.total_amount, o.order_date FROM Orders o JOIN Customers c ON c.customer_id = o.customer_id;
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.