Программирование в среде Visual Fox Pro. База данных «Факультет», страница 4

INNER JOIN fakultet!fakult;

                            ON  fakult.id_fakult = Students_2007_semestr1.id_fakult ;

                            where  fakult.факультет = thisform.Pageframe1.Page3.Pageframe1.Page2.Combo1.value;

                            and (Students_2007_Semestr1.группа = thisform.Pageframe1.Page3.Pageframe1.Page2.Check1.caption and thisform.Pageframe1.Page3.Pageframe1.Page2.Check1.value =1;

                            or Students_2007_Semestr1.группа = thisform.Pageframe1.Page3.Pageframe1.Page2.Check2.caption and thisform.Pageframe1.Page3.Pageframe1.Page2.Check2.value =1;

                            or Students_2007_Semestr1.группа = thisform.Pageframe1.Page3.Pageframe1.Page2.Check3.caption and thisform.Pageframe1.Page3.Pageframe1.Page2.Check3.value =1);

                            and Students_2007_Semestr1.оценка_1  <> "3";

                            and Students_2007_Semestr1.оценка_2  <> "3";

                            and Students_2007_Semestr1.оценка_3  <> "3"; 

Рис.15. Результат выполнения запроса II.


III.      Найти студентов, получивших заданную оценку по заданным дисциплинам за выбранный семестр (рис.16, 17):

Код запроса:

check_1_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check1.caption

check_2_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check2.caption

check_3_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check3.caption

check_4_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check4.caption

check_5_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check5.caption

check_6_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check6.caption

check_7_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check7.caption

check_8_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check8.caption

check_9_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check9.caption

check_10_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check10.caption

check_11_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check11.caption

check_12_1 = thisform.Pageframe1.Page3.Pageframe1.Page3.Check12.caption

activ_1 = 0

activ_2 = 0

activ_3 = 0

activ_4 = 0

activ_5 = 0

activ_6 = 0

activ_7 = 0

activ_8 = 0

activ_9 = 0

activ_10 = 0

activ_11 = 0

activ_12 = 0

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check1.value = 1

activ_1 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check2.value = 1

activ_2 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check3.value = 1

activ_3 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check4.value = 1

activ_4 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check5.value = 1

activ_5 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check6.value = 1

activ_6 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check7.value = 1

activ_7 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check8.value = 1

activ_8 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check9.value = 1

activ_9 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check10.value = 1

activ_10 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check11.value = 1

activ_11 = 1

endif

if thisform.Pageframe1.Page3.Pageframe1.Page3.Check12.value = 1

activ_12 = 1

endif

SELECT Students_2007_Semestr1.фамилия, Students_2007_Semestr1.имя, Students_2007_Semestr1.отчество, Students_2007_Semestr1.семестр, fakult.факультет, Students_2007_Semestr1.группа,;

               predmet_1.дисциплина as Предмет_1, Students_2007_Semestr1.оценка_1, Students_2007_Semestr1.дата_сдачи_1, predmet_2.дисциплина as Предмет_2, Students_2007_Semestr1.оценка_2,;

               Students_2007_Semestr1.дата_сдачи_2, predmet_3.дисциплина as Предмет_3, Students_2007_Semestr1.оценка_3, Students_2007_Semestr1.дата_сдачи_3;

FROM fakultet!Students_2007_Semestr1 ;

INNER JOIN fakultet!predmet_1   ON  Students_2007_semestr1.предмет_1 = Predmet_1.id_predmet;

INNER JOIN fakultet!predmet_2   ON  Students_2007_semestr1.предмет_2 = Predmet_2.id_predmet;