6.1 Class note-dml (data manipulation language), DQL query statement

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.