Python's MySql a daily practice 127-- all students check out the only two courses

Refer to the original article - http://bjbsair.com/2020-03-25/tech-info/6222/


First, the table names and field

-1 student table student (s_id, s_name, s_birth, s_sex) -. Student number, student's name, date of birth, student sex

-2 curriculum course (c_id, c_name, t_id) -. Course number, course name, teacher numbers

-3 teacher table teacher (t_id, t_name) -. No teacher, teacher's name

-4 transcript score (s_id, c_id, s_score) - student number, course number, score


Two, Mysql title

Check out the only two courses of all students in the school number and name

Read the small partners, look forward to your valuable vote cast, the late Big Star @Python based on the difficulty factor, to which 50 SQL question reordering, sorting summary.

Degree of difficulty (radio) 0 person 0% A. ★ 0 person 0% B. ★★ 0 person 0% C. ★★★ 0 person 0% D. ★★★★ 0 person 0% E. ★★★★ ★ vote


Three, Mysql analysis

1, by group by ... having check out student id

2, where in through check out student information in the student table


Four, Mysql program

1, Mysql program:

Python's MySql a daily practice 27-- all students check out the only two courses

2, Mysql results:

Python's MySql a daily practice 27-- all students check out the only two courses

Guess you like

Origin www.cnblogs.com/lihanlin/p/12571833.html