Ask the statement 'AAA' varchar (11) NOTNULL when creating a field. what is the role of NOTNULL?

Source: Internet
Author: User
What is the role of NOTNULL in the statement 'AAA' varchar (11) NOTNULL when creating a field? What is the function of the statement 'AAA' & nbsp; varchar (11) & nbsp; NOT & nbsp; NULL in "NOT & nbsp; NULL" when creating a field? NOT & nbsp; NULL? ------ Solution ------------------ what is the role of not null in the statement 'AAA' varchar (11) not null when creating a field?
When creating a field, what is the function of the statement 'AAA' varchar (11) not null?
Not null?
------ Solution ----------------------
This field cannot be blank (null). That is, when a record is inserted, this field must have a value.
Not null? Yes, of course, but it depends on your business.
------ Solution ----------------------
Not null indicates that this field cannot be null when you insert it.
Remember, null is different from null. the null string is :''

The database can declare not null default''

In this case, data is inserted. if this field is not declared, it is stored as a null string by default.

There are many reasons for not null. one of the reasons is that a field in the database is null, which indicates null, the string is null after you obtain it.
------ Solution ----------------------
When inserting data, the field cannot be blank and must have a value.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.