3个回答
展开全部
name : 学生姓名
score: 成绩
student_id: 学号(主键)
Level: 成绩等级
delimiter //
drop procedure if exists getstudentLevel //
create procedure getstudentLevel(in in_student_id int)
begin
select case when score >= 90 then 'A'
when score >= 75 and score < 90 then 'B'
when score >= 60 and score < 75 then 'C'
when score < 60 then 'D' end as Level
from study.student_course where student_id = in_student_id;
end //
call getstudentLevel(1) //
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
学生成绩查询(分别按学号、姓名、班级、课程、开设学期),显示信息自定。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
USE Study;
GO
CREATE PROCEDURE getGradeDesc
@StuId nvarchar(50),
@desc nvarchar(2) output
AS
declare @num int
SET NOCOUNT ON;
SELECT @num=score from Study.Student_course
WHERE StuId = @StuId;
CASE
WHEN @num >= 90 then @desc='A'
WHEN @num < 90 and @num>=75 then @desc='B'
WHEN @num < 75 and @num>=60 then @desc='C'
WHEN @num < 60 then @desc='D'
END
GO
GO
CREATE PROCEDURE getGradeDesc
@StuId nvarchar(50),
@desc nvarchar(2) output
AS
declare @num int
SET NOCOUNT ON;
SELECT @num=score from Study.Student_course
WHERE StuId = @StuId;
CASE
WHEN @num >= 90 then @desc='A'
WHEN @num < 90 and @num>=75 then @desc='B'
WHEN @num < 75 and @num>=60 then @desc='C'
WHEN @num < 60 then @desc='D'
END
GO
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询