上一页 1 2 3 4 5 6 ··· 24 下一页
摘要: --01 部门表 create table t_dept( ID int identity(1,1), Depname varchar(100) null, --部门名称 loc nvarchar(100) null,-- Location 所在地 primary key(ID) ); go --查 阅读全文
posted @ 2022-03-09 15:30 优敏行 阅读(282) 评论(0) 推荐(0)
摘要: 1 -- 多对多表查询 /* 创建student(id,name) teacher(id,name) 和关系表 t_s(tid,sid) 保存以下数据: 仓老师:小明 小红 小绿 小蓝 范老师:小张 小李 1. 查询每个学生对应的老师 2. 查询苍老师的学生有哪些 3. 查询小红的老师是谁 */ - 阅读全文
posted @ 2022-03-09 15:13 优敏行 阅读(104) 评论(0) 推荐(0)
摘要: --查询表演专业的女学生 有多少人 select * from TLstudent as a left join MajorF as b on a.MajorID=b.MajorID -- 02 关联字段的确认 where b.majorid=2 and gender='女'; --01 最核心的一 阅读全文
posted @ 2022-03-08 18:06 优敏行 阅读(44) 评论(0) 推荐(0)
摘要: 1 --单表查询 学生表 select * from st; -- count query 查询全部学生的数量 137 select count(*) as 全部学生人数 from st; --查询全部女生人数 基础条件查询 select count(*) as 全部女生人数 from st whe 阅读全文
posted @ 2022-03-05 11:46 优敏行 阅读(191) 评论(0) 推荐(0)
摘要: case when定义 用于判断计算条件列表的表达式,并且返回可能的结果之一.。简单say 就是如果就的意思. The expression used to judge the list of calculation conditions and return one of the possible 阅读全文
posted @ 2022-03-02 11:22 优敏行 阅读(54) 评论(0) 推荐(0)
摘要: -- name edit 1 修改更新1条信息的多个字段语法 update student_demo set name='关之琳', Age=59, sex='女',major='明星' where id=15; --修改李连杰年龄,专业信息 update student_demo set name 阅读全文
posted @ 2022-02-28 15:34 优敏行 阅读(978) 评论(0) 推荐(0)
摘要: 1 2行以及多行更新 SQL语句 就一行代码的事情? yes update Student_demo set name='唐僧',NJID=3 where id=11; 阅读全文
posted @ 2022-02-28 09:25 优敏行 阅读(31) 评论(0) 推荐(0)
摘要: 1 条件查询的learn与记住 阅读全文
posted @ 2022-02-25 16:50 优敏行 阅读(29) 评论(0) 推荐(0)
摘要: 使用SSMS数据库管理工具创建视图 1 创建测试数据库 2、在添加表弹出框-》选择要创建视图的表、视图、函数、或者同义词等-》点击添加-》添加完成后选择关闭。 继续 自动生成SQL语句的部分,最下面 显示字段和关联字段为实际开发中,需要直接用到的. 成功创建,保存了视图 阅读全文
posted @ 2022-02-24 11:18 优敏行 阅读(136) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2022-02-21 13:46 优敏行 阅读(27) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 24 下一页