Loading problem...
A publishing analytics team monitors inventory velocity and wants to identify catalog titles that are currently underperforming.
Table: books
Table: orders
Reference date assumptions:
A title is considered low-demand if:
Important behavior:
Task:
Supported submission environments:
books:
| book_id | name | available_from |
|---------|----------------------|----------------|
| 1 | Atlas of Rivers | 2010-01-01 |
| 2 | Distributed Futures | 2012-05-12 |
| 3 | Fast Graph Primer | 2019-06-10 |
| 4 | Queueing Stories | 2019-06-01 |
| 5 | Cloud Systems Digest | 2008-09-21 |
orders:
| order_id | book_id | quantity | dispatch_date |
|----------|---------|----------|---------------|
| 1 | 1 | 2 | 2018-07-26 |
| 2 | 1 | 1 | 2018-11-05 |
| 3 | 3 | 8 | 2019-06-11 |
| 4 | 4 | 6 | 2019-06-05 |
| 5 | 4 | 5 | 2019-06-20 |
| 6 | 5 | 9 | 2009-02-02 |
| 7 | 5 | 8 | 2010-04-13 |[
{"book_id":1,"name":"Atlas of Rivers"},
{"book_id":2,"name":"Distributed Futures"},
{"book_id":5,"name":"Cloud Systems Digest"}
]Books 1, 2, and 5 are mature and each has fewer than 10 shipped units in the lookback window. Books 3 and 4 are too recent and therefore excluded.
books:
| book_id | name | available_from |
|---------|-----------------------|----------------|
| 10 | Legacy SQL Patterns | 2018-05-10 |
| 11 | Batch Window Playbook | 2018-05-10 |
| 12 | New Launch Almanac | 2019-05-24 |
orders:
| order_id | book_id | quantity | dispatch_date |
|----------|---------|----------|---------------|
| 10 | 10 | 9 | 2018-06-23 |
| 11 | 10 | 1 | 2019-06-23 |
| 12 | 11 | 4 | 2017-03-01 |
| 13 | 12 | 1 | 2019-06-01 |[
{"book_id":11,"name":"Batch Window Playbook"}
]Book 10 ships exactly 10 units in-window and fails the strict < 10 rule. Book 11 has only out-of-window shipments, so in-window total is 0. Book 12 is not mature.
books:
| book_id | name | available_from |
|---------|--------------------|----------------|
| 100 | Event Mesh Intro | 2017-01-01 |
| 101 | Serverless Atlas | 2017-01-01 |
orders:
| order_id | book_id | quantity | dispatch_date |
|----------|---------|----------|---------------|
| 1001 | 100 | 3 | 2019-01-05 |
| 1002 | 100 | 2 | 2019-02-05 |
| 1003 | 101 | 6 | 2019-05-01 |
| 1004 | 101 | 4 | 2019-06-02 |[
{"book_id":100,"name":"Event Mesh Intro"}
]Book 100 totals 5 units and qualifies. Book 101 totals 10 units and does not qualify.
Constraints