SELECT 
    COALESCE(NULLIF(data->'responseData'->0->>'name', '[null]'), '') AS "Nome documento",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->>'city', '[null]'), '') AS "Cidade",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->>'state', '[null]'), '') AS "Estado",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->>'region', '[null]'), '') AS "Região",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->>'country', '[null]'), '') AS "País",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->>'extra_info', '[null]'), '') AS "Informações adicionais",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->>'target_or_deposit', '[null]'), '') AS "Alvo ou depósito",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->'geological_context'->>'tectonic_context', '[null]'), '') AS "Contexto tectônico",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->'geological_context'->>'geological_context', '[null]'), '') AS "Contexto geológico",
    COALESCE(NULLIF(data->'responseData'->0->'data'->0->'response'->'geological_context'->>'context_of_present_rocks', '[null]'), '') AS "Contexto das rochas presentes",
    
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'sedimentares'->0->>'name', '[null]'), '') AS "Nome sedimentares",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'sedimentares'->0->>'type', '[null]'), '') AS "Tipo sedimentares",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'sedimentares'->0->>'scientificName', '[null]'), '') AS "Nome científico sedimentares",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'sedimentares'->0->>'contact_relations', '[null]'), '') AS "Relações de contato sedimentares",

    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'metamórficas'->0->>'name', '[null]'), '') AS "Nome metamórficas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'metamórficas'->0->>'type', '[null]'), '') AS "Tipo metamórficas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'metamórficas'->0->>'scientificName', '[null]'), '') AS "Nome científico metamórficas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'metamórficas'->0->>'contact_relations', '[null]'), '') AS "Relações de contato metamórficas",

    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'ígneas_intrusivas'->0->>'name', '[null]'), '') AS "Nome ígneas intrusivas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'ígneas_intrusivas'->0->>'type', '[null]'), '') AS "Tipo ígneas intrusivas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'ígneas_intrusivas'->0->>'scientificName', '[null]'), '') AS "Nome científico ígneas intrusivas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'ígneas_intrusivas'->0->>'contact_relations', '[null]'), '') AS "Relações de contato ígneas intrusivas",

    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'vulcânicas_e_subvulcânicas'->0->>'name', '[null]'), '') AS "Nome vulcânicas e subvulcânicas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'vulcânicas_e_subvulcânicas'->0->>'type', '[null]'), '') AS "Tipo vulcânicas e subvulcânicas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'vulcânicas_e_subvulcânicas'->0->>'scientificName', '[null]'), '') AS "Nome científico vulcânicas e subvulcânicas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->1->'response'->'rockTypes'->'vulcânicas_e_subvulcânicas'->0->>'contact_relations', '[null]'), '') AS "Relações de contato vulcânicas e subvulcânicas",
   
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'oreType', '[null]'), '') AS "Tipo de minério",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'rockType', '[null]'), '') AS "Tipo de rocha",
	
    COALESCE(NULLIF((data->'responseData'->0->'data'->2->'response'->'host_rocks'->>'name')::text, '[null]'), '') AS "Nomes rochas hospedeiras",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->'host_rocks'->>'geologicalEnvironments', '[null]'), '') AS "Eventos geológicos rochas hospedeiras",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->'host_rocks'->>'mineralizationStructures', '[null]'), '') AS "Estruturas de mineralização de rochas hospedeiras",

    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'structures', '[null]'), '') AS "Estruturas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'mineralFabric', '[null]'), '') AS "Textura mineral",
	
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'definedEstimate', '[null]'), '') AS "Estimativa definida",
	
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'associatedMinerals', '[null]'), '') AS "Minerais associados",
	
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'estimatedQuantities', '[null]'), '') AS "Quantidades estimadas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'definedConcentration', '[null]'), '') AS "Concentração definida",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'estimatedConcentration', '[null]'), '') AS "Concentração estimada",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'fluidInclusionsAnalysis', '[null]'), '') AS "Análise de inclusões fluidas",
	
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->'hydrotermal_alterations'->>'alterationTypes', '[null]'), '') AS "Tipos de alterações hidrotermais",
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->'hydrotermal_alterations'->>'associatedMinerals', '[null]'), '') AS "Minerais associados a alterações hidrotermais",
	
    COALESCE(NULLIF(data->'responseData'->0->'data'->2->'response'->>'mineralizationSignatures', '[null]'), '') AS "Assinaturas de mineralização",
    COALESCE(NULLIF(data->'responseData'->0->'data'->3->'response'->>'structural_mapping', '[null]'), '') AS "Mapeamento estrutural",
    COALESCE(NULLIF(data->'responseData'->0->'data'->4->'response'->>'structureMineralizationRelation', '[null]'), '') AS "Relação estrutura-mineralização",
    COALESCE(NULLIF(data->'responseData'->0->'data'->5->'response'->>'stableIsotopes', '[null]'), '') AS "Isótopos estáveis",
    COALESCE(NULLIF(data->'responseData'->0->'data'->5->'response'->>'traceElementsAndRareEarths', '[null]'), '') AS "Elementos traço e terras raras",
    COALESCE(NULLIF(data->'responseData'->0->'data'->6->'response'->>'geophysicalSignatures', '[null]'), '') AS "Assinaturas geofísicas",
    COALESCE(NULLIF(data->'responseData'->0->'data'->6->'response'->>'mineralizationSignatures', '[null]'), '') AS "Assinaturas de mineralização geofísica",
    COALESCE(NULLIF(data->'responseData'->0->'data'->7->'response'->>'additionalInformation', '[null]'), '') AS "Informações adicionais de mineralização",
    COALESCE(NULLIF(data->'responseData'->0->'data'->8->'response'->>'estimates', '[null]'), '') AS "Estimativas de minério",
    COALESCE(NULLIF(data->'responseData'->0->'data'->9->'response'->>'potential', '[null]'), '') AS "Potencial de descoberta"
FROM 
    public."Extraction";

