sqlserver创建表

 1 --创建学员信息数据表
 2 use StudentManageDB
 3 go
 4  if exists(select * from sysobjects where name='Students')
 5 drop table Students
 6 go
 7 create table Students
 8 (
 9     StudentId int identity(10000,1),--学号
10     StudentName varchar(20) not null,--姓名
11     Gender char(2) not null,--性别
12     Birthday datetime not null,--出生日期
13     StudentIdNo numeric(18,0) not null,--身份证号
14     Age int not null,--年龄
15     PhoneNumber varchar(50),
16     StudentAddress varchar(500),
17     ClassId int  not null   --班级外键
18 )
19 go
20 --创建班级表
21 if exists(select * from sysobjects where name='StudentClass')
22 drop table StudentClass
23 go
24 create table StudentClass
25 (
26     ClassId int primary key,--班级编号
27     ClassName varchar(20) not null
28 )
29 go
30 --创建成绩表
31 if exists(select * from sysobjects where name='ScoreList')
32 drop table ScoreList
33 go
34 create table ScoreList
35 (
36     Id int identity(1,1) primary key,
37     StudentId int not null,--学号外键
38     CSharp int null,
39     SQLServer int null,
40     UpdateTime datetime not null--更新时间
41 )
42 go
43 --创建管理员表
44 if exists(select * from sysobjects where name='Admins')
45 drop table Admins
46 go
47 create table Admins
48 (
49     LoignId int identity(1000,1) primary key,
50     LoginPwd varchar(20) not null,--登录密码
51     AdminName varchar(20) not null
52 )
53 go

 

转载于:https://www.cnblogs.com/Spinoza/p/9998387.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值