2025: Year Review

I had focused on tech on this reviews. I would keep it same this year, I might write a separate non-tech, a human yearly review on my separate blog.

Gist

I moved from a software developer to a reliable and responsible developer. I took ownership and sat on problems more than the level of my comfort zone. It made me a better developer, it helped me sympathize the people around me, and connect more. These moments might create life long relations, but from the macro perspective they looked frustrating and annoying at times. Here I am still finding peace and standing and walking through what has not been a smooth journey both at work and life. I was thinking work and life could mean same thing once I got out of college, but those kept diverging and I had to keep both my feet at par with each one’s pace.

[]

Advent of SQL 2025 Day 15: Confirmation Phrase Dispatches

Advent of SQL, Day 15 - Confirmation Phrase Dispatches

We are on the final day of Advent of SQL!

I can’t believe it, I completed it! (with some help of course, I don’t didn’t know SQL very well. But this 15 days flipped it around.). I feel good and fresh to start the year to go deep in SQLite and databases!

Let’s solve the last day first, if it has somethings reamining to teach us!

[]

Advent of SQL 2025 Day 14: Ski Resort Paths

Advent of SQL, Day 14 - Ski Resort Paths

Ok, almost to the penultimate day in the series. It is day 14 of Advent of SQL.

Let’s grab the SQL for the day.

DROP TABLE IF EXISTS mountain_network;


CREATE TABLE mountain_network (
    id INTEGER PRIMARY KEY,
    from_node TEXT,
    to_node TEXT,
    node_type TEXT,    -- 'Lift' or 'Trail'
    difficulty TEXT    -- Only applicable for trails: 'green', 'blue', 'black', 'double_black'
);

INSERT INTO mountain_network (id, from_node, to_node, node_type, difficulty) VALUES
(1, 'Outlaw Express', 'Stairway Lift', 'Lift', NULL),
(2, 'Outlaw Express', 'Top Gun Bowl', 'Trail', 'black'),
(3, 'Top Gun Bowl', 'Top Gun', 'Trail', 'black'),
(4, 'Top Gun', 'Montoya', 'Trail', 'blue'),
(5, 'Montoya', 'Center Aisle', 'Trail', 'green'),
(6, 'Center Aisle', 'Lower Stampede', 'Trail', 'green'),
(7, 'Stairway Lift', 'Red''s Lift', 'Lift', NULL),
(8, 'Stairway Lift', 'Broadway', 'Trail', 'green'),
(9, 'Red''s Lift', 'Bearclaw', 'Trail', 'blue'),
(10, 'Bearclaw', 'Last Chance', 'Trail', 'blue'),
(11, 'Last Chance', 'Diamondback', 'Trail', 'blue'),
(12, 'Diamondback', 'Broadway', 'Trail', 'green'),
(13, 'Red''s Lift', 'Bishop''s Bowl', 'Trail', 'black'),
(14, 'Red''s Lift', 'Amy''s Ridge', 'Trail', 'blue'),
(15, 'Amy''s Ridge', 'Grizzly Bowl', 'Trail', 'black'),
(16, 'Flathead Lift', 'Amy''s Ridge', 'Trail', 'blue'),
(17, 'Jake''s Lift', 'Wildwood Lift', 'Lift', NULL),
(18, 'Wildwood Lift', 'Sidewinder', 'Trail', 'green'),
(19, 'Wildwood Lift', 'Brightside', 'Trail', 'blue'),
(20, 'Brightside', 'Moonrise', 'Trail', 'green'),
(21, 'Moonrise', 'Draw', 'Trail', 'green'),
(22, 'Moonrise', 'Lone Pine', 'Trail', 'blue'),
(23, 'Draw', 'Maverick', 'Trail', 'blue'),
(24, 'Draw', 'Broadway', 'Trail', 'green'),
(25, 'Broadway', 'Outlaw Trail', 'Trail', 'green'),
(26, 'Outlaw Trail', 'Center Aisle', 'Trail', 'green'),
(27, 'Center Aisle', 'Bandit', 'Trail', 'green'),
(28, 'Jake''s Lift', 'Maverick', 'Trail', 'blue');

That’s it, we just have 1 table called mountain_network and it has 28 records.

[]

Advent of SQL 2025 Day 13: XML Travel Manifests

