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 Volunteer Engagement SQL
00:00
5 left

Weekly Volunteer Engagement SQL

MediumSQL · PostgreSQL

Problem

Write a SQL query to calculate weekly volunteer engagement metrics by site, including total shifts, completed shifts, and completion rate.

Use the habitat_sites and volunteer_shifts tables. Include only shifts with a non-null date that reference a valid site. Treat shifts with a completed status as completed.

Output

  1. One row per site and calendar week, with weeks starting on Monday.
  2. Columns: site_id, site_name, week_start, total_shifts, completed_shifts, and completion_rate.
  3. completion_rate should be a percentage rounded to two decimal places. Sort by week_start, then site_id.

Schema

habitat_sites
ColumnTypeDescription
site_idPKINTUnique identifier for a Habitat for Humanity build or volunteer site
site_nameVARCHAR(150)Display name of the volunteer site
cityVARCHAR(100)City where the site is located
volunteer_shifts
ColumnTypeDescription
shift_idPKINTUnique identifier for a volunteer shift
site_idINTSite assigned to the shift
shift_startTIMESTAMPScheduled start timestamp for the shift
statusVARCHAR(30)Shift status, such as completed, scheduled, cancelled, or no_show
Tableshabitat_sitesvolunteer_shifts
Interviewer

Your question is Weekly Volunteer Engagement SQL. 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.