 
 __copyright__ = "tba"
 __license__ = "tba"
-__author__ = "IK"
+__author__ = "IlkaCu"
 */
 
 --------------

SELECT	'0.2.1' AS version,
	'input' AS io,
	'demand' AS schema_name,
	'lak_consumption_per_federalstate' AS table_name,
	'process_eGo_osm_loads_industry.sql' AS script_name,
	COUNT(*)AS entries,
	'OK' AS status,
	session_user AS user_name,
	NOW() AT TIME ZONE 'Europe/Berlin' AS timestamp,
	obj_description('demand.lak_consumption_per_federalstate' ::regclass) ::json AS metadata
FROM	demand.lak_consumption_per_federalstate;

-- add entry to scenario log table
INSERT INTO	model_draft.ego_scenario_log (version,io,schema_name,table_name,script_name,entries,status,user_name,timestamp,metadata)
SELECT	'0.2.1' AS version,
	'input' AS io,
	'economic' AS schema_name,
	'destatis_gva_per_districts' AS table_name,
	'process_eGo_osm_loads_industry.sql' AS script_name,
	COUNT(*)AS entries,
	'OK' AS status,
	session_user AS user_name,
	NOW() AT TIME ZONE 'Europe/Berlin' AS timestamp,
	obj_description('economic.destatis_gva_per_districts' ::regclass) ::json AS metadata
FROM	economic.destatis_gva_per_districts;

DROP TABLE IF EXISTS model_draft.ego_demand_per_gva CASCADE;


a.elec_consumption_industry * b.gva_industry as elec_consumption_industry, 
a.elec_consumption_tertiary_sector * b.gva_tertiary_sector AS elec_consumption_tertiary_sector 
FROM  	model_draft.ego_demand_per_gva a, 
 	economic.destatis_gva_per_district b -- destatis_gva_per_district
WHERE SUBSTR (a.eu_code,1,3) = SUBSTR(b.eu_code,1,3)  
) 
; 
