I. DML (data manipulation language) InnoDB MyISAM support transaction does not support full-text indexing support for a transaction that supports full-text indexing support foreign KEY constraints do not support commands to view the default storage engine Show variables like'%storage_engine% '; 1insert data into the table #添加课程 insert INTO ' subject ' VALUES (5, ' C # ', 160,1); #插入多门课程 INSERT into ' subject ' (Subjectname,classhour,gradeid) VALUES (' Math ', 110,2, (' Chinese ', 170,2), (' English ', 140,2); When inserting data, it is best to write the field name #将查询结果插入新表 Create TABLE ' phonelist ' (SELECT studentname,phone from student ); 2, Updating Data Update table table name set field=value Where Condition3, delete data delete from table name [WHERE Condition] empty table data truncate tables table name; Truncate statement deletion resets the self-increment column, the table structure and its fields, constraints, indexes remain unchanged, execution speed is faster than the DELETE statement, DQL query statement SELECT*From ' subject '; SELECT Subjectno,subjectname,classhour,gradeid from ' subject '; *low efficiency (deprecated) as gives the name of the field alias, you can omit SELECT subjectnoId, Subjectname' Course name ', ClasshourHours, Gradeid' Grade ID 'From ' subject '; Alias a table name #查询两张表 Cartesian product SELECT S.studentno,s.studentname,r.studentresult from Stu Dent as s,result as R; DISTINCT (go to duplicate query) I between A and B equals I>=a and i<=b isNULLdetermines whether the field value is empty SELECT*From student as S WHERE s.identitycard are notNULLIn is a range query SELECT*From result as R WHERE R.studentresult in (70,80,90); Like fuzzy query #查询所有姓李的学生 _%SELECT*From student as S WHERE s.studentname like' Li% ';
6.1 Class note-dml (data manipulation language), DQL query statement