Get the App
SLTechnology News&Howtos  ›  Database  › 

Insert data and add statements in MySQL data Table

Shulou Source: shulou.com Published: 2022-06-01 16:34:31 10月14日 Update

Each database has the function of adding, deleting, changing and querying, so let's briefly talk about the usage of MySQL INSERT statements.

The MySQL INSERT statement allows you to insert one or more rows into a table

INSERT INTO table (column1,column2...) VALUES (value1,value2,...); first, after the INSERT INTO clause, specify the table name and the list of comma-separated columns in parentheses. Then, place the comma-separated values of the corresponding columns in parentheses after the VALUES keyword. two, MySQL INSERT-insert multiple lines of INSERT INTO tasks (subject,start_date,end_date,description) VALUES ('task-1') ('task-1'), ('task-2'), ('task-2)), (' task-2), ('task-2), (' task-3), ('task-3), ()

Note that it is not necessary to specify a value for an auto-incrementing column, such as an id column, because MySQL automatically generates a value for the auto-increment column.

The article is from http://www.huthon.com.

Tags: Tasks statements parentheses commas multiple rows data one row keywords functions clauses databases articles generation data tables Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS Apple Docker Redmi