Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are two ways for mysql to insert a record?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge of what the two ways of inserting records in mysql are. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take 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); these are all the contents of the article "what are the two ways for mysql to insert records?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report