以下嵌入式SQL语句,没有错误的是( )。
A: exec sql select Sname,Sage into vSname,vSage from Student ,where Sname = specName;
B: exec sql begin declare section ,char vSname[10], specName[2]=“lzt”;,int vSage;
C: exec sql select Sname,Sage into :vSname, :vSage from Student ,where Sname = :specName;
D: 其他有多于一个的选项没有错误
A: exec sql select Sname,Sage into vSname,vSage from Student ,where Sname = specName;
B: exec sql begin declare section ,char vSname[10], specName[2]=“lzt”;,int vSage;
C: exec sql select Sname,Sage into :vSname, :vSage from Student ,where Sname = :specName;
D: 其他有多于一个的选项没有错误
举一反三
- 根据用户在文本框txtName中输入的姓名对Student表进行查询,以下SQL语句定义正确的是__________________。 A: String sql=Select * from Student where Sname=+txtName.getText(); B: String sql=Select * from Student where Sname='+txtName.getText()+'; C: String sql=Select * from Student where Sname like +txtName.getText(); D: String sql=Select * from Student where Sname like '+txtName.getText()+';
- 针对学生表Student(Sno,Sname, Ssex,Sage,Sdept)。要检索学生表中年龄在17至25岁之间(包括17和25)的学生的姓名及年龄,SQL语句正确的是( )。 A: Select * From Student Where Sage between 17 and 25 B: Select Sname, Sage From Student Where Sage between 17 and 25 C: Select Sname, Sage From Student Where Sage >= 17 and Sage<= 25 D: Select Sname, Sage From Student Where Sage >= 17 or Sage<= 25
- 在所有学生中查询比计算机系学生平均年龄大的学生姓名,可以使用的查询语句是: A: SELECT Sname FROM Student WHERE Sage > ( SELECT AVG(Sage) FROM Student ); WHERE Sdept = 'CS' B: SELECT Sname FROM Student WHERE Sage > AVG( SELECT Sage FROM Student WHERE Sdept = 'CS' ); C: SELECT Sname FROM Student WHERE Sage > ( SELECT AVG(Sage) FROM Student WHERE Sdept = 'CS' ); D: SELECT Sname FROM Student WHERE AVG(Sage) > ( SELECT Sage FROM Student WHERE Sdept = 'CS' );
- 针对学生表Student(Sno,Sname, Ssex,Sage,Sdept)。要检索学生表中年龄在17至25岁之间(包括17和25)的学生的姓名及年龄,SQL语句正确的是( )。 A: Select * From Student Where Sage between 17 and 25 B: Select Sname, Sage From Student Where Sage between 17 and 25 C: Select Sname, Sage From Student Where Sage >= 17 and Sage<= 25 D: Select Sname, Sage From Student Where Sage >= 17 or Sage<= 25
- 从Student表检索姓周的学生,对应的SQL语句是( )。 A: Select * From Student Where Sname like '周%' B: Select * From Student Where Sname like '%周' C: Select * From Student Where Sname like '_周' D: Select * From Student Where Sname like '周_'