Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Data Modeling in Oracle or Snowflake
00:00
5 left

Data Modeling in Oracle or Snowflake

MediumSQL · PostgreSQL

Problem

Explain your experience with data modeling and performance optimization in Oracle or Snowflake.

For the SQL portion, write a PostgreSQL query that summarizes posted transaction activity during the first quarter of 2025 for every active account. The query should preserve active accounts without qualifying transactions and resolve missing account type information clearly.

Output

  1. One row per active account, with account_id, account_name, account_type, total_posted_amount, and posted_transaction_count.
  2. Include only transactions posted from January 1 through March 31, 2025.
  3. Sort by total_posted_amount descending, then account_id ascending.

Schema

account_types
ColumnTypeDescription
account_type_idPKINTUnique account type identifier
account_typeVARCHAR(40)Account type label
accounts
ColumnTypeDescription
account_idPKINTUnique account identifier
account_nameVARCHAR(100)Account holder or account name
account_type_idINTReferences account_types.account_type_id
is_activeBOOLEANWhether the account is currently active
transactions
ColumnTypeDescription
transaction_idPKINTUnique transaction identifier
account_idINTReferences accounts.account_id
posted_atTIMESTAMPTransaction posting timestamp
amountNUMERIC(12,2)Signed transaction amount
statusVARCHAR(20)Transaction processing status
Tablesaccountsaccount_typestransactions
Interviewer

Your question is Data Modeling in Oracle or Snowflake. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.