12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-11-29 09:52:21
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
一、 编写一条update语句实现商品涨价,具体规则如下1、99元以内,提价20%2、100-999元之间,提价10%3、1000-1999之间,提价5%4、其他提价2%updategoodssetprice=(casewhenpricebet
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
一、 编写一条update语句实现商品涨价,具体规则如下
1、99元以内,提价20%
2、100-999元之间,提价10%
3、1000-1999之间,提价5%
4、其他提价2%
updategoodssetprice=(casewhenpricebetween0and99thenprice*1.2whenpricebetween100and999thenprice*1.1whenpricebetween1000and1999thenprice*1.05whenprice>1999thenprice*1.02end);select*fromgoods;
二、 编写一条select语句,实现如下效果
学号姓名分数等级-------------------------------------------------1张三86良好2李四98优秀3王五72及格4那六69及格5小幺56不及格
规则如下:
1、>=90:优秀
2、>=80:良好
3、>=60:及格
4、<60:不及格
selectidas学号,nameas姓名,scoreas分数,(casewhenscore>=90then'优秀'whenscore>=80andscore<90then'良好'whenscore>=60andscore<80then'及格'whenscore<60then'不及格'end)as等级fromscores;
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19