Advanced sql problem

3 there is a table, specific information fields as follows:

Student table (exam_t_student): Student id (student_id),

             Student Name (student_name),

             Class id (class_id),

             Sex (gender)

                                              

Class table (exam_t_class): class id (class_id),

                                           Grade (level)

 

Results table (exam_t_class): No. (grade_id),

                                           Student id (student_id),

                                           Subject (subject),

                                           Achievement (grade)

 

Complete the following sql

1. Please provide each class of third-grade score average (output column: class id, average boys and girls average, class average)

2. Please provide the proportion of students in each grade in Zhang's (output columns: Year id, accounting)

3. Please provide each grade in language examinations highest score (output columns: grades, scores)

4. Please provide the number of classes in school more than 30 people and the number is greater than the number of boys and girls in the class list (asking for a trial having, output column: grade, class)

5. Please provide each school subjects more than 90 points in the student's name (output column: grade, name)

6. Please provide a year before out of a list ranking 10 (output column: student's name, score, rank)

7. Please provide a subject grade math scores ranking (output column: student's name, score, class rank, grade ranking)

 

 

The answer in the next issue

Guess you like

Origin www.cnblogs.com/elmi/p/11387858.html