Get the App
SLTechnology News&Howtos  ›  Development  › 

How mysql inserts a record

Shulou Source: shulou.com Published: 2022-06-03 07:10:05 10月02日 Update

This article is about how mysql inserts records. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Insert the specified column. If this column is not listed, automatically assign a value to null. If you do not insert a column and set a non-null constraint, an error will be reported.

2. Insert all columns. If any column does not want to insert a value, it needs to be assigned a value of null.

Example

Insert into table name: values (value, value....); eg:insert into product values (null,' Apple computer', 18000.0Mae 10); insert into product values (null,' Huawei 5G Mobile', 3000Mae 20); insert into product values (null,' Xiaomi Mobile', 1800Mae 30); insert into product values (null,'iPhonex',8000,10); insert into product values (null,'iPhone7',6000200); insert into product values (null,'iPhone6s',4000,1000) Insert into product values (null,'iPhone6',3500100); insert into product values (null,'iPhone5s',3000100); insert into product values (null,' Instant Noodles', 4.5 Magazine 1000); insert into product values (null,' Coffee', 11200); insert into product values (null,' Mineral Water', 3500). Thank you for reading! This is the end of this article on "how to insert a record in mysql". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Content mobile phone more article good practical coffee example millet article instant noodle computer look knowledge mineral spring mineral water apple Huibao Huawei reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Linux MariaDB Apple