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
Weekly Boutique Sales SQL
00:00
5 left

Weekly Boutique Sales SQL

HardSQL · PostgreSQL

Problem

Write a SQL query to analyze weekly boutique sales by store, category, and associate, including month-over-month growth and a ranking of top-performing stores.

Use the provided boutique sales and reference tables. Include only sales with valid store, category, and associate references.

Output

  1. One row per store, calendar week, category, and associate.
  2. Columns: store_name, week_start, category_name, associate_name, weekly_sales, store_month_sales, prior_month_sales, mom_growth_pct, and store_rank.
  3. Include all weeks with valid sales, sort by month, store rank, week, category, and associate, and rank stores within each month by total sales descending. Tied stores share a rank.

Schema

boutique_sales
ColumnTypeDescription
sale_idPKINTUnique sale identifier
store_idINTReferenced boutique
category_idINTReferenced product category
associate_idINTReferenced sales associate
sale_dateDATEDate of sale
net_amountDECIMAL(12,2)Net sale value after adjustments
stores
ColumnTypeDescription
store_idPKINTUnique boutique identifier
store_nameVARCHAR(100)Boutique name
cityVARCHAR(80)Boutique city
regionVARCHAR(80)Operating region
categories
ColumnTypeDescription
category_idPKINTUnique category identifier
category_nameVARCHAR(80)Product category name
associates
ColumnTypeDescription
associate_idPKINTUnique associate identifier
associate_nameVARCHAR(100)Associate name
store_idINTAssociate home boutique
Tablesboutique_salesstorescategoriesassociates
Interviewer

Your question is Weekly Boutique Sales SQL. Start with the requirements and the four 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.