What is the percentage whereby the away team scored 2 goals during the 2017 seasons?
scored 2 goals refers to FTAG = 2, which is short name for Final-time Away-team Goals; DIVIDE(COUNT(Div where season = 2017, FTAG = '2'), COUNT(Div where season = 2017)) as percentage;
SELECT CAST(SUM(CASE WHEN FTAG = 2 THEN 1 ELSE 0 END) / COUNT(FTAG) AS REAL) * 100 FROM matchs WHERE season = 2017
CREATE TABLE divisions
(
    division TEXT not null
        primary key,
    name     TEXT,
    country  TEXT
);
CREATE TABLE matchs
(
    Div      TEXT,
    Date     DATE,
    HomeTeam TEXT,
    AwayTeam TEXT,
    FTHG     INTEGER,
    FTAG     INTEGER,
    FTR      TEXT,
    season   INTEGER,
    foreign key (Div) references divisions(division)
);
