/* Given the following database schema: */
CREATE TABLE institution_details
(
    unitid                               INTEGER
        constraint institution_details_pk
            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,
    foreign key (unitid) references institution_details(unitid)
)

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,
    foreign key (state) references institution_details(state),
    foreign key (stateid) references state_sector_details(stateid)
)

CREATE TABLE "state_sector_details"
(
    stateid                INTEGER,
    state                  TEXT
        references institution_details (state),
    state_post             TEXT,
    level                  TEXT,
    control                TEXT,
    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,
    primary key (stateid, level, control)
)

/* Answer the following: Which cohort had the higher percentage of students who graduated from Central Alabama Community College in 2011 within 150 percent of normal/expected time, female White students or male White students? amount of percentage = SUM(grad_150 WHERE gender = 'F') as female; percentage = SUM(grad_150 WHERE gender = 'M') as male; Central Alabama Community College refers to chronname = 'Central Alabama Community College'; in 2011 refers to year = 2011; graduated within 150 percent of normal/expected time refers to grad_150; female refers to gender = 'F'; White refers to race = 'w'; male refers to gender = 'M'; */
SELECT 
SELECT IIF(SUM(CASE WHEN T2.gender = 'F' THEN T2.grad_150 ELSE 0 END) > SUM(CASE WHEN T2.gender = 'M' THEN T2.grad_150 ELSE 0 END), 'female White students', 'male White students') FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'Central Alabama Community College' AND T2.year = 2011 AND T2.race = 'W'