Addition, deletion, modification and query of MySQL table_some words of mysql addition, deletion, modification and query
class=”markdown_views prism-github-gist”> Addition, deletion, modification and query of MySQL tables CRUD is an acronym for the four words Create, Retrieve, Update, and Delete. The operation of the table is based on a set of records; Addition and deletion can only take one record as the basic unit. 1. Add (Create / Insert) Single quotes, double quotes ====” are used in strings, date and time in data records; Backquotes ====” used in the structure of the library name, table name, field name; You can omit backticks at all as long as you are careful to avoid using keywords as library names, surfaces, field names. 1.1 Insert – create table –Build Table–“Student Table Just use the interface CREATE TABLE `db_11_20`.`students` ( `id` INT NOT NULL AUTO_INCREMENT, `sn` INT NOT NULL COMMENT ‘student number’, `name` VARCHAR(45) NOT NULL, `email` VARCHAR(200) NULL, PRIMARY KEY (`id`), UNIQUE INDEX `sn_UNIQUE` (`sn` ASC)); 1.2 Single row data + full column insert Insert one row at a time, and the inserted data contains the data of all fields; Since all fields are inserted, the field part can be omitted in SQL; The order of the values inserted later must be the same as the order in the table…