The products table contains selling prices and costs.
Return product_id, product_name, margin for products whose margin (price - cost) is greater than 20. Round margin to 2 decimal places and sort by product_id ascending.
These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].
products5 rows| product_id (int) | product_name (string) | price (double) | cost (double) |
|---|---|---|---|
| 1 | Desk | 80 | 50 |
| 2 | Lamp | 40 | 30 |
| 3 | Chair | 120 | 75 |
| 4 | Mug | 15 | 5 |
| 5 | Shelf | 60 | 35 |
Column names and order must match. Sort order is specified in the question.