Complete the code to select all columns from the metrics table.
SELECT [1] FROM metrics;Using * selects all columns from the table.
Complete the code to count the number of entries in the metrics table.
SELECT COUNT([1]) FROM metrics;Using COUNT(*) counts all rows in the table.
Fix the error in the query to get the average value of the metric column.
SELECT AVG([1]) FROM metrics;The column storing the metric values is named value. Using AVG(value) calculates the average.
Fill both blanks to filter metrics collected after 2023-01-01 and order by value descending.
SELECT * FROM metrics WHERE collected_date [1] '2023-01-01' ORDER BY value [2];
Use > to filter dates after 2023-01-01 and DESC to order values from highest to lowest.
Fill all three blanks to create a dictionary-like result with metric name as key, average value as value, filtering values above 50.
SELECT metric_name AS [1], AVG(value) AS [2] FROM metrics WHERE value [3] 50 GROUP BY metric_name;
Use name as the key alias, avg_value as the average value alias, and > to filter values greater than 50.