mirror of
https://github.com/opelly27/WinStudentGoalTracker.git
synced 2026-05-20 04:07:39 +00:00
lots of work done
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
DELIMITER ;;
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `sp_Goal_GetByStudentId`(IN p_id_student CHAR(36))
|
||||
BEGIN
|
||||
SELECT
|
||||
s.`identifier` AS `studentIdentifier`,
|
||||
vc.`goalId`,
|
||||
vc.`goalParentId`,
|
||||
vc.`title`,
|
||||
vc.`description`,
|
||||
vc.`category`,
|
||||
vc.`progressEventCount`
|
||||
FROM `v_goal_card` vc
|
||||
INNER JOIN `student` s ON s.`id_student` = vc.`studentId`
|
||||
WHERE vc.`studentId` = p_id_student
|
||||
ORDER BY vc.`goalId`;
|
||||
END;;
|
||||
DELIMITER ;
|
||||
@@ -0,0 +1,18 @@
|
||||
CREATE OR REPLACE VIEW `v_goal_card` AS
|
||||
SELECT
|
||||
goal.`id_goal` AS `goalId`,
|
||||
goal.`id_goal_parent` AS `goalParentId`,
|
||||
goal.`id_student` AS `studentId`,
|
||||
goal.`title` AS `title`,
|
||||
goal.`description` AS `description`,
|
||||
goal.`category` AS `category`,
|
||||
COUNT(pe.`id_progress_event`) AS `progressEventCount`
|
||||
FROM `goal`
|
||||
LEFT JOIN `progress_event` pe ON pe.`id_goal` = goal.`id_goal`
|
||||
GROUP BY
|
||||
goal.`id_goal`,
|
||||
goal.`id_goal_parent`,
|
||||
goal.`id_student`,
|
||||
goal.`title`,
|
||||
goal.`description`,
|
||||
goal.`category`;
|
||||
@@ -10,7 +10,7 @@ FROM `student` s
|
||||
LEFT JOIN `goal` g
|
||||
ON g.`id_student` = s.`id_student`
|
||||
LEFT JOIN `progress_event` pe
|
||||
ON pe.`id_student` = s.`id_student`
|
||||
ON pe.`id_goal` = g.`id_goal`
|
||||
GROUP BY
|
||||
s.`id_student`,
|
||||
s.`identifier`,
|
||||
|
||||
Reference in New Issue
Block a user