查询天心区的男学生的信息,正确的命令是?
A: db.students.find({"address":"天心区"},{"sex":"男"})
B: db.students.find({"address":"天心区","sex":"男"})
C: db.students.find({$and:{"address":"天心区","sex":"男"}})
D: db.students.find({$and:[{"address":"天心区"},{"sex":"男"}]})
A: db.students.find({"address":"天心区"},{"sex":"男"})
B: db.students.find({"address":"天心区","sex":"男"})
C: db.students.find({$and:{"address":"天心区","sex":"男"}})
D: db.students.find({$and:[{"address":"天心区"},{"sex":"男"}]})
举一反三
- 显示所有男生的信息,不正确的命令是? A: db.students.find({"sex":"男"}) B: db.students.find("this.sex=='男' ") C: db.students.find({"this.sex='男' "}) D: db.students.find({$where:"this.sex=='男' "})
- 统计各系男生人数,最准确的SQL语句是(<br/>)。 A: SELECT<br/>COUNT(*) FROM stduents GROUP BY d_no WHERE sex='男' B: SELECT<br/>COUNT(*) FROM students WHERE sex='男'<br/>GROUP BY d_no C: SELECT<br/>COUNT(*) FROM students WHERE sex='男'<br/>ORDER BY d_no D: SELECT<br/>COUNT(*) FROM students HAVING sex='男'<br/>GROUP BY d_no
- 查询性别为男的信息,条件怎么写 A: where sex !=’男' B: where sex not in 男 C: where sex ='男' D: where sex between 男
- 查询专业不存在的学生信息,正确的命令是? A: db.students.find({"major":null}) B: db.students.find({"major":{$in:[null],$exists:true}}) C: db.students.find({"major":{$exists:false}}) D: db.students.find({"major":{$exists:true}})
- 3个表即学生表S、课程表C和学生选课表SC,它们的结构如下: S(S#,SN,SEX,AGE,DEPT)C(C#,CN)SC(S#,C#,GRADE)其中:S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程号,CN为课程名,GRADE为成绩。检索选修课程名称为“DB”的男生中的最高成绩,正确的SELECT语句是____。 A: SELECT MAX(GRADE) FROM SC WHERE CN='DB’ AND SEX='男' B: SELECT MAX(GRADE) FROM SC,C,SWHERE CN='DB' AND SEX='男' C: SELECT MAX(GRADE) FROM SC,S WHERE SC D: =C E: AND CN='DB' AND SEX='男' F: SELECT MAX(GRADE) FROM SC,C,SWHERE SC G: =C H: AND SS I: =S.S J: AND CN='DB' AND SEX='男'