mysql> use launiversidadt3;
Database changed
mysql> show tables;
+--------------------------------+
| Tables_in_launiversidadt3      |
+--------------------------------+
| alumno                         |
| alumno_se_matricula_asignatura |
| asignatura                     |
| curso_escolar                  |
| departamento                   |
| grado                          |
| profesor                       |
+--------------------------------+
7 rows in set (0.00 sec)

mysql> launiversidadt3DELIMITER //
    ->
    -> CREATE FUNCTION TotalCreditosAlumno(AlumnoID INT, Anio INT)
    -> RETURNS FLOAT
    -> BEGIN
    ->     DECLARE totalCreditos FLOAT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'launiversidadt3DELIMITER //

CREATE FUNCTION TotalCreditosAlumno(AlumnoID INT, A' at line 1
mysql>     SELECT SUM(a.creditos)
    ->     INTO totalCreditos
    ->     FROM alumno_se_matricula_asignatura am
    ->     JOIN asignatura a ON am.id_asignatura = a.id_asignatura
    ->     JOIN curso_escolar cs ON am.id_curso_escolar = cs.id_curso_escolar
    ->     WHERE am.id_alumno = AlumnoID AND cs.anyo_fin = Anio;
ERROR 1327 (42000): Undeclared variable: totalCreditos
mysql>     RETURN totalCreditos;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN totalCreditos' at line 1
mysql> END //
    ->
    -> CREATE FUNCTION PromedioHorasPorAsignatura(AsignaturaID INT)
    -> RETURNS FLOAT
    -> BEGIN
    ->     DECLARE promedio FLOAT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END //

CREATE FUNCTION PromedioHorasPorAsignatura(AsignaturaID INT)
RETURNS FLO' at line 1
mysql>     SELECT AVG(a.creditos)
    ->     INTO promedio
    ->     FROM asignatura a
    ->     WHERE a.id_asignatura = AsignaturaID;
ERROR 1327 (42000): Undeclared variable: promedio
mysql>     RETURN promedio;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN promedio' at line 1
mysql> END //
    ->
    -> CREATE FUNCTION TotalHorasPorDepartamento(DepartamentoID INT)
    -> RETURNS FLOAT
    -> BEGIN
    ->     DECLARE totalHoras FLOAT;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END //

CREATE FUNCTION TotalHorasPorDepartamento(DepartamentoID INT)
RETURNS FL' at line 1
mysql>     SELECT SUM(a.creditos)
    ->     INTO totalHoras
    ->     FROM asignatura a
    ->     JOIN profesor p ON a.id_profesor = p.id_profesor
    ->     WHERE p.id_departamento = DepartamentoID;
ERROR 1327 (42000): Undeclared variable: totalHoras
mysql>     RETURN totalHoras;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN totalHoras' at line 1
mysql> END //
    ->
    -> CREATE FUNCTION VerificarAlumnoActivo(AlumnoID INT)
    -> RETURNS BOOLEAN
    -> BEGIN
    ->     DECLARE activo BOOLEAN;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END //

CREATE FUNCTION VerificarAlumnoActivo(AlumnoID INT)
RETURNS BOOLEAN
BEGI' at line 1
mysql>     SELECT COUNT(*)
    ->     INTO activo
    ->     FROM alumno_se_matricula_asignatura am
    ->     WHERE am.id_alumno = AlumnoID AND am.id_curso_escolar = (SELECT MAX(id_curso_escolar) FROM curso_escolar);
ERROR 1327 (42000): Undeclared variable: activo
mysql>     RETURN activo > 0;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN activo > 0' at line 1
mysql> END //
    ->
    -> CREATE FUNCTION EsProfesorVIP(ProfesorID INT)
    -> RETURNS BOOLEAN
    -> BEGIN
    ->     DECLARE esVIP BOOLEAN;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END //

CREATE FUNCTION EsProfesorVIP(ProfesorID INT)
RETURNS BOOLEAN
BEGIN
    ' at line 1
mysql>     SELECT COUNT(a.id_asignatura) >= 5 INTO esVIP
    ->     FROM asignatura a
    ->     WHERE a.id_profesor = ProfesorID;
ERROR 1327 (42000): Undeclared variable: esVIP
mysql>     RETURN esVIP;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN esVIP' at line 1
mysql> END //
    ->
    -> DELIMITER ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END //

DELIMITER' at line 1
mysql>