Problem · Database
Account Balance Over Threshold
Problem statement
You are given two tables, LOGIN and BALANCE.
LOGIN
ACCOUNT CHAR(16)USERNAME CHAR(20)FIRST_NAME CHAR(20)LAST_NAME CHAR(30)
BALANCE
ACCOUNT CHAR(16)AMOUNT INTLAST_UPDATED DATE
Return exactly one column, USERNAME, containing every username whose matching BALANCE.AMOUNT is strictly greater than 10000.
The output row order is not significant.
Table schema
MySQLPostgreSQLPandas
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.
LOGIN
Login identity records from the source schema.
| Column | Type | Nullable | Description |
|---|---|---|---|
| ACCOUNT | Text | No | Account identifier; the source declares CHAR(16). |
| USERNAME | Text | No | Username; the source declares CHAR(20). |
| FIRST_NAME | Text | No | First name; the source declares CHAR(20). |
| LAST_NAME | Text | No | Last name; the source declares CHAR(30). |
BALANCE
Current account balance records from the source schema.
| Column | Type | Nullable | Description |
|---|---|---|---|
| ACCOUNT | Text | No | Account identifier; the source declares CHAR(16). |
| AMOUNT | Integer | No | Current balance amount; the source declares INT. |
| LAST_UPDATED | Date | No | Balance update date; the source declares DATE. |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| USERNAME | Text | No | Username of an account whose balance exceeds 10000. |
Row order: any order is accepted. Numeric tolerance: 0.
Constraints
- For this practice version, every input cell is non-null.
LOGIN.ACCOUNTidentifies at most one login row, andBALANCE.ACCOUNTidentifies at most one current balance row.- Text values respect the source-declared
CHARlengths. AMOUNTis a signed integer.LAST_UPDATEDis represented as an ISO date inYYYY-MM-DDform and does not affect the result.- Either table may be empty. A row without a matching account in the other table contributes no username.
Source note: Original assessment screenshot showing the source table schema and prompt.