028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

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增删改查
转载注明:http://www.tsicrk.com/article/piioeh.html

其他资讯

让你的专属顾问为你服务

1.1962s