Complete the code to calculate the total number of orders.
SELECT COUNT([1]) FROM orders;The COUNT function counts non-null values in the specified column. Using order_id counts all orders.
Complete the code to find the average order amount.
SELECT AVG([1]) FROM orders;The AVG function calculates the average of numeric values in the specified column. Here, order_amount holds the amounts.
Fix the error in the code to get the maximum and minimum order amounts.
SELECT MAX(order_amount) AS max_amount, MIN([1]) AS min_amount FROM orders;Both MAX and MIN should be applied to the same numeric column order_amount to get correct results.
Fill both blanks to calculate the total and average order amounts.
SELECT [1](order_amount) AS total, [2](order_amount) AS average FROM orders;
SUM adds all order amounts to get the total. AVG calculates the average order amount.
Fill all three blanks to calculate the total orders, average amount, and maximum amount.
SELECT [1](order_id) AS total_orders, [2](order_amount) AS avg_amount, [3](order_amount) AS max_amount FROM orders;
COUNT counts total orders by order_id, AVG finds average order amount, and MAX finds the highest order amount.