MySQL实战篇:自动增长,auto_increment,用于数值,配合索引
1.创建表
create table test_auto_increment(
id int unsigned key auto_increment,
username varchar(20)
);

2.插入数值
(1)insert test_auto_increment(username) values ('A');
(2)insert test_auto_increment(username) values ('C');
(3)insert test_auto_increment(username) values ('D');
(4)insert test_auto_increment(id,username) values (null,'E');
(5)insert test_auto_increment(id,username) values (default,'F');
(6)insert test_auto_increment(username) values (' ','G');

3.查看表的详细信息
show create table test_auto_increment;

相关推荐
-
MySQL 安装失败,提示Apply Security Settings 的处理办法
MySQL 安装失败,提示Apply Security Settings 的处理办法2025-04-20 01:54:57 -
MySQL事务隔离级别详解2025-04-20 01:44:01
-
一文说清nginx规则匹配(含案例分析)2025-04-20 01:10:02
-
运维服务篇:Nginx常用功能(rewrite重定向/location定位等)
运维服务篇:Nginx常用功能(rewrite重定向/location定位等)2025-04-20 00:55:25 -
php定义变量规则不能包含哪些字符?2025-04-20 00:27:24