mysql增删改查
创建数据表:
创新互联是一家集网站建设,合阳企业网站建设,合阳品牌网站建设,网站定制,合阳网站建设报价,网络营销,网络优化,合阳网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。
MySQL> use simonwang
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> create table t1 (`id` int(4), `name` char(40));
Query OK, 0 rows affected (0.01 sec)
插入数据:
mysql> insert into studytable values(1,'test');
Query OK, 1 row affected (0.00 sec)
mysql> select * from studytable;
+------+------+
| id | name |
+------+------+
| 1 | test |
+------+------+
1 row in set (0.00 sec)
修改数据:
mysql> update studytable set name='updatetest' where id='1';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from studytable;
+------+------------+
| id | name |
+------+------------+
| 1 | updatetest |
+------+------------+
1 row in set (0.00 sec)
清空数据表:
mysql> truncate table studytable;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from studytable;
Empty set (0.00 sec)
删除数据表:
mysql> drop table studytable;
Query OK, 0 rows affected (0.00 sec)
删除数据库:
mysql> drop database simonwang;
Query OK, 0 rows affected (0.01 sec)
网站题目:mysql增删改查
网站URL:http://pwwzsj.com/article/piioeh.html