Company: SAP Labs_16sep
Difficulty: medium
Customer Order Summary Problem Description An online store keeps its customers, product catalogue and orders in five tables. Write an SQL query that produces a summary line for every order that contains at least one item, showing: the name of the customer who placed the order, the order ID, the date the order was placed, the number of distinct products in the order, and the total amount of the order. Sort the result by order date, newest first , and then by customer name alphabetically. Table: customers Column Type Description customer_id INT Unique ID of the customer customer_name VARCHAR Name of the customer (two customers may share a name) email VARCHAR Email of the customer city VARCHAR City of the customer registration_date DATE Registration date of the customer Table: categories Column Type Description category_id INT Unique ID of the category category_name VARCHAR Name of the category parent_category_id INT ID of the parent category, or NULL Table: products Column Type Descripti