arcs / tasks /readable /013 /task_readable.md
yanlinf's picture
Release ARCS dataset
1fb4e2d verified
|
Raw History Blame Contribute Delete
547 Bytes
# Task: 013
**Database:** retails
## Question
Show the total quantity and total final charge of all items shipped by mail or with discount greater than 5% and returned.
## Gold Query
```sql
SELECT
SUM(l_quantity) AS total_quantity,
SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS total_charge
FROM lineitem
WHERE l_returnflag = 'R'
AND (l_shipmode = 'MAIL' OR l_discount > 0.05);
```
**Execution Result:**
| total_quantity | total_charge |
|------------------|----------------|
| 9357125 | 1.3533437e+10 |
*1 rows*