/* a property (xx) in table t is repeated n times so record. Eg: the name repeats more than 3 times in table a so record. Idea: First find out more than 3 times the name of what, and then the records of these names extracted. */select * from A where name in (select Name Form A GROUP by name has count (name) >3)
/* Query for the nth to M Records in table A (id,name): 31st to 40th record in table */mysql:: Select * from A limit 30, 10; (limit in MySQL)//Find out the first 30 ID, and then find out the first 10 select top of the 30. From a where ID not in (select top IDs from a))
Student Information Form S (sno,sname,age,sex) number, name, age and Gender Course Information Table SC (SNO,CNO, Scgrade) number, course number, grade course Information Form C (CNO,CNAME,CT) Course number, course name, Instructor also elective course name Student number and name//analysis for "1" and "2" Students: the course name can correspond to the unique course number, the student number corresponds to the unique student information, and finally the relationship is concentrated in SC to select Sno, sname from S where Sno in (select Sc.sno from Sc,c where Sc.cno=c.cno and CNAME in (' 1 ', ' 2 ') group by Sno Count (distinct CNO) =2);
Review of SQL statements in database