Problem · Database

Account Balance Over Threshold

EasyIMC logoIMCFULLTIMEOA

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 INT
  • LAST_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.

ColumnTypeNullableDescription
ACCOUNTTextNoAccount identifier; the source declares CHAR(16).
USERNAMETextNoUsername; the source declares CHAR(20).
FIRST_NAMETextNoFirst name; the source declares CHAR(20).
LAST_NAMETextNoLast name; the source declares CHAR(30).

BALANCE

Current account balance records from the source schema.

ColumnTypeNullableDescription
ACCOUNTTextNoAccount identifier; the source declares CHAR(16).
AMOUNTIntegerNoCurrent balance amount; the source declares INT.
LAST_UPDATEDDateNoBalance update date; the source declares DATE.

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
USERNAMETextNoUsername 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.ACCOUNT identifies at most one login row, and BALANCE.ACCOUNT identifies at most one current balance row.
  • Text values respect the source-declared CHAR lengths.
  • AMOUNT is a signed integer.
  • LAST_UPDATED is represented as an ISO date in YYYY-MM-DD form 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.

More IMC problems