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
SQL Joins and Window Differences
00:00
5 left

SQL Joins and Window Differences

MediumSQL · PostgreSQL

Problem

Describe the differences between JOINs and window functions, and give an example of when you would use each in a data analysis task at Zomato.

Keep the answer focused on analytical use cases and the result each technique produces. Use one short example for each approach.

Output

  1. A concise comparison of JOINs and window functions
  2. One example use case for JOINs in Zomato analysis
  3. One example use case for window functions in Zomato analysis

Schema

orders
ColumnTypeDescription
order_idPKINTUnique order identifier
restaurant_idINTRestaurant associated with the order
customer_idINTCustomer who placed the order
order_dateDATEDate when the order was placed
order_valueNUMERIC(10,2)Order amount in currency units
restaurants
ColumnTypeDescription
restaurant_idPKINTUnique restaurant identifier
restaurant_nameVARCHAR(255)Restaurant name
cityVARCHAR(100)City where the restaurant operates
cuisine_typeVARCHAR(100)Primary cuisine type
is_activeBOOLEANWhether the restaurant is active
restaurant_monthly_stats
ColumnTypeDescription
restaurant_idINTRestaurant identifier
stat_monthDATEMonth of the metric snapshot
monthly_ordersINTNumber of orders in the month
monthly_revenueNUMERIC(12,2)Revenue in the month
Tablesordersrestaurantsrestaurant_monthly_stats
Interviewer

Your question is SQL Joins and Window Differences. 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.