根据SQL标准,下面哪句语句能够找出年龄最小的同学?其中age为学生表student中的年龄字段,sno为学生的学号。()
A select max(age) from student
B select sno from student where age = max(age)
C select sno from student having age = max(age)
D select sno from student a where a.age<= (select min(b.age) from student b)
第1题:
根据SQL标准,增加一条记录到表student,学号sno是11301,姓名sname是“snoopy”,年龄age是20。其中student表中包括学号、姓名、年龄、籍贯、系别等属性,并且属性除sno外皆可取空值。下面哪条是参考的?()
A insert into student values(sno=11301, sname=’snoopy’, age =20)
B insert into student(sno,sname,age) values(11301,’snoopy’,20)
C insert into student set sno=11301, sname=’snoopy’, age = 20
D insert into student values (11301, ’snoopy’, 20)
第2题:
根据SQL标准,要查询表student中所有年龄age小于所有学生的平均年龄的记录,下面哪条语句适用?()
A select * from student where age< avg(age)
B select * from student having age< avg(age)
C select * from student a where a.age< (select avg(b.age) from student b)
D select * from student a where (select avg(b.age) from student b ) >= a.age
第3题:
学生表student包含学号sno、学生姓名sname、性别sex、年龄age、所在院系dept、籍贯native等字段,其中age为整型,其余字段均为字符型。现插入一条计算机学院学生的记录,学号为s320078,姓名为张强,性别为男,年龄为20,下列语句错误的是________。
A.INSERT INTO tb_student (sno, sname, sex, age, dept, native) VALUES('s320078', '张强','男',20, '计算机');
B.INSERT INTO tb_student (sno, sname, sex, age, dept) VALUES('s320078', '张强','男',20, '计算机');
C.INSERT INTO tb_student VALUES('s320078', '张强','男',20, '计算机',null);
D.INSERT INTO tb_student (dept, sno, sname, sex, age) VALUES('计算机', 's320078', '张强','男',20);
第4题:
根据SQL标准,查询表student(sno,sname,sex,dept)中所有学生的选修课程数,其中选修记录在表SC(sno,cno,grade)中,两表中sno为关联字段。下面哪条语句合适?()
A select sno,count(cno) from SC
B select sno,count(cno) from student
C select a.sno,count(cno) from student a left outer join SC
D select a.sno,count(cno) from SC left outer join student a
第5题:
8、学生表student包含学号sno、学生姓名sname、性别sex、年龄age、所在院系dept、籍贯native等字段,其中age为整型,其余字段均为字符型。现插入一条计算机学院学生的记录,学号为s320078,姓名为张强,性别为男,年龄为20,下列语句错误的是________。
A.INSERT INTO tb_student (sno, sname, sex, age, dept, native) VALUES('s320078', '张强','男',20, '计算机');
B.INSERT INTO tb_student (sno, sname, sex, age, dept) VALUES('s320078', '张强','男',20, '计算机');
C.INSERT INTO tb_student VALUES('s320078', '张强','男',20, '计算机',null);
D.INSERT INTO tb_student (dept, sno, sname, sex, age) VALUES('计算机', 's320078', '张强','男',20);