-- >>> consulta los parentescos
DELIMITER $$
DROP VIEW IF EXISTS cParentescos;
CREATE VIEW cParentescos
(clave, descripcion)
AS
	SELECT clave, descripcion FROM parentescos ORDER BY descripcion;
$$

-- >>> consulta todos los residentes
DELIMITER $$
DROP VIEW IF EXISTS cResidentes;
CREATE VIEW cResidentes
(clave, nombre, paterno, materno)
AS
	-- lista los registros'
	SELECT clave AS clave, descifrar(nombre) AS nombre, descifrar(paterno) AS paterno, descifrar(materno) AS materno
	FROM residentes
	ORDER BY descifrar(nombre);
$$
