- 博客(10)
- 收藏
- 关注
原创 存储过程
create proc p1asbeginselect * from sc where sno = ‘2020005’endexec p1—begin end 相当于() 存储过程相当于数据库的函数select *fromcreate proc p2 @sno varchar(13),@cno varchar(13)asbeginselect sc.*,cou.ccredit from sc,cou where sno = @sno and sc.cno = @cno and sc.
2021-03-02 16:08:55
96
原创 视图
create view v_aaasselect *from stuselect * from v_aa—视图就是查询表信息的记录—视图用聚合函数一定要有列名
2021-03-02 15:42:34
89
原创 多表查询与子查询
select stu.,sc. from stu,sc where stu.sno=sc.snoselect * from stuselect * from scselect * from couselect sname from stu,sc where stu.sno = sc.sno and sc.cno=‘20201’select stu.,sc.,ctime from stu,sc,cou where stu.sno = sc.sno and sc.cno=cou.cnoselect
2021-03-02 15:19:49
154
原创 聚集函数的使用
select * from sc order by gradeselect * from sc order by grade descselect count(*) from stuselect count(distinct sno) from sc—以什么为区分 group byselect cno,count(sno) as num from sc group by cno—where 后不出现聚集函数—having 和group by 连用select sno,avg(grade)
2021-03-02 14:25:49
271
原创 单表查询
select sname,2021-age as birthdate from stuselect sno from scselect distinct sno from sc查询名字叫小十select * from stu where sname = ‘小十’select sno from sc where cno = ‘20201’ and grade >80查询年龄18-19岁的select sname from stu where age between 18 and 19查询
2021-03-02 12:59:44
129
原创 简单增删改
alter table stu add qq varchar(20)alter table stu drop column qqcreate table qq(t int)drop table qq--------------0为女 1为男insert into stu values(1,'上官婉儿‘,20,0,null)insert into stu values(2,'ccs20,1,1)
2021-03-02 12:30:43
87
原创 sql 建库建表语句
create database stuinfouse stuinfocreate table major(mno int,mname varchar(20),primary key(mno))select * from majorcreate table stu(sno int,sname varchar(30),age smallint,sex bit,mno int,primary key(sno),foreign key(mno) references major(mno
2021-03-01 18:08:46
340
原创 markdown学习
#Markdown学习#标题三级标题四级标题字体hello,world!hello,world!hello,world!hello,world!引用学习大数据走向人生巅峰分割线图片[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wBwEcV8T-1613983697310)(C:\Users\ccs\Desktop\1.png)][外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GJmk0PGe-161398369
2021-02-22 16:53:00
103
原创 2020/10/20 PYTHON 列表 元组 字典
一、列表 [ ]可以混合类型(1)增 append && extend && inserta.append() 可以嵌套列表a.extend() 拆分加入列表a.insert(1,2) 第一个是下标位置 第二个是插入元素(2)删 del && pop && removedel a[1]a.pop() 默认删除最后一个a.remove(“x”) 删除某个确定元素,重复删除第一个(3)改a[1] = “x”(4)查 in
2020-10-21 01:35:49
144
原创 python学习
2020/10/19循环控制语句:一定要加: while 可以和else一起使用i = 1w = 1for i in range(1,10):for w in range(1,(i+1)):print("%d%d = %d"%(i,w,i*w),end = ‘\t’)*print(’\n’)‘’’字符串:’’’word = ‘字符串’sentence = “这是一个句子”p = “”"这是一个段落 #保存所有格式可以由多行组成“”"print(word)print(s
2020-10-19 19:50:39
92
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