mirror of
https://github.com/opelly27/WinStudentGoalTracker.git
synced 2026-05-20 02:57:36 +00:00
21 lines
806 B
SQL
21 lines
806 B
SQL
DELIMITER ;;
|
|
CREATE DEFINER=`root`@`%` PROCEDURE `sp_Benchmark_GetByStudentId`(IN p_id_student CHAR(36))
|
|
BEGIN
|
|
SELECT
|
|
s.`identifier` AS `studentIdentifier`,
|
|
b.`id_benchmark` AS `benchmarkId`,
|
|
b.`id_goal` AS `goalId`,
|
|
g.`title` AS `goalTitle`,
|
|
b.`benchmark` AS `benchmark`,
|
|
u.`name` AS `createdByName`,
|
|
b.`created_at` AS `createdAt`,
|
|
b.`updated_at` AS `updatedAt`
|
|
FROM `benchmark` b
|
|
INNER JOIN `goal` g ON g.`id_goal` = b.`id_goal`
|
|
INNER JOIN `student` s ON s.`id_student` = g.`id_student`
|
|
LEFT JOIN `user` u ON u.`id_user` = b.`id_user_created`
|
|
WHERE g.`id_student` = p_id_student
|
|
ORDER BY b.`created_at` DESC;
|
|
END;;
|
|
DELIMITER ;
|