O’ZBEKISTON RESPUBLIKASI AXBORAT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISHVAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBORAT TEXNOLOGIYALARI UNIVESITETI
Ma’lumotlar bazasi
3-4- Amaliy mashg'ulot
Bajardi: Ismoilov Iskandar
Tekshirdi: URALOVA I. A.
Toshkent 2023
Kasb hunar kolleji malumotlar bazasini yaratish va UNION, INTERSECT va MINUS amallaridan foydalanish
Biz o’tgan amaliy ishda Kollej haqidagi ma’lumotlar bazasini yaratib olgan edik endi UNION,INTERSECT va MINUS amallarini qo’llaymiz.
--GROUP BY va ORDER BY amallaridan foydalanib tuzilgan query
SELECT StudentID, AVG(Score) AS AverageScore
FROM PracticalWorkScores
WHERE TaskNumber = 3
GROUP BY StudentID
ORDER BY AverageScore DESC;
-- UNION query sidan foydalanamiz
SELECT StudentID, TaskNumber, Score
FROM PracticalWorkScores
WHERE TaskNumber = 3
UNION
SELECT StudentID, TaskNumber, Score
FROM PracticalWorkScores
WHERE TaskNumber = 4;
-- INTERSECT query sidan foydalanish
SELECT StudentID, TaskNumber, Score
FROM PracticalWorkScores
WHERE TaskNumber = 3
INTERSECT
SELECT StudentID, TaskNumber, Score
FROM PracticalWorkScores
WHERE TaskNumber = 4;
-- MINUS query sidan foydalanish
SELECT StudentID, TaskNumber, Score
FROM PracticalWorkScores
WHERE TaskNumber = 3
MINUS
SELECT StudentID, TaskNumber, Score
FROM PracticalWorkScores
WHERE TaskNumber = 4;
|