Calculate Z score on a table with some sales data
Asked in the technical interview stage. SQL on a sales table. Write a query that calculates the z score for each sale using the non-null sales amounts.
sale_id, sale_amount, and z_scorez_score to four decimal places and order by sale_id ascending| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique identifier for the sale |
| sale_amount | NUMERIC(10,2) | Sales amount used in the calculation |