Abaixo está uma instrução que descreve uma tarefa de geração de SQL, combinada com uma entrada que fornece mais contexto sobre os esquemas de tabela disponíveis. Escreva o código SQL que responda adequadamente à solicitação
 ###Instrução: Qual é a mudança no consumo de energia per capita para cada cidade inteligente em comparação com o ano anterior?
 ###Tabelas: 
CREATE TABLE city_population (city_name TEXT, year INTEGER, population INTEGER); INSERT INTO city_population VALUES ('CityA', 2020, 50000), ('CityA', 2021, 55000), ('CityB', 2020, 70000), ('CityB', 2021, 73000); CREATE TABLE city_energy_consumption (city_name TEXT, year INTEGER, energy_consumption FLOAT); INSERT INTO city_energy_consumption VALUES ('CityA', 2020, 500.0), ('CityA', 2021, 550.0), ('CityB', 2020, 700.0), ('CityB', 2021, 730.0);
SELECT a.city_name, a.year, b.energy_consumption, b.energy_consumption / c.population AS energy_consumption_per_capita, b.energy_consumption_per_capita - LAG(b.energy_consumption_per_capita) OVER (PARTITION BY a.city_name ORDER BY a.year) AS difference FROM city_population c INNER JOIN city_energy_consumption b ON c.city_name = b.city_name INNER JOIN (SELECT city_name, year, energy_consumption / population AS energy_consumption_per_capita FROM city_energy_consumption, city_population WHERE city_energy_consumption.city_name = city_population.city_name AND city_energy_consumption.year = city_population.year) a ON c.city_name = a.city_name AND c.year = a.year;