Advent of SQL - Day 13, XML Travel Manifests

Its day 13 of Advent of SQL, we have some xml to parse, which I don’t think SQL can handle, but string manipulation to the rescue.

Let’s get the SQL for the day:

DROP TABLE IF EXISTS travel_manifests;

CREATE TABLE travel_manifests (
    manifest_id INT PRIMARY KEY,
    vehicle_id TEXT,
    departure_time TIMESTAMP,
    manifest_xml XML
);

INSERT INTO travel_manifests (manifest_id, vehicle_id, departure_time, manifest_xml) VALUES
  (1, 'SLEIGH-01', '2025-12-22 06:00:00', '<manifest><passengers><passenger><name>Nia Grant</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Sofia Kim</name><ticket_class>overnight</ticket_class><engine_check>ignored</engine_check></passenger><passenger><name>Jonah Wolfe</name><ticket_class>standard</ticket_class><snack_inventory>ignored</snack_inventory></passenger></passengers></manifest>'),
  (2, 'SLEIGH-07', '2025-12-23 13:00:00', '<manifest><passengers><passenger><name>Ravi Patel</name><ticket_class>priority</ticket_class></passenger><passenger><name>Keiko Ito</name><ticket_class>standard</ticket_class></passenger><passenger><name>Anya Pavlov</name><ticket_class>standard</ticket_class></passenger><passenger><name>Nia Grant</name><ticket_class>priority</ticket_class><snack_inventory>ignored</snack_inventory></passenger><passenger><name>Carter Lewis</name><ticket_class>priority</ticket_class><engine_check>ignored</engine_check></passenger><passenger><name>Layla Brooks</name><ticket_class>standard</ticket_class><reindeer_mood>ignored</reindeer_mood></passenger></passengers></manifest>'),
  (3, 'FLIGHT-NP-9', '2025-12-22 18:00:00', '<manifest><passengers><passenger><name>Keiko Ito</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Jonah Wolfe</name><ticket_class>priority</ticket_class></passenger><passenger><name>Diego Ramos</name><ticket_class>overnight</ticket_class><snack_inventory>ignored</snack_inventory></passenger><passenger><name>Priya Das</name><ticket_class>priority</ticket_class></passenger><passenger><name>Layla Brooks</name><ticket_class>standard</ticket_class></passenger></passengers></manifest>'),
  (4, 'TRAIN-ICE-3', '2025-12-22 18:00:00', '<manifest><reindeer_mood>low</reindeer_mood><passengers><passenger><name>Isla Torres</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Ravi Patel</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Hiro Tanaka</name><ticket_class>standard</ticket_class></passenger><passenger><name>Priya Das</name><ticket_class>priority</ticket_class></passenger></passengers></manifest>'),
  (5, 'FLIGHT-NP-9', '2025-12-22 17:00:00', '<manifest><passengers><passenger><name>Nia Grant</name><ticket_class>priority</ticket_class></passenger><passenger><name>Mateo Cruz</name><ticket_class>standard</ticket_class><snowfall_inches>ignored</snowfall_inches></passenger></passengers></manifest>'),
  (6, 'CARGO-12', '2025-12-22 15:00:00', '<manifest><passengers><passenger><name>Carter Lewis</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Sofia Kim</name><ticket_class>priority</ticket_class></passenger><passenger><name>Hiro Tanaka</name><ticket_class>priority</ticket_class></passenger><passenger><name>Lucas Ford</name><ticket_class>priority</ticket_class><snack_inventory>ignored</snack_inventory></passenger><passenger><name>Nia Grant</name><ticket_class>overnight</ticket_class></passenger></passengers></manifest>'),
  (7, 'SLEIGH-01', '2025-12-22 11:00:00', '<manifest><snack_inventory>unknown</snack_inventory><passengers><passenger><name>Priya Das</name><ticket_class>standard</ticket_class></passenger><passenger><name>Diego Ramos</name><ticket_class>standard</ticket_class></passenger><passenger><name>Lucas Ford</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Carter Lewis</name><ticket_class>overnight</ticket_class><reindeer_mood>ignored</reindeer_mood></passenger><passenger><name>Hiro Tanaka</name><ticket_class>priority</ticket_class><weather_note>ignored</weather_note></passenger><passenger><name>Zara Sheikh</name><ticket_class>overnight</ticket_class></passenger></passengers></manifest>'),
  (8, 'CARGO-12', '2025-12-23 13:00:00', '<manifest><passengers><passenger><name>Jonah Wolfe</name><ticket_class>standard</ticket_class></passenger><passenger><name>Layla Brooks</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Leo Becker</name><ticket_class>overnight</ticket_class><weather_note>ignored</weather_note></passenger><passenger><name>Ravi Patel</name><ticket_class>standard</ticket_class></passenger><passenger><name>Sofia Kim</name><ticket_class>priority</ticket_class><snack_inventory>ignored</snack_inventory></passenger><passenger><name>Elena Morales</name><ticket_class>overnight</ticket_class></passenger></passengers></manifest>'),
  (9, 'SLEIGH-01', '2025-12-23 10:00:00', '<manifest><passengers><passenger><name>Sofia Kim</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Bianca Pereira</name><ticket_class>standard</ticket_class></passenger><passenger><name>Zara Sheikh</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Elena Morales</name><ticket_class>overnight</ticket_class><reindeer_mood>ignored</reindeer_mood></passenger><passenger><name>Hiro Tanaka</name><ticket_class>priority</ticket_class></passenger><passenger><name>Keiko Ito</name><ticket_class>priority</ticket_class><snack_inventory>ignored</snack_inventory></passenger></passengers></manifest>'),
  (10, 'SLEIGH-01', '2025-12-22 21:00:00', '<manifest><snowfall_inches>low</snowfall_inches><passengers><passenger><name>Nia Grant</name><ticket_class>standard</ticket_class></passenger><passenger><name>Ava Johnson</name><ticket_class>standard</ticket_class></passenger><passenger><name>Priya Das</name><ticket_class>priority</ticket_class></passenger><passenger><name>Mateo Cruz</name><ticket_class>standard</ticket_class></passenger><passenger><name>Bianca Pereira</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Leo Becker</name><ticket_class>overnight</ticket_class></passenger></passengers></manifest>'),
  (11, 'SLEIGH-07', '2025-12-23 10:00:00', '<manifest><passengers><passenger><name>Jonah Wolfe</name><ticket_class>priority</ticket_class></passenger><passenger><name>Bianca Pereira</name><ticket_class>priority</ticket_class></passenger><passenger><name>Anya Pavlov</name><ticket_class>standard</ticket_class></passenger></passengers></manifest>'),
  (12, 'SLEIGH-01', '2025-12-22 08:00:00', '<manifest><reindeer_mood>ok</reindeer_mood><passengers><passenger><name>Ravi Patel</name><ticket_class>priority</ticket_class><snack_inventory>ignored</snack_inventory></passenger><passenger><name>Bianca Pereira</name><ticket_class>priority</ticket_class></passenger><passenger><name>Keiko Ito</name><ticket_class>standard</ticket_class></passenger></passengers></manifest>'),
  (13, 'FLIGHT-NP-9', '2025-12-22 11:00:00', '<manifest><snowfall_inches>ok</snowfall_inches><passengers><passenger><name>Nia Grant</name><ticket_class>priority</ticket_class></passenger><passenger><name>Elena Morales</name><ticket_class>standard</ticket_class></passenger></passengers></manifest>'),
  (14, 'SLEIGH-01', '2025-12-22 14:00:00', '<manifest><engine_check>high</engine_check><passengers><passenger><name>Layla Brooks</name><ticket_class>standard</ticket_class><weather_note>ignored</weather_note></passenger><passenger><name>Anya Pavlov</name><ticket_class>overnight</ticket_class></passenger><passenger><name>Keiko Ito</name><ticket_class>standard</ticket_class></passenger><passenger><name>Zara Sheikh</name><ticket_class>standard</ticket_class><engine_check>ignored</engine_check></passenger><passenger><name>Sofia Kim</name><ticket_class>overnight</ticket_class></passenger></passengers></manifest>'),
  (15, 'FLIGHT-NP-9', '2025-12-22 14:00:00', '<manifest><snowfall_inches>ok</snowfall_inches><passengers><passenger><name>Priya Das</name><ticket_class>priority</ticket_class><snowfall_inches>ignored</snowfall_inches></passenger><passenger><name>Bianca Pereira</name><ticket_class>standard</ticket_class></passenger><passenger><name>Nia Grant</name><ticket_class>standard</ticket_class></passenger></passengers></manifest>');

