The datasets come from French government open data (Data.gouv.fr) and INSEE :
https://www.data.gouv.fr/fr/datasets/5c4ae55a634f4117716d5656
https://www.insee.fr/fr/information/2008354
https://www.data.gouv.fr/fr/datasets/referentiel-geographique-francais-communes-unites-urbaines-aires-urbaines-departements-academies-regions-1/#resources
They were uploaded, cleaned, filled in with correct values in place of NaNs, and merged using Microsoft Excel
The resulting database was then converted to MySQL using SQL, and ready to start querying