Mysql (4) data query operations on Data Tables SELECT statement SELECT select_list1 ,... -- Query which columns FROM select_table -- query FROM which table WHERE primary_constraint -- Query which conditions are met BY the row group by grouping_columns -- How to GROUP the results HAVING secondary_constraint -- the second condition that the row must meet order by sorting_columns -- how to sort the results LIMIT count -- the result is limited to www.2cto.com 1. common query command: SELECT * FROM tbname; function: finds data of all columns FROM the tbname table. 2. query specific line commands: SELECT * FROM tbname WHERE colname = 'value'; function: Find rows with column values equal to 'value' FROM tbname in the table. 3. query specific column commands: SELECT col1, col2 FROM tbname; function: query the two columns col1 and col2 FROM the table. 4. query sorting command: order by column_name [ASC | DESC] [,...] function: Use the oeder by clause to sort the query results BY one or more columns. ASC is sorted in ascending order, which is the default value. DESC is descending. Order by cannot be sorted BY text or image. 5. query GROUP www.2cto.com command: group by col_name... function: grouping Command Based on the given column name: select count (*) FROM tbname; function: COUNT the number of non-NULL results. Use the command: SELECT species, COUNT (*) FROM pet group by species; function: query the number of each pet. 6. run the UPDATE tbname SET command to modify the WHERE condition of the column. For example, UPDATE guestbook SET visitor = 'sunnnyboysac 'WHERE comments = '... '; note: the condition for updating the visitor value to sunnyboysac is comments = '... '. 7. Run the "delete from tbname WHERE" command to DELETE data. For example, delete from guestbook WHERE visitor = 'sunnyboysac '. You can use the "delete from guestbook;" statement to DELETE data FROM the entire table.