Just one table, with some wild XML.

[]

Advent of SQL 2025 Day 12: Archive Flight Records

Advent of SQL - Day 12, Archive Flight Records

We are on Day 12! Phew its almost done! Just 3 days more!

Let’s get the SQL!

DROP TABLE IF EXISTS archive_records;

CREATE TABLE archive_records (
    id INT PRIMARY KEY,
    title TEXT,
    description TEXT
);

INSERT INTO archive_records (id, title, description) VALUES
(1, 'Flight Stabilization Prototype Analysis', 'This report details the latest advancements in stabilizing aerial maneuvers for enchanted sleighs. Initial tests yielded promising results, showcasing a marked decrease in turbulence during airborne navigation.'),
(2, 'Lift Calibration Incident Log', 'During a routine lift calibration test, the sleigh experienced an unexpected upward surge, causing it to hover dangerously close to the workshop ceiling. Subsequent analysis revealed a miscalculation in the weight distribution formula, prompting a thorough review of all aerodynamic coefficients.'),
(3, 'Aerial Aspirations: The Great Flop', 'Despite the initial excitement surrounding the design of our feather-laden airborne contraption, the prototype proved less than buoyant. The unexpected descent resulted in a rather spectacular cloud of glitter and twigs, serving as a vivid reminder that not all dreams of flight take wing as intended.'),
(4, 'Optimized Sled Dynamics', 'This document explores advanced mechanics behind sled propulsion and movement efficiency. Through extensive calculations and enchanted material tests, the elves aim to refine turning capabilities and enhance downhill speed.'),
(5, 'Reindeer Harness Design Flaws', 'The latest prototype of our reindeer harness was found to inhibit mobility, causing undue strain on the animals during testing. Observations indicated that the weight distribution was poorly calibrated, necessitating a complete redesign for optimal comfort and performance.'),
(6, 'Streamlined Cargo Routing System', 'In our latest endeavor, we have implemented a magical algorithm to optimize the route taken by our toy-laden sleighs. This groundbreaking update minimizes transport time between the workshop and delivery points, ensuring that holiday cheer reaches every home even faster!'),
(7, 'Toy Durability Testing Protocols', 'The elves meticulously conducted stress evaluations on the latest toy prototypes to determine their resilience under various conditions. Initial findings indicate that while some designs withstood rigorous play, others required reinforcements to avoid premature wear and tear.'),
(8, 'Weather Resistance Breakthrough: Frost Shielding', 'In our recent experiments, we discovered an innovative composite material that effectively repels moisture while withstanding extreme cold. This newfound frost shielding could revolutionize our outdoor toys, ensuring they remain both functional and enchanting, even in the harshest winter conditions.'),
(9, 'Safety Compliance Check Overview', 'In the pursuit of enchantment and joy, this document outlines the mandatory safety compliance measures for all workshop operations. Each elf must adhere strictly to these guidelines to ensure the safe transport and handling of our delicate prototypes, thus preventing any unforeseen magical mishaps.'),
(10, 'Sleigh Skim Mechanism Upgrade', 'The experiment involved enchanting the underside of the sleigh with a whispering wind charm to achieve unprecedented speeds. Results were alarming, leading to uncontrollable flight trajectories and sudden descents—definitely do not attempt again.'),
(11, 'Caution: Enchanted Toy Prototype', 'This design incorporates a reactive magic component that may unpredictably animate in the presence of mischief. Ensure all test environments are secured against spontaneous giggles and potential chaos.'),
(12, 'Workshop Experiment Safety Checklist', 'Before embarking on any workshop experiments, ensure all safety goggles are securely fastened to prevent debris from interfered visions. Always double-check that the workspace is free of clutter, as unexpected accidents can arise from even the smallest flurry of trinkets and tools.'),
(13, 'Cocoa Bean Roasting Innovations', 'This review explores the latest techniques in roasting cocoa beans to achieve unparalleled flavor profiles. Adjustments to temperature and timing have led to a delightful spectrum of aromas, promising to elevate our confectionery creations to new heights.'),
(14, 'Intricate Snowflake Ornament Design', 'This design blueprint outlines the geometric intricacies of a multi-faceted snowflake ornament, emphasizing a balance between elegance and structural integrity. Each arm is meticulously patterned to reflect light, creating a shimmering effect that dances with the seasons, while ensuring optimal symmetry for enchanting visual appeal.'),
(15, 'Gift Box Assembly Prototype', 'This prototype outlines the intricate process of assembling the enchanted gift boxes designed to withstand the whims of time and space. Each step must be meticulously executed to ensure that every box not only sparkles with joy but also maintains its magical properties through every unwrapping.'),
(16, 'Wrap-It-Up: Innovative Designs', 'This experimental report explores various materials and techniques for creating enchanted wrapping paper that enhances the gift-giving experience. Initial findings suggest that incorporation of shimmering elven dust can amplify the aesthetic appeal while maintaining structural integrity during airborne delivery.'),
(17, 'Magical Confection Fusion Results', 'The experimental concoction blended sugar crystals with essence of starlight, resulting in a luminescent treat that sparkles enchantingly. However, a curious side effect was noted: excessive giggling among taste testers, raising questions about potential airborne laughter.'),
(18, 'Luminous Ornament Crafting Techniques', 'In our continuous pursuit of radiance, this document outlines innovative methods for creating ornaments that glow with enchantment. Engaging both traditional techniques and modern enchantments, each design is meant to instill joy and sparkle during the festive season.'),
(19, 'Magical Energy Conduction Analysis', 'Recent experiments have shown that the flow of magical energy through crystalline conduits behaves unpredictably under varying lunar phases. Further investigation into the correlation between ambient mana levels and energy stability is necessary to optimize enchantment potency.'),
(20, 'Elven Workshop Organization Protocols', 'The implementation of open shelving systems has significantly increased accessibility to essential materials, thus enhancing workflow efficiency. Furthermore, the organization of tools into color-coded bins ensures that each elf can swiftly locate their required implements without disrupting the harmony of the workshop.');

