10月笔记
来源:互联网 发布:java 高并发基础教程 编辑:程序博客网 时间:2024/06/05 10:25
create database TestSchool
on primary
(
name="TestSchool.mdf",filename="D:\test\TestSchool.mdf",filegrowth=10%
)
log on
(
name="TestSchool_log.ldf",filename="D:\test\TestSchool_log.ldf"
)
create table TblStudent
(
tSId int identity(1,1) primary key,
tSName nvarchar(10) not null,
TSGender bit default(1),
tSAddress nvarchar(1500),
tSPhone varchar(50),
tSAge int,
tSBirthday datetime,
tSCardid varchar(50),
tSClassid int
)
create table TblScore
(
tScoreId int identity(1,1) primary key,
tSId int null,
tEnglish float,
tMath float
)
go
create table TblTeacher
(
tTId int identity(1,1) primary key,
tTName nvarchar(50),
tTGender bit default(0),
tTAge int,
tTsalary money,
tTBirthday datetime
)
go
insert into TblTeacher(tTName,tTGender,tTAge,tTSalary,tTBirthday) values('姚洪波',1,27,10000,'1980-10-10');
--向特定列插入数据
insert into TblTeacher(tTName,tTSalary) values('李雨锦',5000);
insert into TblTeacher values('辛兴涛','true',27,10000,'1982-07-09');
--union插入多行
insert into TblTeacher
select 'Chris',1,20,1500,'1999-9-9' union
select 'James',1,20,1600,'1999-10-11' union
select 'Tom',1,20,1700,'1999-9-20' union
select 'Marry',0,20,1500,'1999-9-9'
insert into TblTeacher
select '辛兴涛','true',27,10000,'1982-07-09' union
select '辛兴涛','true',27,10000,'1982-07-09'
insert into TblTeacher
select 'Tom','true',20,1700,'1999-9-20' union
select '李莫愁','true',32,12200,'1974-07-09' union
select '李莫愁','true',32,12200,'1974-07-09'
select * from TblTeacher
--向一个已经存在的表中插入数据,数据的来源是另一张表
insert into TblTeacher(tTName,tTAge,tTsalary)
select tTName,tTAge,tTsalary from TblTeacher
select * from TblScore
- 10月笔记
- 12月笔记-10-18
- 3月10学习笔记
- 11月10日笔记
- 2005年1月10学习笔记
- 10月7日学习笔记
- Android 学习笔记-2010年10月
- 工作学习笔记——10月
- 2014年10月28日笔记
- 2014年10月29日笔记
- 9月10日Axure psd笔记
- 10月24日 css学习笔记
- 10月27日 css学习笔记
- 8月10日训练笔记
- 9月10日周日训练笔记
- 10月6日学习笔记
- 10月7日C++学习笔记
- 10月7日Unity学习笔记
- HttpServletRequest
- java面试常考题2
- 双重循环的应用实例--等腰三角形相关
- Tomcat配置Web站点
- Cookie简介
- 10月笔记
- 把字符串abcdef旋转2位得到字符串cdefab
- HttpServletRequest
- Java虚拟机
- grep :line too long
- ssh+mysql中关于大字段的设置
- cookie和session小结
- 高效代码审查的十个经验
- 如何做好一名优秀的程序员