SQL Challenges · THE CHRISTMAS HEIST!

The Security System Deep Dive

Difficulty: hard

Detective Quacker's office door bursts open. "Dr. Temporal here!" announces a duck in a lab coat, carrying hard drives full of surveillance data. "Those 'anonymous' and 'secret' mentions got me curious! The warehouse installed an advanced security system in December that logs EVERY checkpoint event—gate scans, door sensors, badge swipes, camera detections. That's countless security events! We need to find 5-minute windows where Coach Waddles had ZERO checkpoint activity. Those gaps reveal when…

Your task

Count how many 5-minute periods in December 2025 have no security checkpoint activity for Coach Waddles (duck_id = 1). You will be working with the `dbquacks_xmas.security_checkpoint_events` (MotherDuck) table.<br />Hint: Create a 'date spine' using <a href='https://duckdb.org/docs/stable/sql/functions/list#generate_seriesstart-stop-step' target='_blank' rel='noopener noreferrer' class='text-blue-400 hover:text-blue-300 underline'>GENERATE_SERIES</a> to generate all 5-minute time slots in December 2025, then use this spine to find slots with no activity.

Tables

dbquacks_xmas.security_checkpoint_events

A table in a MotherDuck share; its columns are not listed here.

Database: https://dbquacks.com/data/databases/christmas_local.duckdb

This page as markdown: https://dbquacks.com/challenges/christmas/6.md

Play this challenge →

More: practice SQL exercises online · SQL interview questions