create database Mstanford
create table Tb_Student
(
StudentNo int IDENTITY(1,1) PRIMARY KEY,
StudentName varchar(20) not null,
StudentAge int check(StudentAge>20 and StudentAge<30),
Country varchar(20) default'中国',
StuTime datetime not null,
Tuitime money not null
)create table Tb_Student_Course
(
SCNo int IDENTITY(1,1) PRIMARY KEY,
StudentNo int references Tb_Student(StudentNo),
Coursename varchar(30) unique not null,
CourseTime datetime not null,
Notes varchar(1000)
)
insert Tb_Student VALUES('凯奇',26,'法国','2009-09-01',4000.00)
insert Tb_Student VALUES('saha',26,'印度','2009-09-01',1000.50)
insert Tb_Student VALUES('张小飞',26,'中国','2009-09-01',2000.50)
insert Tb_Student VALUES('李刚',26,'中国','2009-09-01',7000.50)
insert Tb_Student_Course VALUES(200709002,'java','2009-09-09','通过')
insert Tb_Student_Course VALUES(200709003,'.net','2009-09-09','通过')
insert Tb_Student_Course VALUES(200709004,'jsp','2009-09-09',null)