Auto commit
This commit is contained in:
parent
3fd783abc5
commit
1101eebe94
@ -580,5 +580,25 @@ CREATE VIEW v_education AS
|
|||||||
SELECT s.`name` '学生姓名', c.`name` '课程名称', l.`schedule` '学习进度', l.createtime '创建时间'
|
SELECT s.`name` '学生姓名', c.`name` '课程名称', l.`schedule` '学习进度', l.createtime '创建时间'
|
||||||
FROM t_student s, t_learn l, t_course c
|
FROM t_student s, t_learn l, t_course c
|
||||||
WHERE s.id = l.s_id AND l.c_id = c.id;
|
WHERE s.id = l.s_id AND l.c_id = c.id;
|
||||||
|
|
||||||
|
#8
|
||||||
|
CREATE TRIGGER tri_insert_student_learn
|
||||||
|
AFTER INSERT ON t_student
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO t_learn (s_id, c_id, schedule, createtime)
|
||||||
|
VALUES (NEW.id, 10001, 0, '2025-01-01');
|
||||||
|
END
|
||||||
|
|
||||||
|
#9
|
||||||
|
CREATE PROCEDURE `sp_get_student_courses`(
|
||||||
|
IN in_student_id INT,
|
||||||
|
OUT out_course_count INT
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
SELECT COUNT(DISTINCT c_id) INTO out_course_count
|
||||||
|
FROM t_learn
|
||||||
|
WHERE s_id = in_student_id ;
|
||||||
|
END
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user