Among the restaurants located on the street number ranges from 1000 to 2000, what is the percentage of Afghani restaurants are there?
street number ranges from 1000 to 2000 refers to 1000 < = street_num < = 2000; Afghani restaurant refers to food_type = 'afghani'; percentage = divide(count(id_restaurant where food_type = 'afghani'), count(id_restaurant)) * 100%
SELECT CAST(SUM(IIF(T2.food_type = 'afghani', 1, 0)) AS REAL) * 100 / COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE 1000 <= T1.street_num <= 2000
CREATE TABLE geographic
(
    city   TEXT not null
        primary key,
    county TEXT null,
    region TEXT null
);
CREATE TABLE generalinfo
(
    id_restaurant INTEGER         not null
        primary key,
    label         TEXT  null,
    food_type     TEXT  null,
    city          TEXT  null,
    review        REAL null,
    foreign key (city) references geographic(city)
            on update cascade on delete cascade
);
CREATE TABLE location
(
    id_restaurant INTEGER        not null
        primary key,
    street_num    INTEGER          null,
    street_name   TEXT null,
    city          TEXT null,
    foreign key (city) references geographic (city)
            on update cascade on delete cascade,
    foreign key (id_restaurant) references generalinfo (id_restaurant)
            on update cascade on delete cascade
);
