Use an SQL statement to find out the names of students with more than 80 points in each course, with the following data table structure:
The table SQL is built as follows:
SETForeign_key_checks=0;-- ------------------------------Table structure for grade-- ----------------------------DROP TABLE IF EXISTS' grade ';CREATE TABLE' grade ' (' name 'varchar(255) not NULL, ' class 'varchar(255) not NULL, ' score 'tinyint(4) not NULL) ENGINE=InnoDBDEFAULTCHARSET=utf8mb4;-- ------------------------------Records of Grade-- ----------------------------INSERT into' Grade 'VALUES('Zhang San','language','Bayi');INSERT into' Grade 'VALUES('Zhang San','Mathematics',' the');INSERT into' Grade 'VALUES('John Doe','language',' the');INSERT into' Grade 'VALUES('John Doe','Mathematics',' -');INSERT into' Grade 'VALUES('Harry','language','Bayi');INSERT into' Grade 'VALUES('Harry','Mathematics',' -');INSERT into' Grade 'VALUES('Harry','English',' -');SETForeign_key_checks=1;
Check the names of students who have more than 80 points for each course:
SELECT DISTINCT from WHERE not inch (SELECTDISTINCTfromWHERE<=);
The name of the student whose average score is greater than 80:
SELECT from (SELECTCOUNT(* as T,SUMas fromGROUP by asWHERE>*t;
Use an SQL statement to find out the names of students who have more than 80 points per course