First, create a table
CREATE TABLE' student ' (' ID ')int( -) not NULLauto_increment, ' name 'varchar( -)DEFAULT NULLCOMMENT'name', ' subject 'varchar( -)DEFAULT NULLCOMMENT'Courses', ' score 'varchar(Ten)DEFAULT NULLCOMMENT'score', ' Stuid 'varchar( -)DEFAULT NULLCOMMENT'School Number', PRIMARY KEY(' id ')) ENGINE=InnoDB auto_increment=Ten DEFAULTCHARSET=UTF8;
Second, insert data
Third, SQL statement operations
1. Calculate the total number of each person and rank (requires display field: Name, overall scores)
2. Calculate each person's total and rank (required field: number, name, overall)
3. Calculate the highest score for each individual (required field: School number, name, course, highest score)
4. Calculate each person's average score (requires display field: study number, name, average score)
5. List the students who have the best grades in each course (Required fields: Student number, name, subject, score)
6. List of the two students who have the best results in each course (Required fields: Student number, name, subject, score)
SQL statement Learning (1)