Files
ITMO/task4.sql
T
LeterZP f86f7e02f5 Squashed 'DB/DBLab2/' content from commit 5451b82
git-subtree-dir: DB/DBLab2
git-subtree-split: 5451b828cd3210a475fde8e575ae5f94bdd4fdfe
2026-04-06 00:33:38 +03:00

11 lines
389 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
SELECT ГРУППА FROM
(
SELECT ГРУППА, COUNT(ГРУППА) FROM Н_УЧЕНИКИ
JOIN Н_ПЛАНЫ ON Н_УЧЕНИКИ.ПЛАН_ИД = Н_ПЛАНЫ.ИД
JOIN Н_ОТДЕЛЫ ON Н_ОТДЕЛЫ.ИД = Н_ПЛАНЫ.ОТД_ИД
WHERE Н_ОТДЕЛЫ.КОРОТКОЕ_ИМЯ = 'КТиУ'
AND EXTRACT(YEAR FROM НАЧАЛО) = 2011
GROUP BY ГРУППА
)
WHERE count = 5;