Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
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
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess 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
Build my plan
Star vs Snowflake Schemas
00:00
5 left

Star vs Snowflake Schemas

MediumSQL · PostgreSQL

Problem

Can you describe your experience with data warehousing concepts, including star and snowflake schemas?

For the practical portion, use the provided warehouse tables to demonstrate how transaction facts can be analysed with customer and product dimensions. Return only combinations whose completed transaction value exceeds 1,000.

Output

  1. One row per customer segment and product category
  2. Columns: customer_segment, product_category, total_value
  3. Sort by total_value descending, then customer_segment and product_category ascending, with null categories last

Schema

fact_transactions
ColumnTypeDescription
transaction_idPKINTUnique transaction identifier
customer_idINTCustomer dimension key
product_idINTProduct dimension key
transaction_dateDATETransaction posting date
statusVARCHAR(20)Transaction processing status
amountDECIMAL(12,2)Transaction value
dim_customer
ColumnTypeDescription
customer_idPKINTUnique customer dimension key
customer_nameVARCHAR(100)Customer name
customer_segmentVARCHAR(40)Customer segment
dim_product
ColumnTypeDescription
product_idPKINTUnique product dimension key
product_nameVARCHAR(100)Product name
product_categoryVARCHAR(50)Product category
Tablesfact_transactionsdim_customerdim_product
Interviewer

Your question is Star vs Snowflake Schemas. 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.