随笔分类 -  数据库SQLserve

数据库表案例集合
摘要:系统已上线,给客户修改bug的时候,使用delete语句删表数据,没想到库没切换成测试库。误删了正式库的数据,而且一次备份都没有做过,玩大了 不扯了,进入主题 网上很多方法,都是针对至少有一次备份的情况下进行数据恢复的,没有备份就基本上只能找数据恢复公司了。本章将通过日志来恢复误删的数据,若是日志文 阅读全文
posted @ 2022-03-25 16:25 优敏行 阅读(667) 评论(0) 推荐(1) 编辑
摘要:如果您仅仅管技术的事情,当然是只拿到技术开发的薪资待遇水平。 多管事情了,也必然多拿多管事情的薪酬,比如业务方面,管了就要多拿薪水,这是职场工作中,必然的事情了。 一份付出一份收货. 仅仅管好自个份内的事情,必然可控因素相对少,是可控的。但是一旦加入了外人进来,就增加了不可控因素了。 一方沟通不到位 阅读全文
posted @ 2022-03-12 11:51 优敏行 阅读(183) 评论(0) 推荐(0) 编辑
摘要:--查询学生表 select * from student; --查询老师表全部数据 select * from teacher; --查询中间表03 关联老师表,学生表 select * from t_s; --01 小红的老师是谁 select * from t_s left join stud 阅读全文
posted @ 2022-03-10 11:40 优敏行 阅读(501) 评论(0) 推荐(0) 编辑
摘要:--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 优敏行 阅读(267) 评论(0) 推荐(0) 编辑
摘要:1 -- 多对多表查询 /* 创建student(id,name) teacher(id,name) 和关系表 t_s(tid,sid) 保存以下数据: 仓老师:小明 小红 小绿 小蓝 范老师:小张 小李 1. 查询每个学生对应的老师 2. 查询苍老师的学生有哪些 3. 查询小红的老师是谁 */ - 阅读全文
posted @ 2022-03-09 15:13 优敏行 阅读(96) 评论(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 优敏行 阅读(42) 评论(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 优敏行 阅读(178) 评论(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 优敏行 阅读(47) 评论(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 优敏行 阅读(956) 评论(0) 推荐(0) 编辑
摘要:1 2行以及多行更新 SQL语句 就一行代码的事情? yes update Student_demo set name='唐僧',NJID=3 where id=11; 阅读全文
posted @ 2022-02-28 09:25 优敏行 阅读(27) 评论(0) 推荐(0) 编辑
摘要:1 条件查询的learn与记住 阅读全文
posted @ 2022-02-25 16:50 优敏行 阅读(23) 评论(0) 推荐(0) 编辑
摘要:使用SSMS数据库管理工具创建视图 1 创建测试数据库 2、在添加表弹出框-》选择要创建视图的表、视图、函数、或者同义词等-》点击添加-》添加完成后选择关闭。 继续 自动生成SQL语句的部分,最下面 显示字段和关联字段为实际开发中,需要直接用到的. 成功创建,保存了视图 阅读全文
posted @ 2022-02-24 11:18 优敏行 阅读(123) 评论(0) 推荐(0) 编辑
摘要:无参数的存储过程创建 USE [Learn] GO /****** Object: StoredProcedure [dbo].[SCO_bav] Script Date: 2021/12/24 星期五 11:53:49 ******/ SET ANSI_NULLS ON GO SET QUOTED 阅读全文
posted @ 2021-12-24 11:55 优敏行 阅读(43) 评论(0) 推荐(0) 编辑
摘要:select * from do_web_bxd; --修改报销单表中的创建人字段数据 update do_web_bxd set Creator='张三' where BXD_NM='ee8bd386-d80a-41b2-8020-410b8d1177e2'; --修改单据日期字段值内容 upda 阅读全文
posted @ 2021-12-22 11:56 优敏行 阅读(33) 评论(0) 推荐(0) 编辑
摘要:数据库比较简单的了, 就是创建表就OK了。 entity框架类 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; // 阅读全文
posted @ 2021-11-30 17:47 优敏行 阅读(37) 评论(0) 推荐(0) 编辑
摘要:--sort 表 分类表 create table Sort( ID int identity(1,1), Title nvarchar(50) not null, Name nvarchar(200) null, ImgUrl varchar(100) null, Content nvarchar 阅读全文
posted @ 2021-11-17 14:26 优敏行 阅读(62) 评论(0) 推荐(0) 编辑
摘要:create table Student( ID int identity(1,1) not null, Name nvarchar(50) not null, Age int not null, ChineseScores int null,--语文成绩 MathScores int null,- 阅读全文
posted @ 2021-10-13 19:27 优敏行 阅读(168) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示