目 录CONTENT

文章目录

MySQL数据库插入和删除表数据(八)

geekrabbit
2019-06-21 / 0 评论 / 1 点赞 / 81 阅读 / 1,029 字 / 正在检测是否收录...
温馨提示:
创作不易,转载请注明出处
广告 广告

MySQL 插入数据

INSERT INTO table_name ( field1, field2,...fieldN ) VALUES ( value1, value2,...valueN );
mysql> show columns from runoob_tbl;
+-----------------+------------------+------+-----+---------+----------------+
| Field           | Type             | Null | Key | Default | Extra          |
+-----------------+------------------+------+-----+---------+----------------+
| runoob_id       | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| runoob_title    | varchar(100)     | NO   |     | NULL    |                |
| runoob_author   | varchar(40)      | NO   |     | NULL    |                |
| submission_date | date             | YES  |     | NULL    |                |
+-----------------+------------------+------+-----+---------+----------------+
mysql> insert into runoob_tbl
    -> (runoob_title, runoob_author, submission_date)
    -> values
    -> ("学习 mysql", "好简单", NOW());
Query OK, 1 row affected, 1 warning (0.13 sec)

mysql> select *  from  runoob_tbl
    -> ;
+-----------+--------------+---------------+-----------------+
| runoob_id | runoob_title | runoob_author | submission_date |
+-----------+--------------+---------------+-----------------+
|         2 | 学习 mysql   | 好简单        | 2019-06-21      |
+-----------+--------------+---------------+-----------------+

1
广告 广告

评论区