当前位置: 技术问答>linux和unix
问个数据库的问题?
来源: 互联网 发布时间:2015-11-06
本文导语: CREATE TABLE `wang`.`businesses` ( `businesses_id` INT(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, `city` varchar(255) NOT NULL, `telephone` varchar(255) NOT NULL, `url` varchar(255) , PRIMARY KEY(`businesses_id`) U...
CREATE TABLE `wang`.`businesses` (
`businesses_id` INT(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`telephone` varchar(255) NOT NULL,
`url` varchar(255) ,
PRIMARY KEY(`businesses_id`)
UNIQUE business_id (business_id),
KEY business_id_2 (business_id)
)
最低下的这两句是什么意思
UNIQUE business_id (business_id),
KEY business_id_2 (business_id)
`businesses_id` INT(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`telephone` varchar(255) NOT NULL,
`url` varchar(255) ,
PRIMARY KEY(`businesses_id`)
UNIQUE business_id (business_id),
KEY business_id_2 (business_id)
)
最低下的这两句是什么意思
UNIQUE business_id (business_id),
KEY business_id_2 (business_id)
|
UNIQUE,不能插入相同的值,唯一性
KEY,键值,用处很多
找本数据库的书看看。
KEY,键值,用处很多
找本数据库的书看看。