How many students are affected by each allergy type?
CREATE TABLE allergy_type (
    allergy text,
    allergytype text
)

CREATE TABLE has_allergy (
    stuid number,
    allergy text
)

CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
)
SELECT T2.allergytype, COUNT(*) FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many students are affected by each allergy type? ### Input: CREATE TABLE allergy_type (
    allergy text,
    allergytype text
)

CREATE TABLE has_allergy (
    stuid number,
    allergy text
)

CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
) ### Response: SELECT T2.allergytype, COUNT(*) FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype