-- Database schema
| geographic : city [ TEXT ] primary_key , county [ TEXT ] , region [ TEXT ] | generalinfo : id_restaurant [ INTEGER ] primary_key , label [ TEXT ] , food_type [ TEXT ] , city [ TEXT ] generalinfo.city = geographic.city , review [ REAL ] | location : id_restaurant [ INTEGER ] primary_key location.id_restaurant = generalinfo.id_restaurant , street_num [ INTEGER ] , street_name [ TEXT ] , city [ TEXT ] location.city = geographic.city |
-- -- In restaurants with a review of 2, how many restaurants have a street number below 500?

SELECT COUNT(T1.id_restaurant) FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.review = 2 AND T1.street_num < 500;