Overloaded Game Account Inventories
Problem statement
Generate a report of game accounts whose inventories are overloaded.
For every qualifying account, return:
username.email.- The number of owned items as
item_count. - The total weight of owned items as
total_weight.
An account qualifies only when total_weight > 20. Sort rows by total_weight in descending order, then by username in ascending order.
Table schema
MySQL
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
accounts
Game account identity and contact data.
| Column | Type | Nullable | Description |
|---|---|---|---|
| idPK | Integer | No | — |
| username | Text | No | — |
| Text | No | — |
items
Inventory items and the account that owns each item.
| Column | Type | Nullable | Description |
|---|---|---|---|
| idPK | Integer | No | — |
| account_id | Integer | No | — |
| type | Text | No | — |
| name | Text | No | — |
| weight | Integer | No | — |
Foreign key: account_id → accounts(id)
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| username | Text | No | — |
| Text | No | — | |
| item_count | Integer | No | — |
| total_weight | Integer | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
items.account_idreferencesaccounts.id.- Every
accounts.usernameis unique. - Only accounts with a strict total weight greater than
20appear. - Every input row follows the declared schema.