Home > Backend Development > PHP Tutorial > mysql的not null 细节请问

mysql的not null 细节请问

WBOY
Release: 2016-06-13 12:39:14
Original
798 people have browsed it

mysql的not null 细节请教
比如这样的一条sql ddl语句:

password char(32) not null default "",//有md5
Copy after login


既然都定义了not null了,那么用户就强制必要添加密码了,那后面来个默认值是不是有点多余?而且我长度规定是32位,默认值是空,

感觉有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