use master
if(exists(select name from sysdatabases where name='StudentData'))
drop database StudentData
create database StudentData
go
use StudentData
if(exists(select name from sysobjects where name='Student'))
drop table Student
create table Student(
id int identity(1001,1)primary key,
name varchar(20) null,
age int(2) check(age>12 and age<18),
gender char(2) check(gender='男' or gender='女'),
phone varchar(11),
house varchar(40),
)
select * from Student
insert into Student values('郭林',15,'男','135182046','觉得时')
insert into Student values(N'郭林',15,N'男','135182046',N'觉得时')
顺便说一句,你这个字段长度,能长就长一点,实际项目中有些数据比你想像的要长。
谢谢 哈 大神 我也是才学写
以后多多指教