rikao7_19/find.sql

60 lines
869 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 3.15
SELECT
t_student.sex,
COUNT( t_student.s_id )
FROM
t_student
WHERE
t_student.sex = ''
GROUP BY
t_student.sex
# 15
SELECT
t_student.sex,
COUNT( t_student.s_id )
FROM
t_student
WHERE
t_student.sex = ''
GROUP BY
t_student.sex
SELECT
COUNT(t_student.s_id )
FROM
t_student
WHERE
t_student.sex = ''
GROUP BY
t_student.sex / (SELECT count(t_student.s_id) FROM t_student))
SELECT count(t_student.s_id) FROM t_student AS coun /SELECT
COUNT(t_student.s_id )
FROM
t_student
WHERE
t_student.sex = ''
GROUP BY
t_student.sex
# 5.15
SELECT t_course.c_name,COUNT(stu_cou.s_id) FROM stu_cou left join t_course ON t_course.c_id=stu_cou.c_id
GROUP BY stu_cou. c_id