CREATE OR REPLACE VIEW view_type_empresa AS
SELECT 
	emp.id_empresa AS "id",
	emp.nome AS "nome_empresa",
	srv.type_empresa AS "tipo_empresa",
	CASE 
		WHEN
			emp.active = 1
		THEN
			"true"
		ELSE
			"false"
	END AS active			
FROM empresas emp
JOIN server_data srv ON srv.id_type_empresa = emp.id_type_empresa