We have just one table and a couple of text like columns. That’s it, looks like a string searching problem.

[]

Techstructive Weekly #74

Week #74

It was winding down week, 2025, ending slowly, the biggest irony. The year was full of fast-paced, unprecedented models just dropping here and there. It was hard to keep up with the progress. It was getting overwhelming, no one is used to such a level of information. I was dreading with so much power in our hands. I couldn’t handle it and refrained it and thought it was better to focus on learning new things. I kept using AI tools at work, not by choice, but initially through force but then through necessity.

[]

Advent of SQL 2025 Day 11: Behavior Score

Advent of SQL - Day 11, Behavior Score

All right, this is day 11 from Advent of SQL.

Let’s pull in the data.

DROP TABLE IF EXISTS behavior_logs;

CREATE TABLE behavior_logs (
    id INT PRIMARY KEY,
    child_id INT,
    child_name TEXT,
    behavior_date DATE,
    score INT
);

INSERT INTO behavior_logs (id, child_id, child_name, behavior_date, score) VALUES
    (1, 1, 'Emma D.', '2025-12-01', 5),
    (2, 1, 'Emma D.', '2025-12-02', 1),
    (3, 1, 'Emma D.', '2025-12-03', 3),
    (4, 1, 'Emma D.', '2025-12-04', 5),
    (5, 1, 'Emma D.', '2025-12-05', 2),
    (6, 1, 'Emma D.', '2025-12-06', 2),
    (7, 1, 'Emma D.', '2025-12-07', 3),
    (8, 1, 'Emma D.', '2025-12-08', 5),
    (9, 1, 'Emma D.', '2025-12-09', 4),
    (10, 1, 'Emma D.', '2025-12-10', 5),
    (11, 1, 'Emma D.', '2025-12-11', 5),
    (12, 1, 'Emma D.', '2025-12-12', -1),
    (13, 1, 'Emma D.', '2025-12-13', 1),
    (14, 1, 'Emma D.', '2025-12-14', 1),
    (15, 1, 'Emma D.', '2025-12-15', -1),
    (16, 1, 'Emma D.', '2025-12-16', 3),
    (17, 1, 'Emma D.', '2025-12-17', -2),
    (18, 1, 'Emma D.', '2025-12-18', 1),
    (19, 1, 'Emma D.', '2025-12-19', 1),
    (20, 1, 'Emma D.', '2025-12-20', -2),
    (21, 2, 'Ava X.', '2025-12-01', 0),
    (22, 2, 'Ava X.', '2025-12-02', -1),
    (23, 2, 'Ava X.', '2025-12-03', 4),
    (24, 2, 'Ava X.', '2025-12-04', 0),
    (25, 2, 'Ava X.', '2025-12-05', 2),
    (26, 2, 'Ava X.', '2025-12-06', 3),
    (27, 2, 'Ava X.', '2025-12-07', 5),
    (28, 2, 'Ava X.', '2025-12-08', 2),
    (29, 2, 'Ava X.', '2025-12-09', 1),
    (30, 2, 'Ava X.', '2025-12-10', 5),
    (31, 2, 'Ava X.', '2025-12-11', 2),
    (32, 2, 'Ava X.', '2025-12-12', 5),
    (33, 2, 'Ava X.', '2025-12-13', 5),
    (34, 2, 'Ava X.', '2025-12-14', 2),
    (35, 2, 'Ava X.', '2025-12-15', 0),
    (36, 2, 'Ava X.', '2025-12-16', 0),
    (37, 2, 'Ava X.', '2025-12-17', 5),
    (38, 2, 'Ava X.', '2025-12-18', 4),
    (39, 2, 'Ava X.', '2025-12-19', 5),
    (40, 2, 'Ava X.', '2025-12-20', 5),
    (181, 10, 'Ava C.', '2025-12-01', 3),
    (182, 10, 'Ava C.', '2025-12-02', 0),
    (183, 10, 'Ava C.', '2025-12-03', 3),
    (184, 10, 'Ava C.', '2025-12-04', 5),
    (185, 10, 'Ava C.', '2025-12-05', 5),
    (186, 10, 'Ava C.', '2025-12-06', 4),
    (187, 10, 'Ava C.', '2025-12-07', 1),
    (188, 10, 'Ava C.', '2025-12-08', 4),
    (189, 10, 'Ava C.', '2025-12-09', 5),
    (190, 10, 'Ava C.', '2025-12-10', 5),
    (191, 10, 'Ava C.', '2025-12-11', 5),
    (192, 10, 'Ava C.', '2025-12-12', 0),
    (193, 10, 'Ava C.', '2025-12-13', 0),
    (194, 10, 'Ava C.', '2025-12-14', 3),
    (195, 10, 'Ava C.', '2025-12-15', 1),
    (196, 10, 'Ava C.', '2025-12-16', 3),
    (197, 10, 'Ava C.', '2025-12-17', -1),
    (198, 10, 'Ava C.', '2025-12-18', 0),
    (199, 10, 'Ava C.', '2025-12-19', 5),
    (200, 10, 'Ava C.', '2025-12-20', 4),
    (241, 13, 'Ava R.', '2025-12-01', 3),
    (242, 13, 'Ava R.', '2025-12-02', 2),
    (243, 13, 'Ava R.', '2025-12-03', 2),
    (244, 13, 'Ava R.', '2025-12-04', 1),
    (245, 13, 'Ava R.', '2025-12-05', -1),
    (246, 13, 'Ava R.', '2025-12-06', -1),
    (247, 13, 'Ava R.', '2025-12-07', 2),
    (248, 13, 'Ava R.', '2025-12-08', 5),
    (249, 13, 'Ava R.', '2025-12-09', 0),
    (250, 13, 'Ava R.', '2025-12-10', 5),
    (251, 13, 'Ava R.', '2025-12-11', 2),
    (252, 13, 'Ava R.', '2025-12-12', -1),
    (253, 13, 'Ava R.', '2025-12-13', 2),
    (254, 13, 'Ava R.', '2025-12-14', 3),
    (255, 13, 'Ava R.', '2025-12-15', 2),
    (256, 13, 'Ava R.', '2025-12-16', -1),
    (257, 13, 'Ava R.', '2025-12-17', -2),
    (258, 13, 'Ava R.', '2025-12-18', -4),
    (259, 13, 'Ava R.', '2025-12-19', -3),
    (260, 13, 'Ava R.', '2025-12-20', 2),
    (1961, 99, 'Ava X.', '2025-12-01', 2),
    (1962, 99, 'Ava X.', '2025-12-02', -2),
    (1963, 99, 'Ava X.', '2025-12-03', -1),
    (1964, 99, 'Ava X.', '2025-12-04', -2),
    (1965, 99, 'Ava X.', '2025-12-05', 3),
    (1966, 99, 'Ava X.', '2025-12-06', -1),
    (1967, 99, 'Ava X.', '2025-12-07', 0),
    (1968, 99, 'Ava X.', '2025-12-08', 1),
    (1969, 99, 'Ava X.', '2025-12-09', 0),
    (1970, 99, 'Ava X.', '2025-12-10', 0),
    (1971, 99, 'Ava X.', '2025-12-11', 3),
    (1972, 99, 'Ava X.', '2025-12-12', 4),
    (1973, 99, 'Ava X.', '2025-12-13', 4),
    (1974, 99, 'Ava X.', '2025-12-14', 0),
    (1975, 99, 'Ava X.', '2025-12-15', 3),
    (1976, 99, 'Ava X.', '2025-12-16', -1),
    (1977, 99, 'Ava X.', '2025-12-17', -1),
    (1978, 99, 'Ava X.', '2025-12-18', 3),
    (1979, 99, 'Ava X.', '2025-12-19', 3),
    (1980, 99, 'Ava X.', '2025-12-20', -3);

