Your question is SQL Top 10 Query. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Celebal Technologies needs the highest-value sales records for a Power BI dashboard. Write a PostgreSQL query that retrieves the top 10 individual sales from the sales table.
sales_amount from highest to lowest and return only 10 rows. Place NULL amounts after numeric values and use sale_id as a deterministic tie-breaker.| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| product_name | VARCHAR(100) | Name of the sold product |
| sales_amount | NUMERIC(12,2) | Monetary value of the sale |
| sale_date | DATE | Date when the sale occurred |