Products still in stock
Your task
Given products with columns sku, category, price and stock, return the products whose stock is greater than zero. Return only sku and price, sorted by price ascending and then sku ascending.
Examples
in_stock(products: dataframe) -> dataframeExample 1
Input
in_stock(products)products
| sku | category | price | stock |
|---|---|---|---|
| A-1 | tools | 9.99 | 12 |
| B-2 | tools | 24.5 | 0 |
| C-3 | garden | 15 | 7 |
| D-4 | garden | 15 | 3 |
| E-5 | kitchen | 42 | 0 |
Output
| sku | price |
|---|---|
| A-1 | 9.99 |
| C-3 | 15 |
| D-4 | 15 |