<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>

                ##此章節介紹MYSQL的基礎表命令 [TOC] ## 測試表 | id | name | age | | --- | --- | --- | | 1 | lihong | 20 | | 2 | zhangfei | 30 | | 3 | liubei | 34 | | 4 | guanyu | 32 | | 5 | kongming | 30 | ### 1.>顯示表 ~~~ show tables; ~~~ ### 2.>查看表結構 desc 表名; ~~~ 例:desc user; ~~~ ### 3.>查看表的創建過程 show creat table 表名; ~~~ 例:show creat table user; ~~~ ### 4.>插入表數據 insert into 表名 (列名1,[列名2],...) values (列1值,列2值); 雖然用value也可以,但不建議。 字符串型的加單引號。 ~~~ 例1:insert into user (name,age) values ('lihong',20); ~~~ ~~~ 例2:insert into user values (2,'zhangfei',30); ~~~ ~~~ 例3:insert into user values (3,'liubei',34),(4,'guanyu','32),(5,'kongming',30),(6,'guanyu',51); ~~~ ### 5.>修改表數據 update 表名 set 要更改的列名=更改后的值 where 條件; ~~~ 例:update user set age=45 where name='guanyu'; ~~~ ### 6.>刪除表數據 ~~~ delete from user where name='guanyu'; ~~~ ### 本章小結 * * * * * `SHOW TABLES; `顯示庫下面的表; `DESC TABLENAME;` 查看表結構; `SHOW CREATE TABLE TABLENAME; `查看表的創建過程; ~~~ CREATE TABLE TABELNAME ( 列名稱1 列類型 [列參數] [not null default ] ……列2…… ………… 列名稱N 列類型 [列參數] [not null default ] )engine myisam/innodb charset uft8/gbk; ~~~ 創建表; ~~~ insert into 表名(col1,col2,……) values(val1,val2……); -- 插入指定列 insert into 表名 values (,,,,); -- 插入所有列 insert into 表名 values -- 一次插入多行 (val1,val2……), (val1,val2……), (val1,val2……); ~~~ 插入表數據; ~~~ update tablename set col1=newval1, col2=newval2, ... ... colN=newvalN where 條件; ~~~ 修改數據; ~~~ delete from tablenaeme where 條件; ~~~ 刪除數據; * * * * * ## 提問:下面的查詢語句輸出結果 ~~~ select * from user where 1; ----輸出內容? ~~~ ~~~ select * from user where 0; ----輸出內容? ~~~
                  <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>

                              哎呀哎呀视频在线观看