system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE institution_details (
  unitid integer PRIMARY KEY,
  chronname text,
  city text,
  state text,
  level text,
  control text,
  basic text,
  hbcu text,
  flagship text,
  long_x real,
  lat_y real,
  site text,
  student_count integer,
  awards_per_value real,
  awards_per_state_value real,
  awards_per_natl_value real,
  exp_award_value integer,
  exp_award_state_value integer,
  exp_award_natl_value integer,
  exp_award_percentile integer,
  ft_pct real,
  fte_value integer,
  fte_percentile integer,
  med_sat_value text,
  med_sat_percentile text,
  aid_value integer,
  aid_percentile integer,
  endow_value text,
  endow_percentile text,
  grad_100_value real,
  grad_100_percentile integer,
  grad_150_value real,
  grad_150_percentile integer,
  pell_value real,
  pell_percentile integer,
  retain_value real,
  retain_percentile integer,
  ft_fac_value real,
  ft_fac_percentile integer,
  vsa_year text,
  vsa_grad_after4_first text,
  vsa_grad_elsewhere_after4_first text,
  vsa_enroll_after4_first text,
  vsa_enroll_elsewhere_after4_first text,
  vsa_grad_after6_first text,
  vsa_grad_elsewhere_after6_first text,
  vsa_enroll_after6_first text,
  vsa_enroll_elsewhere_after6_first text,
  vsa_grad_after4_transfer text,
  vsa_grad_elsewhere_after4_transfer text,
  vsa_enroll_after4_transfer text,
  vsa_enroll_elsewhere_after4_transfer text,
  vsa_grad_after6_transfer text,
  vsa_grad_elsewhere_after6_transfer text,
  vsa_enroll_after6_transfer text,
  vsa_enroll_elsewhere_after6_transfer text,
  similar text,
  state_sector_ct integer,
  carnegie_ct integer,
  counted_pct text,
  nicknames text,
  cohort_size integer
);
CREATE TABLE institution_grads (
  unitid integer,
  year integer,
  gender text,
  race text,
  cohort text,
  grad_cohort text,
  grad_100 text,
  grad_150 text,
  grad_100_rate text,
  grad_150_rate text
);
CREATE TABLE state_sector_grads (
  stateid integer,
  state text,
  state_abbr text,
  control text,
  level text,
  year integer,
  gender text,
  race text,
  cohort text,
  grad_cohort text,
  grad_100 text,
  grad_150 text,
  grad_100_rate text,
  grad_150_rate text,
  grad_cohort_ct integer
);
CREATE TABLE state_sector_details (
  stateid integer PRIMARY KEY,
  state text,
  state_post text,
  level text PRIMARY KEY,
  control text PRIMARY KEY,
  schools_count integer,
  counted_pct text,
  awards_per_state_value text,
  awards_per_natl_value real,
  exp_award_state_value text,
  exp_award_natl_value integer,
  state_appr_value text,
  state_appr_rank text,
  grad_rate_rank text,
  awards_per_rank text
);
-- foreign keys: institution_grads.unitid -> institution_details.unitid; state_sector_grads.stateid -> state_sector_details.stateid; state_sector_grads.state -> institution_details.state; state_sector_details.state -> institution_details.state

Hint: number of graduated students refers to grad_cohort; 2-year refers to level = '2-year'; public refers to control = 'Public'; Alabama refers to state = 'Alabama'; in 2011 refers to year = '2011'; reace = 'X' means all students.

Question: Give the total number of all graduated students from a 2-year public schools in Alabama in 2011.

assistant: SELECT SUM(T2.grad_cohort) FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T1.state = 'Alabama' AND T2.year = 2011 AND T1.level = '2-year' AND T1.control = 'Public' AND T2.race = 'X'