摘要: --约束 对列的值起一个约束的作用,规定咧的值得范围--主键,外键,非空,自增长标识列,唯一列,check 约束select *from score--存储累加求和alter proc qiuhe@number intas declare @sum int--定义一个变量 int类型 ... 阅读全文
posted @ 2015-04-28 10:11 王文姿 阅读(171) 评论(0) 推荐(0) 编辑
摘要: create database Fruitcreate table fruit(Ids varchar(50),Name varchar(50),Price decimal(18,2),Source varchar(50),Stack int,Numbers int,Image varchar(50... 阅读全文
posted @ 2015-04-27 15:20 王文姿 阅读(171) 评论(0) 推荐(0) 编辑
摘要: -存储过程--定义变量declare @bianliang intset @bianliang=12--变量赋值select @bianliang--输出变量print @bianliang--消息框--定义两个变量求和declare @bianliang1 int, @bianliang2 int... 阅读全文
posted @ 2015-04-26 16:28 王文姿 阅读(165) 评论(0) 推荐(0) 编辑
摘要: --仓库表:--仓库号 城市 面积--wh1 北京 370--wh2 上海 500--wh3 广州 200--wh4 武汉 400create table cangku(cno varchar(50) primary key not nul... 阅读全文
posted @ 2015-04-25 23:02 王文姿 阅读(896) 评论(0) 推荐(0) 编辑
摘要: (1)日期函数1,year--取年份出来2,dateadd(day 5 '1999-02-27')--在日期的基本上加入5天没人啊,然后输出3,datedif--两个日期相差多少天4,weekday--字符串形式,一个星期中的星期几5,week--int类型时间6,getdate--获取系统时间7,... 阅读全文
posted @ 2015-04-25 20:33 王文姿 阅读(188) 评论(0) 推荐(0) 编辑
摘要: create database s000create table student(sno int primary key not null,--学生的学号 number的简称sname varchar(50) not null,--学生的名字ssex varchar(50) not null,-... 阅读全文
posted @ 2015-04-22 22:05 王文姿 阅读(719) 评论(0) 推荐(0) 编辑
摘要: 聚合函数(1)count(*)--只能放数值类型的列 求和(2) avg ; --求平均分(3) max; --最大(4) min; --最小(5) as; --起别名(6) group by--分组 后面跟着 having --只能跟在group by后面使用(7) l... 阅读全文
posted @ 2015-04-22 22:01 王文姿 阅读(183) 评论(0) 推荐(0) 编辑
摘要: create database mmmcreate table xxx(code int primary key identity(1,1),name varchar(50) not null,sex varchar(50) not null,age int not null,hight decim... 阅读全文
posted @ 2015-04-20 15:54 王文姿 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 三、类namespace String_类_Math_类_{ class Program { static void Main(string[] args) { while (true) { ... 阅读全文
posted @ 2015-04-19 19:16 王文姿 阅读(281) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { while (true) { int n = 0; ... 阅读全文
posted @ 2015-04-19 19:15 王文姿 阅读(410) 评论(0) 推荐(0) 编辑