Bda Ans For Ia2 (Partial
Bda Ans For Ia2 (Partial
The documents that are output from a stage are passed to the next stage.
The following aggregation pipeline example contains two stages and returns the
total order quantity of medium size pizzas grouped by pizza name:
The $match stage:
Uses $sum to calculate the total order quantity for each pizza name . The total
is stored in the totalQuantity field returned by the aggregation pipeline.
Expected Output
1 11 1000 1 June
2 12 1500 3 July
3 12 2000 3 June
1. List all products with total sales quantity greater than a specified threshold.
3. Calculate the average order value for customers who have placed more
than 5 orders.
2. Remove all data from the employees table (note: this assumes the table already
exists):
SHOW TABLES;
employees
DESCRIBE employees;