Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Q2 2025 Income Statement Line Items
00:00
5 left

Q2 2025 Income Statement Line Items

MediumSQL · PostgreSQL

Problem

What types of financial statements are there, and can you describe the structure and data of the one you are most familiar with?

For this exercise, use the income statement as the statement you are most familiar with. Return its published Q2 2025 line items with account classifications and section totals.

Output

  1. One row per income statement line item.
  2. Columns: statement_type, fiscal_period, section, account_name, amount, presented_amount, and section_total.
  3. Include only the published Q2 2025 income statement, ordered by line order.

Output details

  • Order rows by ascending line order.
  • Set presented_amount equal to amount for Revenue and Other income, and negate it for every other section.
  • Preserve NULL in presented_amount when amount is NULL.
  • Calculate section_total as the sum of presented_amount for each exact section, ignoring NULL values, and repeat it on every section row.

Schema

financial_statements
ColumnTypeDescription
statement_idPKINTUnique financial statement identifier
statement_typeVARCHAR(40)Financial statement type
fiscal_periodVARCHAR(10)Fiscal reporting period
statusVARCHAR(20)Publication status
statement_lines
ColumnTypeDescription
line_idPKINTUnique statement line identifier
statement_idINTReferenced financial statement
account_idINTReferenced account
line_orderINTDisplay order within the statement
amountDECIMAL(14,2)Reported amount for the line
accounts
ColumnTypeDescription
account_idPKINTUnique account identifier
account_nameVARCHAR(100)Financial account label
sectionVARCHAR(50)Income statement section
Tablesfinancial_statementsstatement_linesaccounts
Interviewer

Your question is Q2 2025 Income Statement Line Items. 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
Sign up free to run your codeLog inLn 1
Run your query to see results here.