increment功能的sql代码怎么写

更新时间:02-04 教程 由 扶南 分享

increment功能的sql代码怎么写?

先进mysql

mysql -u用户名 -p

输入密码

然后进入你的库 use 库名

没有库就建一个create database 库名;

建表create table 表名(

book_id int(10) not null primary key auto_increment

其他省略了);

not null是非空

primary key 是主键

auto_increment是自增长

题目里有限制字数的话需要注意下用的是GBK还是utf-8字符集

GBK一个汉字2字节 utf8一个汉字3字节

设置外键的时候注意每个外键必须依赖另一个表的主键

声明:关于《increment功能的sql代码怎么写》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2198729.html