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: Encontre o valor médio do investimento para cada setor.
 ###Tabelas: 
CREATE TABLE Investments (id INT, company_id INT, investment_amount INT, investment_date DATE); CREATE TABLE Companies (id INT, name TEXT, industry TEXT, country TEXT, founder_gender TEXT); INSERT INTO Companies (id, name, industry, country, founder_gender) VALUES (1, 'Acme Inc', 'Tech', 'USA', 'Female'); INSERT INTO Companies (id, name, industry, country, founder_gender) VALUES (2, 'Beta Corp', 'Biotech', 'Canada', 'Male'); INSERT INTO Investments (id, company_id, investment_amount, investment_date) VALUES (1, 1, 1000000, '2022-01-01'); INSERT INTO Investments (id, company_id, investment_amount, investment_date) VALUES (2, 2, 2000000, '2022-02-01'); INSERT INTO Investments (id, company_id, investment_amount, investment_date) VALUES (3, 1, 3000000, '2022-03-01');
SELECT industry, AVG(investment_amount) as avg_investment_amount FROM Investments i JOIN Companies c ON i.company_id = c.id GROUP BY industry;