- 博客(10)
- 收藏
- 关注
原创 存储过程
create proc p1 as begin select * from sc where sno = ‘2020005’ end exec p1 —begin end 相当于() 存储过程相当于数据库的函数 select *from create proc p2 @sno varchar(13),@cno varchar(13) as begin select sc.*,cou.ccredit from sc,cou where sno = @sno and sc.cno = @cno and sc.
2021-03-02 16:08:55
44
原创 视图
create view v_aa as select *from stu select * from v_aa —视图就是查询表信息的记录 —视图用聚合函数一定要有列名
2021-03-02 15:42:34
44
原创 多表查询与子查询
select stu.,sc. from stu,sc where stu.sno=sc.sno select * from stu select * from sc select * from cou select 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.cno select
2021-03-02 15:19:49
89
原创 聚集函数的使用
select * from sc order by grade select * from sc order by grade desc select count(*) from stu select count(distinct sno) from sc —以什么为区分 group by select cno,count(sno) as num from sc group by cno —where 后不出现聚集函数 —having 和group by 连用 select sno,avg(grade)
2021-03-02 14:25:49
214
原创 单表查询
select sname,2021-age as birthdate from stu select sno from sc select 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
71
原创 简单增删改
alter table stu add qq varchar(20) alter table stu drop column qq create 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
43
原创 sql 建库建表语句
create database stuinfo use stuinfo create table major( mno int, mname varchar(20), primary key(mno) ) select * from major create 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
273
原创 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
46
原创 2020/10/20 PYTHON 列表 元组 字典
一、列表 [ ] 可以混合类型 (1)增 append && extend && insert a.append() 可以嵌套列表 a.extend() 拆分加入列表 a.insert(1,2) 第一个是下标位置 第二个是插入元素 (2)删 del && pop && remove del a[1] a.pop() 默认删除最后一个 a.remove(“x”) 删除某个确定元素,重复删除第一个 (3)改 a[1] = “x” (4)查 in
2020-10-21 01:35:49
91
原创 python学习
2020/10/19 循环控制语句:一定要加: while 可以和else一起使用 i = 1 w = 1 for 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
48
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人