create database ADO测试 go use ADO测试 go create table Student ( Code nvarchar(200) not null primary key,--学生编号,主键 Name nvarchar(200) not null, --学生姓名 Sex bit not null, --学生性别 (true表示男性,false表示女性) Birthday datetime not null, --学生生日 SubjectCode nvarchar(200), --学生专业 (如果为空显示<空>) ) go create table Subject ( SubjectCode nvarchar(200) not null primary key,--专业编号,主键 SubjectName nvarchar(200) not null, --专业名称 ) go insert into Student values('S001','张三','true','1994/1/12','Z001') insert into Student values('S002','李四','true','1995/2/22','Z002') insert into Student values('S003','王五','true','1996/8/28','Z002') insert into Student values('S004','小花','false','1997/3/6','Z003') go insert into Subject values('Z001','商务英语') insert into Subject values('Z002','软件工程') insert into Subject values('Z003','旅游') insert into Subject values('Z004','工商管理') go select *from Student select *from Subject go