What are precautions for setting null values and non-null values when creating a table in mysql?

Source: Internet
Author: User
Tags mysql create
What are the values of null and non-null when creating a table in mysql? What are the values of null and non-null when creating a table in mysql? Mysql, I usually try not to use null. if your 0 and n mysql create a table with null values and non-null values, what should I do?
What are the values of null and non-null when creating a table in mysql? Mysql
------ Solution --------------------
I usually try not to use null

If your 0, null, or ''and null have different meanings, you must allow vacancy.
------ Solution --------------------
This post was last edited by xuzuning at 08:16:39. it depends on your business needs.
NULL indicates that nothing is input, that is, the data item is invalid.

If your business requires an initial value for the data item, use not null (NOT empty) and set the initial 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.