Transaction Amount Mean and Standard Deviation
Problem statement
Calculate the arithmetic mean and population standard deviation of all transaction amounts.
Return two rows in this exact order: mean, then population_stddev. Round both values to two decimal places using ordinary half-up rounding.
Table schema
MySQLPostgreSQLPandas
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
transactions
| Column | Type | Nullable | Description |
|---|---|---|---|
| transaction_idPK | Integer | No | — |
| transaction_amount | Decimal | No | — |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| metric | Text | No | — |
| metric_value | Decimal | No | — |
Row order: must match exactly. Numeric tolerance: 0.001.
Constraints
- At least one transaction is present.
- Use population standard deviation, dividing variance by the number of transactions.
- Use exact decimal input values and round only final results.