Task 1: Counting The Last Survivors

#1 · 1 of 13Free sample
Question

Task 1: Counting The Last Survivors

Using the residents table, determine the total population of the Last City by summing the population values of all districts. Return a single column: total_population.
Tables
10 tables · 42 columns
residents3 cols
  • district_idINTEGER
  • district_nameTEXT
  • populationINTEGER
supplies4 cols
  • supply_idINTEGER
  • district_idINTEGER
  • supply_typeTEXT
  • days_remainingINTEGER
power_plants4 cols
  • plant_idINTEGER
  • plant_nameTEXT
  • statusTEXT
  • district_idINTEGER
medical_supplies5 cols
  • supply_idINTEGER
  • supply_nameTEXT
  • quantityINTEGER
  • unitTEXT
  • last_updatedTEXT
district_usage5 cols
  • district_idINTEGER
  • supply_idINTEGER
  • quantity_usedINTEGER
  • usage_dateTEXT
  • usage_timeTEXT
threat_reports5 cols
  • report_idINTEGER
  • district_idINTEGER
  • threat_typeTEXT
  • severityTEXT
  • timestampTEXT
security_logs6 cols
  • log_idINTEGER
  • district_idINTEGER
  • timestampTEXT
  • staff_nameTEXT
  • incidentTEXT
  • severityTEXT
shelters4 cols
  • shelter_idINTEGER
  • district_idINTEGER
  • capacityINTEGER
  • current_occupancyINTEGER
transport4 cols
  • vehicle_idINTEGER
  • vehicle_typeTEXT
  • capacityINTEGER
  • effective_capacityINTEGER
exhibits2 cols
  • exhibit_idINTEGER
  • exhibit_nameTEXT
Loading the practice editor and dataset…
Your answer(autosaved)
query.sql
Loading editor…
Sign up to unlock

The reference answer is one click away.

Free account unlocks the reference answer, the explanation, and the GPT tutor on every exercise in the library.

  • Reference answer + explanation revealed after each attempt
  • GPT tutor for every problem
  • Progress saved on the platform
  • 1,598 graded exercises
  • Free forever — no credit card
All exercises in SQL Survival Challenge: Last City on Earth