In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces what kinds of mysql constraints have, which have certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
1, not null is not empty.
eg:user name varchar(40)not nuluser name This column cannot have null values.
2) Unique constraints.
The following data cannot be duplicated with the preceding;eg:cardNochar(18)unique; duplicate data is not allowed in the cardNo column.
Primary key constraint (non-empty + unique).
Usually used in the id column of a table. Tables basically have id columns, which are unique flags.
id int primary key auto_increment, id does not need to be maintained by ourselves.
When inserting data, null is inserted directly, and the filling is automatically increased to avoid duplication.
examples
CREATE TABLE student(id INT PRIMARY KEY AUTO_INCREMENT, --primary key self-increasing NAME VARCHAR(30) UNIQUE, --unique constraint gender CHAR(1) NOT NULL DEFAULT 'male'); Thank you for reading this article carefully, I hope Xiaobian shared "mysql constraints what kind of" This article is helpful to everyone, but also hope that everyone more support, pay attention to industry information channels, more relevant knowledge waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.