摘要: if exists(select * from sys.sysdatabases where [name] = 'DB_Student')drop database DB_Studentgocreate database DB_Studenton( name = DB_Student_mdf, filename = 'E:\DB_Student_mdf.mdf', size = 3mb, maxsize = 100mb, filegrowth=1mb)log on( name = DB_Student_ldf, filename = 'E:\DB_Stu 阅读全文
posted @ 2013-07-23 02:14 秋日的私语(且行且珍惜) 阅读(204) 评论(0) 推荐(0) 编辑
摘要: select top 1 with ties name,stuId,sex,score from stuInfo order by score desc 阅读全文
posted @ 2013-07-23 01:23 秋日的私语(且行且珍惜) 阅读(190) 评论(0) 推荐(0) 编辑
摘要: select distinct sex from stuInfo//查询不重复的select top 3 * from stuInfo//查询表的前三行select top 30 percent * from stuInfo//查询表的前边的百分之三十行select top 2 * from stuInfo order by NEWID() 阅读全文
posted @ 2013-07-23 01:16 秋日的私语(且行且珍惜) 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1、delete from table_Usergo2、truncate table table_Usergo这两种方法删除的结果一样,都是删除表中所有的数据,但是第二种方法删除得更快,使用的系统资源和事务日志资源更少。Delete :删除数据表中的行(可以删除某一行,也可以在不删除数据表的情况下删除所有行)。删除某一行:Delete from 数据表名称 where 列名称=值;删除所有行:Delete * from 数据表名称Drop :删除数据表或数据库,或删除数据表字段。删除数据库:drop database 数据库名称删除数据表:(表的结构、属性、索引也会被删除) use 数据库名称 阅读全文
posted @ 2013-07-23 00:49 秋日的私语(且行且珍惜) 阅读(4397) 评论(0) 推荐(1) 编辑
摘要: 1、insert into stuInfo(name,stuId) values('李洁','19291727')insert into stuInfo(name,stuId) values('李康','19291728')insert into stuInfo(name,stuId) values('何洁','19291729')insert into stuInfo(name,stuId) values('何宇','19291730')go2、insert int 阅读全文
posted @ 2013-07-23 00:40 秋日的私语(且行且珍惜) 阅读(358) 评论(0) 推荐(0) 编辑