婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 通過T_sql語句向其中一次填入一條數(shù)據(jù)或一次填入多條數(shù)據(jù)的方式填充數(shù)據(jù)

通過T_sql語句向其中一次填入一條數(shù)據(jù)或一次填入多條數(shù)據(jù)的方式填充數(shù)據(jù)

熱門標(biāo)簽:400電話申請需要開戶費嗎 山西語音外呼系統(tǒng)價格 威海智能語音外呼系統(tǒng) 智能語音外呼系統(tǒng)哪個牌子好 北京辦理400電話多少 南京電銷外呼系統(tǒng)運營商 重慶防封電銷機器人供應(yīng)商 溫州語音外呼系統(tǒng)代理 西安青牛防封電銷卡
使用T_SQL創(chuàng)建數(shù)據(jù)庫 TestSchool

創(chuàng)建一個學(xué)生表 TblStudent

創(chuàng)建學(xué)生成績表 TblScore q tScoreId (成績 id, 主鍵 , 自動編號)、 tSId (學(xué)生編號)、 tEnglish (英語成績)、 tMath (數(shù)學(xué)成績)
創(chuàng)建老師表 TblTeacher q tTId 、 tTName 、 tTGender 、 tTAge 、 tTSalary 、 tTBirthday
并使用T_sql語句向其中一次填入一條數(shù)據(jù)或一次填入多條數(shù)據(jù)的方式填入數(shù)據(jù)。

1)Insert into 表(列) select 列 1 ,列 2 union
2)Insert into 表(列) select 列 1 ,列 2 from 表
3) Select 列 into 新表名 from 舊表

復(fù)制代碼 代碼如下:

create database TestSchool
on primary
(
name='TestSchool',
filename='F:\SQL Server\TestSchool.mdf',
size=10mb,
filegrowth=10,
maxsize=100mb
)
log on
(
name='TestSchool_log',
filename='F:\SQL Server\TestSchool_log.ldf'
)

create table TblStudent
(
studentId int identity(1,1) primary key,
tScoreId int not null,
sName nvarchar(50) not null,
sAge int not null,
sNo numeric(18,0),--身份證號,十八位數(shù)字,小數(shù)位0
sEmail varchar(50),
sGender bit default(1),
sBirthday datetime
)

select * from TblStudent
truncate table TblStudent

insert into TblStudent
select 1,'劉備',20,123456789012345678,'123@163.com',1,'1987-5-6' union
select 1,'關(guān)羽',19,123456789012345671,'1sfdsf3@163.com',1,'1988-8-6' union
select 1,'張飛',18,123456789012345672,'12sfsd3@163.com',1,'1989-5-19' union
select 4,'曹操',22,123456789012345673,'12sf3@163.com',1,'1985-12-6' union
select 4,'夏侯惇',22,123456789012345674,'1ff23@163.com',1,'1985-3-6' union
select 4,'華佗',50,12345678901234565,'12ff3@163.com',1,'1957-1-16' union
select 4,'甄姬',18,12345678901234565,'12f3@163.com',0,'1989-8-8'

create table TblScore
(
tScoreId int identity(1,1) primary key,
studentId int not null, --學(xué)生id,外鍵
tEnglish float,
tMath float
)

select * from TblScore
truncate table TblScore

insert into TblScore
select 1,90,97 union
select 2,90,70 union
select 3,59,100 union
select 4,100,80 union
select 5,60,96 union
select 6,0,100 union
select 7,80,60

create table TblTeacher
(
tTId int identity(1,1) primary key,
tTName nvarchar(50) not null,
tTGender bit default(1),
tTAge int,
tTSalary money,
tTBirthday datetime
)

select * from TblTeacher

insert into TblTeacher
select '商炳奇',1,22,10000,'1991-10-30' union
select '劉祎',0,22,10000,'1991-11-06' union
select '耿宇丹',0,21,10000,'1992-12-30' union
select '張少丹',0,22,10000,'1991-6-6' union
select '王靜靜',0,22,10000,'1991-6-6' union
select '段琳琳',0,22,10000,'1991-6-6' union
select '楊巧巧',0,21,10000,'1991-6-6'
您可能感興趣的文章:
  • sql語句查詢數(shù)據(jù)庫中的表名/列名/主鍵/自動增長值實例
  • Mysql 自動增加設(shè)定基值的語句
  • Sql Server 數(shù)據(jù)庫索引整理語句,自動整理數(shù)據(jù)庫索引
  • SQL語句實現(xiàn)查詢并自動創(chuàng)建Missing Index
  • SQL語句中公共字段的自動填充方法

標(biāo)簽:新余 河源 中衛(wèi) 宜春 貸款群呼 金昌 黃山 濟(jì)寧

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《通過T_sql語句向其中一次填入一條數(shù)據(jù)或一次填入多條數(shù)據(jù)的方式填充數(shù)據(jù)》,本文關(guān)鍵詞  通過,sql,語句,向,其中,一次,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《通過T_sql語句向其中一次填入一條數(shù)據(jù)或一次填入多條數(shù)據(jù)的方式填充數(shù)據(jù)》相關(guān)的同類信息!
  • 本頁收集關(guān)于通過T_sql語句向其中一次填入一條數(shù)據(jù)或一次填入多條數(shù)據(jù)的方式填充數(shù)據(jù)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 高雄市| 土默特左旗| 五华县| 印江| 西乌珠穆沁旗| 汉阴县| 防城港市| 昆山市| 沙河市| 扎囊县| 阿荣旗| 平谷区| 得荣县| 浙江省| 溆浦县| 南雄市| 临高县| 舒城县| 屏东县| 闸北区| 栾城县| 泸水县| 吴忠市| 东阳市| 桑植县| 长子县| 壶关县| 井研县| 阜康市| 富裕县| 嘉鱼县| 龙南县| 菏泽市| 怀安县| 呼玛县| 翼城县| 永泰县| 南川市| 定西市| 石家庄市| 原平市|