<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC=1,5] >[success] # **語法** * * * * * >[info] ##### **基本語法** ``` create table 表名( 列名 類型 是否可以為空, 列名 類型 是否可以為空 )ENGINE=InnoDB DEFAULT CHARSET=utf8 ``` ![](https://box.kancloud.cn/8576711008f5f3934cad6a3f5e2e9849_628x178.png) <br> * * * * * >[info] ##### **設置字段是否為空-null** ``` 默認值,創建列時可以指定默認值,當插入數據時如果未主動設置,則自動添加默認值 create table tb1( nid int null -可空 , num int not null -不可為空 ) ``` <br> * * * * * >[info] ##### **設置默認值-defalut** ``` 默認值,創建列時可以指定默認值,當插入數據時如果未主動設置,則自動添加默認值 create table tb1( nid int not null defalut 2, num int not null ) ``` * * * * * <br> >[info] ##### **設置自增-auto_increment** ``` 自增,如果為某列設置自增列,插入數據時無需設置此列 默認將自增(表中只能有一個自增列) create table tb1( nid int not null auto_increment primary key, num int null ) 或 create table tb1( nid int not null auto_increment, num int null, index(nid) ) ``` **注意**: ``` 1、對于自增列,必須是索引(含主鍵)。 2、對于自增可以設置步長和起始值 3、自增時要用int 類型 ``` 圖片對應第二條`CREATE TABLE 表名 ( ...) AUTO_INCREMENT=10000` ![](https://box.kancloud.cn/972d51c830b1fcecfe86dfbef98c6e79_662x69.png) <br> * * * * * >[info] ##### **主鍵 -primary key** ``` 主鍵,一種特殊的唯一索引,不允許有空值,如果主鍵使用單個列,則它的值必須唯一,如果是多列,則其組合必須唯一。 create table tb1( nid int not null auto_increment primary key, num int null ) 或 create table tb1( nid int not null, num int not null, primary key(nid,num) ) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看