完成下面的Person类封装填空。
________ com.softfz;
________ class Person {
_______ int sid;
_______ String sname;
_______ int getSid() {
return sid;
}
_______ void setSid(int sid) {
this.sid = sid;
}
_______ String getSname() {
return sname;
}
_______ void setSname(String sname) {
this.sname = sname;
}
}
________ com.softfz;
________ class Person {
_______ int sid;
_______ String sname;
_______ int getSid() {
return sid;
}
_______ void setSid(int sid) {
this.sid = sid;
}
_______ String getSname() {
return sname;
}
_______ void setSname(String sname) {
this.sname = sname;
}
}
举一反三
- 以下创建视图的语句中,正确的是 A: CREATE st_view AS SELECT sid,sname,ssex FROM stu B: CREATE VIEW st_view SELECT sid,sname,ssex FROM stu C: CREATE VIEW st_view AS sid,sname,ssex FROM stu D: CREATE VIEW st_view AS SELECT sid,sname,ssex FROM stu
- 修改student表中学号为2015001的学生的姓名为“张三” A: update student set sname=’ 张三’ where sid=’2015001’ B: alter table student alter sname=’ 张三’ where sid=’2015001 C: update student set sname=”张三” where sid=’2015001’ D: update student set sname=张三 where sid=’2015001’
- 修改student表中学号为2015001的学生的姓名为“张三”,语句是()。 A: update student set sname=’ 张三’ where sid=’2015001’ B: update student set sname=张三 where sid=’2015001’ C: update student set sname=”张三” where sid=’2015001’ D: alter table student alter sname=’ 张三’ where sid=’2015001’
- 在学生关系student(sid,sname……)中,student的属性分别表示学号和姓名,若要查询学号为19170201的学生姓名,下列SQL语句正确的是( )。Ⅰ.SELECT sname FROM student WHERE sid LIKE '19170201'Ⅱ.SELECT sname FROM student WHERE sid LIKE= '19170201'Ⅲ.SELECT sname FROM student WHERE sid='19170201' A: Ⅰ、Ⅱ B: Ⅰ、Ⅲ C: Ⅱ、Ⅲ D: Ⅰ、Ⅱ、Ⅲ
- 查询学生的学号,姓名,选修课程号和课程成绩 A: select sid,sname,cid,grade from student,sc where student.sid=sc.sid B: select * from student,sc where student.sid=sc.sid C: select sid,sname,cid,cname from student,course D: select sid,sname,cid,cname from student,sc