No hiccups! Good to go.

[]

Advent of SQL 2025 Day 10: Misdelivered Presents

Advent of SQL, Day 10 - Misdelivered Presents

It’s already day 10? We just need 5 more days now! Whoa! that flew by swiftly.

Let’s pull in the data.

This is the SQL for day 10 in SQLite.

DROP TABLE IF EXISTS misdelivered_presents;
DROP TABLE IF EXISTS deliveries;

CREATE TABLE deliveries (
    id INT PRIMARY KEY,
    child_name TEXT,
    delivery_location TEXT,
    gift_name TEXT,
    scheduled_at TIMESTAMP
);

CREATE TABLE misdelivered_presents (
    id INT PRIMARY KEY,
    child_name TEXT,
    delivery_location TEXT,
    gift_name TEXT,
    scheduled_at TIMESTAMP,
    flagged_at TIMESTAMP,
    reason TEXT
);

INSERT INTO deliveries (id, child_name, delivery_location, gift_name, scheduled_at) VALUES
    (1, 'Omar Q.', '45 Maple Street', 'storybook collection', '2025-12-24 21:09:00'),
    (2, 'Sofia K.', '77 Snowflake Road', 'plush reindeer', '2025-12-24 18:35:00'),
    (3, 'Mila N.', 'The Vibes', 'storybook collection', '2025-12-24 21:09:00'),
    (4, 'Elias M.', 'Frost Hollow Cabin', 'board game', '2025-12-24 20:31:00'),
    (5, 'Ravi P.', '45 Maple Street', 'wooden train set', '2025-12-24 18:23:00'),
    (6, 'Jonah W.', '77 Snowflake Road', 'plush reindeer', '2025-12-24 20:34:00'),
    (7, 'Ava J.', '123 Evergreen Lane', 'board game', '2025-12-24 21:03:00'),
    (8, 'Omar Q.', '77 Snowflake Road', 'board game', '2025-12-24 18:56:00'),
    (9, 'Nia G.', 'Frost Hollow Cabin', 'teddy bear', '2025-12-24 21:27:00'),
    (10, 'Zara S.', 'North Pole Annex', 'wooden train set', '2025-12-24 20:58:00'),
    (11, 'Ravi P.', 'Frost Hollow Cabin', 'puzzle box', '2025-12-24 18:39:00'),
    (12, 'Jonah W.', '123 Evergreen Lane', 'puzzle box', '2025-12-24 18:23:00'),
    (13, 'Ravi P.', 'North Pole Annex', 'storybook collection', '2025-12-24 21:36:00'),
    (14, 'Lena F.', 'North Pole Annex', 'teddy bear', '2025-12-24 21:26:00'),
    (15, 'Ava J.', 'North Pole Annex', 'snow globe', '2025-12-24 18:31:00'),
    (16, 'Elias M.', 'Frost Hollow Cabin', 'robot toy', '2025-12-24 20:21:00'),
    (17, 'Sofia K.', 'Frost Hollow Cabin', 'teddy bear', '2025-12-24 20:27:00'),
    (18, 'Jonah W.', '77 Snowflake Road', 'storybook collection', '2025-12-24 20:49:00'),
    (19, 'Jonah W.', 'Frost Hollow Cabin', 'art supplies', '2025-12-24 21:38:00'),
    (20, 'Jonah W.', '123 Evergreen Lane', 'storybook collection', '2025-12-24 19:11:00');

