CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER
VIEW view_ciudades
AS
	SELECT
		c.id_zona AS id_ciudad,
		c.descripcion AS nombre_ciudad,
		d.descripcion AS nombre_depto
	FROM
		zona c JOIN zona d ON (LEFT(c.id_zona,5) = d.id_zona)
	WHERE
		(c.nivel = 3 AND d.nivel = 2);
