2017年10月30日
摘要:
declare @a int; --先赋值数值类型 set @a=1 --给变量赋值 if @a>1 --判断条件; begin select @a end print 打印 cast (@i as varchar(20)) --改变数值类型
阅读全文
posted @ 2017-10-30 11:08
段了的弦
阅读(135)
推荐(0)
2017年10月27日
摘要:
把题记录一下吧,虽然以后碰到的不一样,但用法还是一样的嘛 还有用到的一些方法 count(*) 计数 group by 分组 join 连接 后面要加 on 连接条件 between and 什么什么之间 in not in 子查询 like 模糊查询 %表示其他内容 --1、 查询Student表
阅读全文
posted @ 2017-10-27 16:44
段了的弦
阅读(244)
推荐(0)
2017年10月25日
摘要:
create trigger 触发器名on 表名for insert --for(after)之后 --instead of 替代 as select * from test 比如 防止误删除 create trigger fsc on table instead of delete as sele
阅读全文
posted @ 2017-10-25 16:30
段了的弦
阅读(104)
推荐(0)
摘要:
select 新表名.列名,新表名.列名 from 表名 新表名 join 表名 新表名 on 新表名.列名=新表名.列名
阅读全文
posted @ 2017-10-25 13:48
段了的弦
阅读(101)
推荐(0)
2017年10月24日
摘要:
模糊查询select * from car where name like '%关键字%' 排序查询select * from car order by 列名 desc --递减select * from car order by 列名 asc --递增(默认) 去重查询select distinc
阅读全文
posted @ 2017-10-24 16:07
段了的弦
阅读(137)
推荐(0)
2017年10月23日
摘要:
增: insert into 表名 values('阿紫','0','回族' insert into 表名 (sex,[name],nation) values ('1','阿碧','汉族') 删: delete from 表明 where nation = '阿紫' 改: update 表名 se
阅读全文
posted @ 2017-10-23 16:50
段了的弦
阅读(164)
推荐(0)
摘要:
--创建数据库create database 数据库名 --定位要操作的数据库use 数据库名 --创建数据表create table 表名( 字段名 数据类型 primary key, --主键约束 字段名 数据类型 unique, --唯一约束 字段名 数据类型 identity(1,1), -
阅读全文
posted @ 2017-10-23 16:42
段了的弦
阅读(121)
推荐(0)
2017年10月21日
摘要:
今天学习了些数据库的基础,东西不多,重在了解 int 整型nvarchar 字符串float 小数型decimal(,) 小数型money 小数型datetime 时间类型 image(很麻烦)text 大字符串 bigintsmallintbit (true&false) 跨表查询(速度最慢) 跨
阅读全文
posted @ 2017-10-21 15:48
段了的弦
阅读(89)
推荐(0)
2017年10月20日
摘要:
今天结束第一阶段了,下午安装完SQL,明天开始学数据库了,先看看书了解一下,加油!
阅读全文
posted @ 2017-10-20 20:27
段了的弦
阅读(104)
推荐(0)
posted @ 2017-10-20 11:29
段了的弦
阅读(197)
推荐(0)