SQL语句中,判断字段sno是否为空值时,应该使用的表达式是()。
A: sno =NULL
B: sno NULL OR NOT
C: sno IS NULL
D: 以上方式皆可
A: sno =NULL
B: sno NULL OR NOT
C: sno IS NULL
D: 以上方式皆可
举一反三
- 对于学生信息表:student(sno,sname,sex,age,grade),查询学习成绩为空的学生的学号和姓名,下面语句正确的是 A: SELECT sno,sname FROM student WHERE grade=NULL B: SELECT sno,sname FROM student WHERE grade IS NULL C: SELECT sno,age FROM student WHERE grade IS NULL D: SELECT sno,age FROM student WHERE grade=NULL
- 下列SQL语句中,________可以在“学生-课程”数据库中实现“查询所有有成绩的学生学号和课程号”。 A: SELECT Sno,CnoFROM SCWHERE Grade NOT NULL B: SELECT Sno,CnoFROM SCWHERE Grade <> NULL C: SELECT Sno,CnoFROM SCWHERE Grade IS NOT NULL D: SELECT Sno,CnoFROM SCWHERE Grade >0
- 若查询考试成绩不为空的学生的学号,下列语句哪个是正确的?( ) A: SELECT Sno FROM SC WHERE Grade >= 0; B: SELECT Sno FROM SC WHERE Grade != 0; C: SELECT Sno FROM SC WHERE Grade IS NOT NULL; D: SELECT Sno FROM SC WHERE Grade NOT IS NULL;
- 若查询考试成绩不为空的学生的学号,下列语句哪个是正确的? A: SELECT Sno FROM SC WHERE Grade >= 0; B: SELECT Sno FROM SC WHERE Grade!= 0; C: SELECT Sno FROM SC WHERE Grade NOT IS NULL; D: SELECT Sno FROM SC WHERE Grade IS NOT NULL;
- 建立一个学生信息表student,要求它由学号sno,姓名sname,性别sex,年龄age,4个属性组成,其学号属性惟一,学号、姓名字段不能为空。下列语句正确的是 A: CREATE TABLE student (sno char(5)NOT NULL sname char(8)NOT NULL sex char(1) age in; B: CREATE TABLE student (sno char(5)NOT NULL sname char(8)NOT NULL sex char(1) age in; C: CREATE TABLE (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char(1) age in; D: CREATE TABLE student (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char(1) age in;