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
Running Total of Incidents by Day
00:00
5 left

Running Total of Incidents by Day

EasySQL · PostgreSQL

Problem

Cloud Security Services needs a daily view of incidents handled by its security teams. Write a PostgreSQL query that counts incidents for the requested reporting period and calculates the cumulative total over time.

Requirements

  1. Include only incidents assigned to teams whose service_area is Cloud Security Services.
  2. Restrict results to February 1 through February 5, 2025, using an inclusive start and exclusive end boundary.
  3. Return one row per day with the daily incident count and a running total ordered chronologically.

Schema

incidents
ColumnTypeDescription
incident_idPKINTUnique incident identifier
team_idINTAssigned security team identifier
occurred_atDATEDate the incident occurred
severityVARCHAR(20)Incident severity
security_teams
ColumnTypeDescription
team_idPKINTUnique team identifier
team_nameVARCHAR(100)Security team name
service_areaVARCHAR(100)Service area supported by the team
Tablesincidentssecurity_teams
Interviewer

Your question is Running Total of Incidents by Day. Start with the requirements and the two 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.