📄 unit7.~pas
字号:
adoquery1.SQL.Add('in(select distinct stu_no from student where stu_class='''+Edit1.Text+''')'); //有问题
adoquery1.Open;end
else
begin
if ComboBox1.Text='70-79' then begin adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select count(stu_no) as"人数" from stud_score where 70<score and score<=79 and stu_no');
adoquery1.SQL.Add('in(select distinct stu_no from student where stu_class='''+Edit1.Text+''')'); //有问题
adoquery1.Open;end
else
begin
if ComboBox1.Text='80-89' then begin adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select count(stu_no) as"人数" from stud_score where 80<score and score<=89 and stu_no');
adoquery1.SQL.Add('in(select distinct stu_no from student where stu_class='''+Edit1.Text+''')'); //有问题
adoquery1.Open;end
else
begin
if ComboBox1.Text='60以下' then begin adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select count(stu_no) as"人数" from stud_score where 0<score and score<=60 and stu_no');
adoquery1.SQL.Add('in(select distinct stu_no from student where stu_class='''+Edit1.Text+''')'); //有问题
adoquery1.Open;end
else
begin
if ComboBox1.Text='90-100' then begin adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select count(stu_no) as"人数" from stud_score where 90<score and score<=100 and stu_no');
adoquery1.SQL.Add('in(select distinct stu_no from student where stu_class='''+Edit1.Text+''')'); //有问题
adoquery1.Open;end
end
end
end
end
end
end
end
end
end
end
end;
procedure TForm7.Button5Click(Sender: TObject);
begin
if Edit1.Text=''then
showmessage('请输入学号!')
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select S.stu_no as"学号",stu_name as"姓名",C.Cour_no as"课程编号",Cour_name as"课程名称",Cour_score as"学分",Cour_time as"考试时间",');
adoquery1.SQL.Add('score as"分数",Cour_Category as"类型" from student as S,Courses as C,stud_score as T where S.stu_no='''+Edit1.text+'''');
adoquery1.Open;
if adoquery1.RecordCount=0then
showmessage('没有相关的记录!')
end
end;
procedure TForm7.Button7Click(Sender: TObject);
begin
if Edit1.Text=''then
showmessage('学号不能够为空!')
else
begin
Edit2.Text:='';
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select stu_no from student ');
adoquery1.Open;
if adoquery1.RecordCount=0 then
showmessage('没有该生的学籍信息!')
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select stu_no from stud_score ');
adoquery1.Open;
if adoquery1.RecordCount=0 then
showmessage('没有该生的成绩信息!')
else
begin
adoquery1.Open;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select avg(score) from stud_score where');
adoquery1.SQL.Add('stu_no in (select stu_no from student where stu_no='''+Edit1.Text+''')');
adoquery1.Open;
end
end
end
end;
procedure TForm7.Button4Click(Sender: TObject);
begin
if Edit1.Text=''then
showmessage('请输入班号!')
else
begin
if Edit1.Text=''then
showmessage('请输入课程号!')
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select stu_no from student ');
adoquery1.Open;
if adoquery1.RecordCount=0 then
showmessage('没有该班的学籍信息!')
else
begin
adoquery1.Open;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select count(stu_no) from stud_score where 60<=score and cour_no='''+Edit2.text+'''and');
adoquery1.SQL.Add('stu_no in(select stu_no from student where stu_class='''+Edit1.Text+''')');
adoquery1.Open;
end
end
end
end;
procedure TForm7.Button6Click(Sender: TObject);
begin
if Edit1.Text=''then
showmessage('请输入学号!')
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select S.stu_no as"学号",stu_name as"姓名",C.Cour_no as"课程编号",Cour_name as"课程名称",Cour_score as"学分",Cour_time as"考试时间",');
adoquery1.SQL.Add('score as"分数",Cour_Category as"类型" from student as S,Courses as C,stud_score as T where S.stu_no='''+Edit1.text+'''');
adoquery1.Open;
if adoquery1.RecordCount=0then
showmessage('没有相关的记录!')
end
end;
procedure TForm7.Button3Click(Sender: TObject);
begin
showmessage('这个功能还没有完成!');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -