上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 19 下一页
摘要: create table user_infos ( user_id int, user_name nvarchar(10) ); insert into user_infos values (1,'张三'), (2,'李四'), (3,'王五'); --王五没有订单 create table ord 阅读全文
posted @ 2026-04-28 12:15 菜鸟的奋斗军 阅读(5) 评论(0) 推荐(0)
摘要: --用户表 user_info create table user_info ( user_id int, user_name nvarchar(10) ); insert into user_info values (1,N'张三'), (2,N'李四'), (3,N'王五'); --订单表 cr 阅读全文
posted @ 2026-04-28 11:25 菜鸟的奋斗军 阅读(6) 评论(0) 推荐(0)
摘要: create table class_score ( class_name nvarchar(10), stu_name nvarchar(10), score int ); insert into class_score values (N'一班',N'小明',85), (N'一班',N'小红', 阅读全文
posted @ 2026-04-27 23:20 菜鸟的奋斗军 阅读(7) 评论(0) 推荐(0)
摘要: create table employee ( dept_name nvarchar(20), salary int ); insert into employee values (N'销售部',6000), (N'销售部',8000), (N'销售部',7000), (N'技术部',12000), 阅读全文
posted @ 2026-04-27 22:46 菜鸟的奋斗军 阅读(8) 评论(0) 推荐(0)
摘要: GROUP BY 必须配合聚合函数使用(COUNT/SUM/AVG/MAX/MIN) SELECT 后面只能出现两种东西 分组字段(GROUP BY 里的字段) 聚合函数(COUNT/SUM...) create table studenter ( name nvarchar(10), gender 阅读全文
posted @ 2026-04-27 17:10 菜鸟的奋斗军 阅读(8) 评论(0) 推荐(0)
摘要: --聚合函数 多行数据 合并计算成一行 create table score_info ( stu_name nvarchar(20), score int ); insert into score_info values (N'张三',80), (N'李四',90), (N'王五',60), (N 阅读全文
posted @ 2026-04-27 16:18 菜鸟的奋斗军 阅读(7) 评论(0) 推荐(0)
摘要: create table studentff ( stu_name nvarchar(20), phone varchar(11) ); insert into studentff values (N'张三','13864668825'), (N'李四',null), --手机号为空 (N'王五', 阅读全文
posted @ 2026-04-27 12:34 菜鸟的奋斗军 阅读(7) 评论(0) 推荐(0)
摘要: create table studentsd ( id int, stu_name nvarchar(20) ); insert into studentsd values (1,N'张三'), (2,N'张三丰'), (3,N'张无忌'), (4,N'李四'), (5,N'张小凡'); --开头匹 阅读全文
posted @ 2026-04-27 11:29 菜鸟的奋斗军 阅读(9) 评论(0) 推荐(0)
摘要: create table studentfd ( stu_name nvarchar(20), age int, city nvarchar(20) ); --插入测试数据 insert into studentfd values (N'张三',18,N'北京'), (N'李四',20,N'上海') 阅读全文
posted @ 2026-04-27 09:45 菜鸟的奋斗军 阅读(10) 评论(0) 推荐(0)
摘要: 查询 “在两个值之间” 的数据 相当于:>= 最小值 AND <= 最大值 create table studentdf ( name nvarchar(10), age int ); insert into studentdf values ('张三',18), ('李四',20), ('王五', 阅读全文
posted @ 2026-04-27 00:45 菜鸟的奋斗军 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 19 下一页