SQL Learning (II) of the four queries and standard wording

Four SQL query - CRUD

By -INSERT

INSERT INTO table (field list) VALUES (value list)

INSERT INTO `user_table` (` ID`, `username`,` password`) VALUES (0, 'blue2', '987654'); // to 0 because we set before automatic increase, and 0 is not a legitimate id value, it will automatically gave us

删 -DELETE

DELETE FROM table drop table

DELETE FROM `user_table`

Note: There is no way to delete only one field, only delete a row

改-UPDATE

SET UPDATE Table = Value field, field = value, ...

UPDATE `article_data` SET` n_like = n_like + 1` each data field update n_like

Charles -SELECT

What SELECT field FROM table

SELECT * (on behalf of all) FROM `user_table`; to query all the fields for each data

SELECT user, pass FROM `user_table`; query data for each specified field

SQL standard wording

  • Keyword Capitalization

  • Databases, tables, fields need to add `` (back single quotes)

  • End with a semicolon

Guess you like

Origin www.cnblogs.com/kunmomo/p/11447994.html