101
0/304
Loading content...
A marketplace analytics team is tracking catalog diversity among sellers.
Table: users
Table: items
Table: orders
Cross-brand definition:
Scoring rule:
Task: Return the seller(s) with the maximum cross-brand distinct item count.
Important behavior:
Output columns (exact order):
Supported submission environments:
users:
| seller_id | join_date | favorite_brand |
|-----------|------------|----------------|
| 1 | 2019-01-01 | Alpha |
| 2 | 2019-02-09 | Beta |
| 3 | 2019-01-19 | Gamma |
items:
| item_id | item_brand |
|---------|------------|
| 1 | Beta |
| 2 | Alpha |
| 3 | Gamma |
| 4 | Delta |
orders:
| order_id | order_date | item_id | seller_id |
|----------|-------------|---------|-----------|
| 1 | 2019-08-01 | 4 | 2 |
| 2 | 2019-08-02 | 2 | 3 |
| 3 | 2019-08-03 | 3 | 3 |
| 4 | 2019-08-04 | 1 | 2 |
| 5 | 2019-08-04 | 4 | 2 |[
{"seller_id":2,"num_items":1},
{"seller_id":3,"num_items":1}
]Seller 2 has one distinct cross-brand item (item 4). Seller 3 has one distinct cross-brand item (item 2). They tie for the maximum.
users:
| seller_id | join_date | favorite_brand |
|-----------|------------|----------------|
| 10 | 2020-02-01 | Red |
| 11 | 2020-02-10 | Blue |
items:
| item_id | item_brand |
|---------|------------|
| 100 | Red |
| 101 | Blue |
orders:
| order_id | order_date | item_id | seller_id |
|----------|-------------|---------|-----------|
| 9 | 2020-05-01 | 100 | 10 |
| 10 | 2020-05-02 | 101 | 11 |
| 11 | 2020-05-03 | 100 | 10 |[]Every sale matches each seller's favorite brand, so no seller has any qualifying cross-brand item.
users:
| seller_id | join_date | favorite_brand |
|-----------|------------|----------------|
| 7 | 2021-03-01 | Nova |
| 8 | 2021-03-02 | Terra |
| 9 | 2021-03-03 | Orbit |
items:
| item_id | item_brand |
|---------|------------|
| 100 | Nova |
| 101 | Terra |
| 102 | Orbit |
| 103 | Flux |
| 104 | Alloy |
orders:
| order_id | order_date | item_id | seller_id |
|----------|-------------|---------|-----------|
| 1 | 2021-05-01 | 103 | 7 |
| 2 | 2021-05-02 | 104 | 7 |
| 3 | 2021-05-03 | 103 | 7 |
| 4 | 2021-05-04 | 100 | 8 |
| 5 | 2021-05-05 | 102 | 8 |
| 6 | 2021-05-06 | 102 | 9 |[
{"seller_id":7,"num_items":2},
{"seller_id":8,"num_items":2}
]Seller 7 has cross-brand items {103, 104}. Seller 8 has cross-brand items {100, 102}. Seller 9 has no cross-brand items and is excluded.
Constraints