zoukankan      html  css  js  c++  java
  • 学习笔记:MySQL列属性

    列属性

    a)         null|not null

    缺省值是null,也就是允许为空,如果是not null而又没有给该字段赋值的话,系统会首先查询该字段有没有默认值

    b)         default:

    给一个字段一个默认值,如果没有给该字段填充数据,就用该默认值来代替,通常就是配合not null一起使用

    c)         primary key:

    主键,唯一可区别其他记录的字段,一个表中只能有一个主键,也可以很多个字段组合成一个组合主键,而且不允许为空!

    d)         unique key:

    唯一键,与主键的区别是唯一键可以有很多个,而且允许为空

    e)         auto_increment:

    自动增长,使用这个属性有两个条件,第一该字段必须为整型,第二该字段必须存在索引,通常就是配合主键一起使用,也可以通过修改表选项设置自动增长的默认初始值

    f)          comment:

    列注释,会出现在创建语句里的,方便开发者用

  • 相关阅读:
    进程与线程
    the art of seo(chapter seven)
    the art of seo(chapter six)
    the art of seo(chapter five)
    the art of seo(chapter four)
    the art of seo(chapter three)
    the art of seo(chapter two)
    the art of seo(chapter one)
    Sentinel Cluster流程分析
    Sentinel Core流程分析
  • 原文地址:https://www.cnblogs.com/dreamskyx/p/6105738.html
Copyright © 2011-2022 走看看