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.
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
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
HEADERS IN FIRST ROW: 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.
|MySQL||Server version: 5.6.38-log
Script must be launched using destination user's credentials.
|PostgreSQL||Script creates structures and data in PUBLIC schema.|
|SQLite||Just copy the file ... wherever you want and use it 🙂|
|Microsoft Access||Microsoft Access (Office 365)
Unzip the file wherever you need it!
DATA: no. You can load CSV data with LoadData or whatever your favourite utility is.
|SQL Server||SQL Server