SELECT AVGdegree FROM score WHERE cno IN SELECT cno FROM score GROUP BY cno HAVING COUNT1 = 3; AND cno LIKE 3 GROUP BY cno;
The given SQL query retrieves the average degree for each course (cno) that meets the following conditions:
- The course (cno) must have at least three students enrolled in it.
- The course (cno) must start with the digit '3'.
Here is the formatted SQL query:
SELECT AVG(degree)
FROM score
WHERE cno IN (
SELECT cno
FROM score
GROUP BY cno
HAVING COUNT(1) >= 3
)
AND cno LIKE '3%'
GROUP BY cno;
原文地址: https://www.cveoy.top/t/topic/iA3g 著作权归作者所有。请勿转载和采集!