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
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
Star vs Snowflake Benefits
00:00
5 left

Star vs Snowflake Benefits

MediumSQL · PostgreSQL

Problem

What are the benefits of using star schemas versus Snowflake schemas for analytics?

For the practical portion, write a query that produces a category-level analytics result from dimensional sales data. The result should retain categories without qualifying sales so the modeling and reporting implications can be discussed.

Output

  1. One row per category, including categories with no qualifying sales.
  2. Columns: category_name, total_units, and total_revenue.
  3. Include sales from 2025-01-01 through 2025-03-31, inclusive. Sort by total_revenue descending, then category_name ascending.

Schema

dim_category
ColumnTypeDescription
category_idPKINTUnique category identifier
category_nameVARCHAR(100)Analytics category name
category_groupVARCHAR(100)Higher-level category grouping
dim_product
ColumnTypeDescription
product_idPKINTUnique product identifier
product_nameVARCHAR(150)Product or service offering name
category_idINTAssociated category identifier
product_statusVARCHAR(30)Product lifecycle status
fact_sales
ColumnTypeDescription
sale_idPKINTUnique sales transaction identifier
product_idINTSold product identifier
sale_dateDATEDate of the sale
quantityINTUnits sold
net_amountNUMERIC(12,2)Net sale amount after adjustments
Tablesdim_categorydim_productfact_sales
Interviewer

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