Hi, I need to make a query:
A statement containing the average selling price and the number of transactions for each type of product. Order the results in descending order by average price.
Here is how I print number of transactions for specific type of product (and their names at beggining):
SELECT productCode, COUNT(*)
GROUP BY productCode
Here is table:
To count average selling price: For specific product type: for each product appearance:
(SUM(quantityOrdered * priceEach))/(quantityOrdered * number of transactions)
But I don't know how to count this part in SQL and show it... Can you help?