建表.txt

来自「用sql2000建立的西安市公交系统」· 文本 代码 · 共 47 行

TXT
47
字号
create table 线路
(线路号 char(10) PRIMARY KEY,
始发时间 char(8) not null,
末发时间 char(8) not null,
发车间隔 smallint not null,
票价 char(30) not null
);
CREATE TABLE 司机(
工号 char(5) PRIMARY KEY,
姓名 char(20) not null,
性别 char(2) check(性别 in ('男','女')) not null,
年龄 smallint,
线路号 char(10) not null,
foreign key(线路号) references 线路(线路号)
);
create table 汽车(
车牌 char(8) PRIMARY KEY,
线路号 char(10) not null,
座位数 smallint,
foreign key(线路号) references 线路(线路号),
);
create table 站点(
线路号 char(10) not null, 
站点 char(30) not null,
站号 smallint not null,
primary key(线路号,站号)
);
create table 考勤(
工号 char(5) primary key,
本月出车次数 smallint,
本月出车时间 smallint
);
create table 队长(
线路号 char(10), 
工号 char(5),
primary key(线路号,工号),
foreign key(线路号) references 线路(线路号),
foreign key(工号) references 司机(工号),
);

/*
bulk insert  table 队长.dbo from 'F:\DB\bus\队长.txt';
bulk insert table 考勤 from 'F:\DB\bus\队长.txt';
bulk insert table 汽车 from 'F:\DB\bus\队长.txt';
bulk insert table 司机 from 'F:\DB\bus\队长.txt';
bulk insert table 线路 from 'F:\DB\bus\队长.txt';
bulk insert table 站点 from 'F:\DB\bus\队长.txt';*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?