GROUP BY
SELECT with a GROUP BY
In this exercise we will query the products table and group the results by product_id, then product_name, and finally unit_price.
SELECT product_id,product_name,unit_priceFROM productsGROUP BY product_id,product_name,unit_price;Run in terminal
This query should return 77 rows
SELECT with a GROUP BY and a function
In this exercise we will query the orders table and group the results by employee_id, while only returning the total counts of order_id.
SELECT count(order_id),employee_idFROM ordersGROUP BY employee_id;Run in terminal
This query should return 9 rows