有一个学生关系模式Student,其字段有no(学号),name(姓名),age(年龄),sex(性别)。在这些字段中,最
有一个学生关系模式Student,其字段有no(学号),name(姓名),age(年龄),sex(性别)。在这些字段中,最适合作为主键的是()。
A.no
B.name
C.age
D.sex
有一个学生关系模式Student,其字段有no(学号),name(姓名),age(年龄),sex(性别)。在这些字段中,最适合作为主键的是()。
A.no
B.name
C.age
D.sex
所有学员的成绩加10分。下列SQL语句正确的是()。
A、update students set Grade=Grade+10 where SID=1
B、update * set Grade=Grade+10
C、update * from stedents set Grade=Grade+10
D、update students set Grade=Grade+10
有学生-课程关系数据库,各关系表描述如下,并用T-SQL语句实现下列问题:
Student表:
A.select student_id,student_name,sum(score) from student where score<60 order by score;
B.select distinct student_id,avg(score) from student where score<60 order by avg(score);
C.select student_id,student_name,avg(score) av from student where score<60 group by student_id order by av asc;
D.select student_id,student_name,avg(score) av from student group by student_id where score<60 order by av asc;
一、设有一学生-课程数据库,其中关系表如下所示: 学生关系表:Student(Sno,Sname,Ssex,Sage,Sdept) 课程表关系:Course(Cno,Cname,Cpno,Ccredit) 学生选课表:SC(Sno,Cno,Grade) 请用SQL语句实现下列各题: (1)建立一个“学生”表SC。 (2)为学生-课程数据库中的SC建立索引,SC表按学号升序和课程号降序建索引。 (3)查询全体学生的详细记录。 (4)查询年龄在20~23岁(包括20岁和23岁)之间的学生的姓名、系别和年龄。 (5)查询名字中第2个字为"明"字的学生的姓名和学号。 (6)查询学生总人数。 (7)查询选修了课程M01或者选修了课程M02的学生。 (8)将学生08001的年龄改为23岁。
A.并
B.交
C.差
D.选择
day(出生日期、varchar型),score(成绩、int型)。现要向学员表中插入一名学员的信息,下列SQL语句正确的是()。
A、INSERT INTO students VALUES(1,'李刚’,’1999-01-01', 80)
B、INSERT INT0 students(sID,sName,birthday)VALUES(1,’李刚’,’1999-01-01',80)
C、INSERT INTO students VALUES (1,李刚,1999-01-01,80)
D、 INSERT INT0 students(sID, sName, birthday)VALUES(NULL,’李刚’,‘1999-01-01')