摘要: ---恢复内容开始---//注释一行using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;//命名空间namespace first... 阅读全文
posted @ 2014-12-11 20:20 ヾBailey灬 阅读(98) 评论(0) 推荐(2)
摘要: ----一元二次方程存储过程alter proc yiyuanerci@a int,@b int,@c intasbegin if @a=0 begin --print '不是一元二次方程' return 1 end else begin declare @sqrt decimal(18,2)... 阅读全文
posted @ 2014-12-02 14:07 ヾBailey灬 阅读(139) 评论(0) 推荐(1)
摘要: --输入参数的存储过程alter proc jiayibai@shuru int,@canshu intasbegin print @shuru+@canshuendgoexec jiayibai 10,120 阅读全文
posted @ 2014-12-02 14:04 ヾBailey灬 阅读(76) 评论(0) 推荐(1)
摘要: -----判断是否是一元二次方程declare @a int,@b int,@c int,@x1 decimal(18,2),@x2 decimal(18,2)set @a=1set @b=5set @c=4if @a=0begin print '不是一元二次方程,因为a=0'endelsebegi... 阅读全文
posted @ 2014-12-02 14:03 ヾBailey灬 阅读(271) 评论(0) 推荐(1)
摘要: 一、定义变量declare @sum int --变量名以@开头,后面接数据类型二、变量赋值set @sum=1三、变量使用print @sum --不能单独执行次命令,需要与上两个变量配合例:declare@string varchar(20) set @string='abcdefg' set ... 阅读全文
posted @ 2014-12-01 08:58 ヾBailey灬 阅读(96) 评论(0) 推荐(1)
摘要: USE LOL --字符串函数--string functions--ASCLL:从2008版数据库新增,编码与字符串的转换print ascii('abcde')print ascii(' ')--CHAR:将int类型码转换为字符print char (97)--charindex:查找字符串中... 阅读全文
posted @ 2014-12-01 08:56 ヾBailey灬 阅读(137) 评论(0) 推荐(1)
摘要: use 学生gocreate table Teacher(Tno char(3)primary key,--教工编号Tname char(4)not null,--教工姓名Tsex char(2)not null,--教工性别Tbirthday datetime,--教工出生年月Prof char(... 阅读全文
posted @ 2014-12-01 08:55 ヾBailey灬 阅读(301) 评论(0) 推荐(1)
摘要: use 学生--1、 查询Student表中的所有记录的Sname、Ssex和Class列。select sname,ssex,class from student--2、 查询教师所有的单位即不重复的Depart列。select distinct depart from teacher--3、 查... 阅读全文
posted @ 2014-12-01 08:54 ヾBailey灬 阅读(425) 评论(0) 推荐(1)
摘要: use LOL gocreate table zuoye(code int primary key identity(1,1),name varchar(20),class char(3),sex char(2),teacher varchar(20),birth datetime ,height ... 阅读全文
posted @ 2014-11-25 09:26 ヾBailey灬 阅读(120) 评论(0) 推荐(1)
摘要: 查询的四个基本部分:select [查询内容]from [查询对象]where[过滤条件]order by [结果排序]基本查询的语法框架:selectfromwhereorder by[ASC或DESC]where、oreder by 可选部分查询全部行和列:select *from 使用"as"... 阅读全文
posted @ 2014-11-25 09:23 ヾBailey灬 阅读(120) 评论(0) 推荐(1)