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
SQL Basics for Data Analysis
00:00
5 left

SQL Basics for Data Analysis

EasySQL · PostgreSQL

Problem

What is SQL, and how is it used in data analysis?

Use the supplied analysis_data table to demonstrate a basic analytical SQL query. Return category-level summaries using only records with a positive measure, showing how SQL filters and aggregates data.

Output

  1. One row per category with positive measures
  2. Columns: category, record_count, and average_measure
  3. Round average_measure to two decimal places
  4. Order by average_measure descending, then category ascending

Schema

analysis_data
ColumnTypeDescription
record_idPKINTUnique identifier for the analysis record
categoryVARCHAR(50)Category assigned to the record
measureNUMERIC(10,2)Numeric value available for analysis
Tablesanalysis_data
Interviewer

Your question is SQL Basics for Data Analysis. Start with the requirements and the one table 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.