SQL用法总结
1、創(chuàng)建數(shù)據(jù)庫語句
create table persons('id' INT NOT NULL AUTO_INCREMENT,'lastname' VARCHAR(255) NOT NULL,'firstname' VARCHAR(255) NOT NULL,PRIMARY KEY ('ID')) DEFAULT CHARACTER SET = latin1 COLLATE = latin1_swedish_ci;
2、創(chuàng)建數(shù)據(jù)庫時,PK、NN、UQ、BIN、UN、AF、AI的含義
PK - Primary Key
NN - Not Null
BIN - Binary (stores data as binary strings. There is no character set so sorting and comparison is based on the numeric values of the bytes in the values.)
UN - Unsigned (non-negative numbers only. so if the range is -500 to 500, instead its 0 - 1000, the range is the same but it starts at 0)
UQ - Create/remove Unique Key
ZF - Zero-Filled (if the length is 5 like INT(5) then every field is filled with 0’s to the 5th value. 12 = 00012, 400 = 00400, etc. )
AI - Auto Increment
?
轉(zhuǎn)載于:https://www.cnblogs.com/sunflower627/p/4619014.html
總結(jié)
- 上一篇: SVN详细使用教程
- 下一篇: 中国能进口美国原装超声刀机器吗