15 lines
364 B
SQL
15 lines
364 B
SQL
CREATE PROCEDURE `studentTranscript`(
|
|
IN `ID` INT
|
|
)
|
|
BEGIN
|
|
IF EXISTS(SELECT 1 from Students where studentID = ID) THEN
|
|
SELECT courseName, letterGrade
|
|
FROM Enrollments
|
|
NATURAL JOIN Courses
|
|
NATURAL JOIN Students
|
|
WHERE studentID = ID;
|
|
ELSE
|
|
SIGNAL SQLSTATE '45006'
|
|
SET MESSAGE_TEXT = 'Student ID does not exist in system.';
|
|
END IF;
|
|
END |