INSERT INTO misdelivered_presents
(id, child_name, delivery_location, gift_name, scheduled_at, flagged_at, reason)
VALUES
    (601, 'Priya D.', 'The Vibes', 'plush reindeer', '2025-12-24 14:00:00', '2025-12-24 14:05:00', 'Invalid delivery location'),
    (602, 'Lena F.', 'Abandoned Lighthouse', 'board game', '2025-12-22 06:00:00', '2025-12-22 06:05:00', 'Invalid delivery location'),
    (603, 'Caleb O.', 'Drifting Igloo', 'board game', '2025-12-24 06:00:00', '2025-12-24 06:05:00', 'Invalid delivery location'),
    (604, 'Mateo C.', 'The Vibes', 'art supplies', '2025-12-22 04:00:00', '2025-12-22 04:05:00', 'Invalid delivery location'),
    (605, 'Hiro T.', 'The Vibes', 'robot toy', '2025-12-24 08:00:00', '2025-12-24 08:05:00', 'Invalid delivery location'),
    (606, 'Priya D.', 'Volcano Rim', 'puzzle box', '2025-12-22 08:00:00', '2025-12-22 08:05:00', 'Invalid delivery location'),
    (607, 'Nia G.', 'Abandoned Lighthouse', 'board game', '2025-12-24 01:00:00', '2025-12-24 01:05:00', 'Invalid delivery location'),
    (608, 'Elias M.', 'Drifting Igloo', 'board game', '2025-12-24 01:00:00', '2025-12-24 01:05:00', 'Invalid delivery location'),
    (609, 'Ravi P.', 'Volcano Rim', 'board game', '2025-12-24 02:00:00', '2025-12-24 02:05:00', 'Invalid delivery location'),
    (610, 'Hiro T.', 'Abandoned Lighthouse', 'science kit', '2025-12-23 20:00:00', '2025-12-23 20:05:00', 'Invalid delivery location'),
    (611, 'Priya D.', 'Drifting Igloo', 'puzzle box', '2025-12-22 21:00:00', '2025-12-22 21:05:00', 'Invalid delivery location'),
    (612, 'Hiro T.', 'Volcano Rim', 'art supplies', '2025-12-23 09:00:00', '2025-12-23 09:05:00', 'Invalid delivery location'),
    (613, 'Jonah W.', 'Abandoned Lighthouse', 'board game', '2025-12-24 01:00:00', '2025-12-24 01:05:00', 'Invalid delivery location'),
    (614, 'Omar Q.', 'Volcano Rim', 'art supplies', '2025-12-22 01:00:00', '2025-12-22 01:05:00', 'Invalid delivery location'),
    (615, 'Omar Q.', 'Drifting Igloo', 'science kit', '2025-12-23 20:00:00', '2025-12-23 20:05:00', 'Invalid delivery location'),
    (616, 'Omar Q.', 'Abandoned Lighthouse', 'teddy bear', '2025-12-24 12:00:00', '2025-12-24 12:05:00', 'Invalid delivery location'),
    (617, 'Zara S.', 'Volcano Rim', 'wooden train set', '2025-12-24 12:00:00', '2025-12-24 12:05:00', 'Invalid delivery location'),
    (618, 'Omar Q.', 'Abandoned Lighthouse', 'teddy bear', '2025-12-23 15:00:00', '2025-12-23 15:05:00', 'Invalid delivery location'),
    (619, 'Caleb O.', 'The Vibes', 'teddy bear', '2025-12-24 14:00:00', '2025-12-24 14:05:00', 'Invalid delivery location'),
    (620, 'Nia G.', 'Abandoned Lighthouse', 'board game', '2025-12-23 03:00:00', '2025-12-23 03:05:00', 'Invalid delivery location');
SELECT * FROM deliveries;
SELECT * FROM misdelivered_presents;

We have two tables. Almost the same with critical logical distinction among them and one extra column.

[]