Over the years it happened to me to come across stuck situations trying to manage business changes in the Italian’s municipalities archive. My advice has always been the same: take advantage of the well engineered and up-to-date dataset exposed by ISTAT (Italian national statistics institute). You can download excel as long as csv versions and there’s plenty of descriptions for each field/entity.

My hopefully appreciated two cents has been to make available a slightly revised version to avoid some unnecessary data redundancies. You’ll be able to load everything on you database just running the script.

Find below the revised data model. “GpE” ‘s prefixed entities are the modified/added ones. One note: the model has a logical value which means that y0u won’t find a strong referential integrity on your “after script” physical schema.

Updates will reflect the original site’s ones.

MISC UPDATES

Feb 13th, 2019: added “comuni_cap” table. It contains postal codes for every municipality. Find below record’s structure 

CodiceComuneAlfanumerico, CAP_DA, CAP_A

(Municipality ID, Postal code from, Postal code to)

Jan 13th, 2019: GpEElenco’s table’s structure modified due to ISTAT’s changes and to some “personal” ones (added LATITUDE and LONGITUDE float fields with geocoding’s coordinates. Got them via Google’s API; deleted some “unused” fields). ERD’s schema modified accordingly.

——————–

May 16th 2018: here a demo with a few lines of code to show dataset interaction

May 26th 2018: added Teradata DDLs

June 10th, 2018: added SQL Server DDLs and data

June 9th, 2018:  VARIAZIONIAMMINISTRATIVETERRITORIALIDAL01011991’s table structure altered

 

DATA UPDATES

LAST UPDATE: February 13th, 2019

ISTAT’s data update on feb 1st, 2019.

January 13th, 2019

ISTAT’s data update on jan 1st, 2019.

June 9th, 2018

VARIAZIONIAMMINISTRATIVETERRITORIALIDAL01011991‘s data updated

September 9th, 2018

03/06/2018 MONRUPINO gets ‘REPENTABOR’ as second language identification

03/06/2018 SGONICO gets ‘ZGONIK’ as second language identification

 


DOWNLOADS


VERSIONNOTES
CSVSEPARATOR: ';'
HEADERS IN FIRST ROW: Y
OracleDDL: Y
USED TABLESPACE: USERS (must be manually edited, if needed).
Run scripts following the 'nn' ordinal in 'STEPnn' file name's prefix.
Script must be launched using the destination schema.
MySQLServer version: 5.6.38-log
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci
Script must be launched using destination user's credentials.
PostgreSQLScript creates structures and data in PUBLIC schema.
SQLiteJust copy the file ... wherever you want and use it 🙂
Microsoft AccessMicrosoft Access (Office 365)
Unzip the file wherever you need it!
Teradata SQLTeradata
DDL: yes
DATA: no. You can load CSV data with LoadData or whatever your favourite utility is.
SQL ServerSQL Server
DDL: Y
DATA: Y