日期:2014-05-16 浏览次数:20853 次
mysql> create table t_Myxiao7(id int not null auto_increment primary key ,name v archar(10), genda varchar(10),age int); Query OK, 0 rows affected (0.08 sec) mysql> insert into t_Myxiao7 values -> (null,'张三','男',20), -> (null,'王五','男',22), -> (null,'李四','男',25), -> (null,'陈大','男',19); Query OK, 4 rows affected (0.05 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql> mysql> select * from t_Myxiao7; +----+------+-------+------+ | id | name | genda | age | +----+------+-------+------+ | 1 | 张三 | 男 | 20 | | 2 | 王五 | 男 | 22 | | 3 | 李四 | 男 | 25 | | 4 | 陈大 | 男 | 19 | +----+------+-------+------+ 4 rows in set (0.01 sec) mysql> delete from t_Myxiao7 where id=3 or id =4; Query OK, 2 rows affected (0.08 sec) mysql> select * from t_Myxiao7; +----+------+-------+------+ | id | name | genda | age | +----+------+-------+------+ | 1 | 张三 | 男 | 20 | | 2 | 王五 | 男 | 22 | +----+------+-------+------+ 2 rows in set (0.00 sec) mysql> alter table t_Myxiao7 AUTO_INCREMENT 3; Query OK, 2 rows affected (0.19 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> insert into t_Myxiao7 values -> (null,'春哥','男','27'); Query OK, 1 row affected (0.06 sec) mysql> select * from t_Myxiao7; +----+------+-------+------+ | id | name | genda | age | +----+------+-------+------+ | 1 | 张三 | 男 | 20 | | 2 | 王五 | 男 | 22 | | 3 | 春哥 | 男 | 27 | +----+------+-------+------+ 3 rows in set (0.00 sec) mysql>