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 é o montante total de financiamento recebido pelos programas de artes visuais no último trimestre?
 ###Tabelas: 
CREATE TABLE visual_arts_programs (program_id INT, program_name VARCHAR(50)); CREATE TABLE program_funding (program_id INT, source_id INT, amount DECIMAL(5,2)); CREATE TABLE funding_sources (source_id INT, source_name VARCHAR(50)); INSERT INTO visual_arts_programs (program_id, program_name) VALUES (1, 'Painting Classes'), (2, 'Sculpture Workshops'), (3, 'Photography Course'); INSERT INTO funding_sources (source_id, source_name) VALUES (1, 'Arts Council'), (2, 'Local Grants'), (3, 'Private Donors'); INSERT INTO program_funding (program_id, source_id, amount) VALUES (1, 1, 5000), (1, 2, 3000), (2, 1, 7000), (2, 3, 12000), (3, 2, 8000), (3, 3, 10000);
SELECT AVG(p.amount) as avg_funding FROM program_funding p INNER JOIN visual_arts_programs v ON p.program_id = v.program_id INNER JOIN funding_sources fs ON p.source_id = fs.source_id WHERE v.program_name IN ('Painting Classes', 'Sculpture Workshops', 'Photography Course') AND p.amount IS NOT NULL AND fs.source_name IN ('Arts Council', 'Local Grants', 'Private Donors') AND p.program_id IS NOT NULL AND v.program_id IS NOT NULL AND fs.source_id IS NOT NULL AND p.program_id = v.program_id AND p.source_id = fs.source_id AND v.program_id = p.program_id AND fs.source_id = p.source_id AND p.amount > 0 AND fs.source_name != '';