sql笔记2------创建数据表---T-SQL

--if exists (select * from sysobjects where name='stuInfo')
--drop table stuInfo
-----创建表
--create table stuInfo/*--创建学员信息表---*/
--(
--stuName varchar(20) not null,----学员姓名,非空(必填)
--stuNo char(6) not null,----学号,非空(必填)
--stuAge int not null,----年龄,int类型不用指定大小,默认为4个字节
--stuSex nchar(1) not null,----性别
------stuID numeric(18,0),----省份证号,numeric(18,0)代表18位数字,小数位数为0
--stuSeat SMALLINT identity(1,1),--座位号,自动编号(标识列),从1开始递增
--stuAddress text---地址,允许为空,即可选输入
--)
--go
--create table stuMarks----成绩表
--(
--ExamNo char(7) not null,----考号
--stuNo char(6) not null,----学号
--writtenExam int not null,----笔试成绩
--LabExam int not null,----机试成绩
--)
--go

你可能感兴趣的:(t-sql)