Practice Interview Questions
| Question | Status |
|---|---|
IBM is developing a new feature to analyze user purchasing behavior for all Fridays in the first quarter of the year. For each Friday separately, calculate the average amount users have spent per order. The output should include the week number of that Friday and the average amount spent, rounded to two decimal places.
user_purchases table:
| Column Name | Description |
|---|---|
| user_id | Identifier of user |
| date | Date of purchase |
| amount_spent | Amount spent |
| day_name | Name of the day |
Example output:
| week_number |
|---|
IBM is developing a new feature to analyze user purchasing behavior for all Fridays in the first quarter of the year. For each Friday separately, calculate the average amount users have spent per order. The output should include the week number of that Friday and the average amount spent, rounded to two decimal places.
user_purchases table:
| Column Name | Description |
|---|---|
| user_id | Identifier of user |
| date | Date of purchase |
| amount_spent | Amount spent |
| day_name | Name of the day |
Example output:
| week_number |
|---|
| mean_amount |
|---|
| 2 | 742.50 |
| 4 | 424.00 |
| mean_amount |
|---|
| 2 | 742.50 |
| 4 | 424.00 |