create database db
use db
go
create table course
(
sno varchar(20),
cno int,
Gmark int
)
insert into course values('20071513115',1,80)
insert into course values('20071513114',2,80)
insert into course values('20071513113',3,80)
insert into course values('20071513112',4,80)
insert into course values('20071513111',80)
insert into course values('20071513110',80)
insert into course values('20071513116',80)
insert into course values('20071513117',80)
select distinct cno from course
go
create table student
(sno char(7) not null primary key,
sname varchar(20) not null,
ssex char(2) not null,
sage smalldatetime,
spno char(5),
classid char(5),
Inyear char(4) not null )
insert into student
values('2000101','李勇','男','1980-7-1','00311','10497','1999')
insert into student
values('2000102','刘诗晨','女','1981-8-12','10498','1999')
insert into student
values('2000103','王一鸣','1982-12-20','00312','2001')
insert into student
values('2000104','张婷婷','1985-5-9','2000')
insert into student
values('2001101','李敏','1989-3-9','01311','1999')
insert into student
values('2001102','贾向男','1982-9-3','2000')
insert into student
values('2001103','陈李宝','1981-5-7','1999')
insert into student
values('2000105','张三','1984-6-7','1999')
insert into student
values('2000106','张','1999')
select * from student where spno='01311' and ssex='女'
go
select sname,ssex,sage from student where spno in('01311','01312')
go
select * from student where sname like '李%'go
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。