数据库筑表时,NOT NULL有什么用?

WBOY
Release: 2016-06-13 13:27:06
Original
1602 people have browsed it

数据库建表时,NOT NULL有什么用???
我建了一张测试表,其中有几个NOT NULL的字段,我在插入行的时候,没给这几个字段赋值,也插入成功了。
那NOT NULL还有什么用呢?

------解决方案--------------------
mysql里NULL 和 ''不是一回事,你只设置了字段为NOT NULL ,是可以插入空串的

探讨

真的。。。表结构:
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!