The given SQL query retrieves the average degree for each course (cno) that meets the following conditions:

  1. The course (cno) must have at least three students enrolled in it.
  2. 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;
SELECT AVGdegree FROM score WHERE cno IN 	SELECT cno FROM score GROUP BY cno HAVING COUNT1 = 3; AND cno LIKE 3 GROUP BY cno;

原文地址: https://www.cveoy.top/t/topic/iA3g 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录