1) 先要查询这些还没有毕业的这些学生的名单,毕业过后的无法进行选课;
2) 在批量的选取学生的同时,还需要添加对应的某一门课程;
3) 点添加后选课结束。
我们如果有SQL语句
我们先建立三张表:
create table Student --学生表 ( StudentId int not null, --学生ID StudentName VARCHAR2(30), --学生姓名 StuentSN VARCHAR2(30), --学生学号 StudentGradu int --学生是否毕业 0代表毕业,1代表未毕业 ) create table Subject --课程表 ( SubjectId int not null, --课程ID SubjectName VARCHAR2(20) --课程名称 ) create table SelSubject --选好课程表 ( SubjectId int not null, --课程ID StudentID int not null --学生ID ) |
在实现上面的业务功能的时候,我们可能很多人一开始就在程序里面直接实现了,代码如下:

