Delphi | | | | | | | |
| SQL | | | | JAVA | | |

SQL -

SQL

UNION

UNION , ,

SELECT CITY

FROM STUDENT UNION

SELECT CITY

FROM LECTURER;

.


, , UNION ALL. ,

SELECTCITY

FROMSTUDENT UNION ALL

SELECTCITY

FROMLECTURER;

, , .

UNION. , , .

SELECT'',A.STUDENT_ID,SURNAME,MARK,EXAM_DATE FROMSTUDENTA,EXAM_MARKS WHERE(A.STUDENT_ID=B.STUDENT_ID ANDB.MARK =

(SELECT MAX (MARK) FROM EXAM_MARKS

WHERE C.EXAM_DATE=B.EXAM_DATE) ) UNIONALL

SELECT'1, A.STUDENT_ID,SURNAME, MARK,EXAM_DATE FROMSTUDENT A,EXAM_MARKS

WHERE(A.STUDENT_ID=B.STUDENT_ID\

AND B.MARK=

(SELECT MIN(MARK) FROM EXAM_MARKS WHERE C.EXAM_DATE= .EXAM_DATE) ) ;

, , ' ' ' '.

. , (. 2.9). , :

SEIECT'' , A. STUDENT_ID,SURNAME,E.MARK,E . EXAM_DATE FROMSTUDENTA,

(SELECT B. STUDENT_ID,B.MARK,B . EXAM_DATE FROMEXAM_MARKS B,

(SELECT MAX (MARK)AS MAX_MARK,C. EXAM_DATE

FROMEXAM__MARKS

GROUPBYC.EXAM_DATE)D

WHERE.EXAM_DATE=D.EXAM_DATE

ANDB.MARK=MAX_MARK)E WHERE A . STUDENT_ID=E . STUDENT_ID UNIONALL

SEMCT '' , A. STUDENTID, SURNAME, E .MARK, E . EXAM_DATE

FROMSTUDENTA,

(SELECTB.STUDENT_ID,B.MARK,B.EXAM_DATE FROM EXAM_MARKS B,

(SELECT MIN(MARK)AS MIN_MARK,C.EXAM_DATE

FROM EXAM_MARKS GROUPBYC.EXAM_DATE)D WHERE B.EXAM_DATE=D.EXAM_DATE ANDB.MARK=MIN_MARK)E WHERE A.STUDENT_ID=E.STUDENT_ID

 

,