Calculate the percentage of households in residential areas of countries over 10000.
DIVIDE(SUM(households > 10000), SUM(households)) as percentage;
SELECT CAST(COUNT(CASE WHEN T2.households > 10000 THEN T1.zip_code ELSE NULL END) AS REAL) * 100 / COUNT(T1.zip_code) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code
database name:db_id address
CBSA table CBSA Cols: CBSA dtype integer, cbsa name dtype text, cbsa type dtype text, 
state table state Cols: abbreviation dtype text, name dtype text, 
congress table congress Cols: congress representative id dtype text, first name dtype text, last name dtype text, CID dtype text, party dtype text, state dtype text, abbreviation dtype text, House dtype text, District dtype integer, land area dtype real, 
zip_data table zip_data Cols: zip code dtype integer, city dtype text, state dtype text, multi country dtype text, type dtype text, organization dtype text, time zone dtype text, daylight savings dtype text, latitude dtype real, longitude dtype real, elevation dtype integer, state fips dtype integer, country fips dtype integer, region dtype text, division dtype text, population 2020 dtype integer, population 2010 dtype integer, households dtype integer, average house value dtype integer, average income per household dtype integer, persons per household dtype real, white population dtype integer, black population dtype integer, Hispanic population dtype integer, Asian population dtype integer, American Indian population dtype integer, Hawaiian population dtype integer, other population dtype integer, male population dtype integer, female population dtype integer, median age dtype real, male median age dtype real, female median age dtype real, residential mailboxes dtype integer, business mailboxes dtype integer, total delivery receptacles dtype integer, businesses dtype integer, 1st quarter payroll dtype integer, annual payroll dtype integer, employees dtype integer, water area dtype real, land area dtype real, single-family delivery units dtype integer, multi-family delivery units dtype integer, total beneficiaries dtype integer, retired workers dtype integer, disable workers dtype integer, parents and widowed dtype integer, spouses dtype integer, children dtype integer, over 65 dtype integer, monthly benefits all dtype integer, monthly benefits retired workers dtype integer, monthly benefits widowed dtype integer, CBSA dtype integer, 
alias table alias Cols: zip code dtype integer, alias dtype text, 
area_code table area_code Cols: zip code dtype integer, area code dtype integer, 
avoid table avoid Cols: zip code dtype integer, bad alias dtype text, 
country table country Cols: zip code dtype integer, country dtype text, state dtype text, 
zip_congress table zip_congress Cols: zip code dtype integer, district dtype text, 
