我们建表的时候到底怎么写啊?
写这个样子???
CREATE TABLE `users` (
`id` smallint(6) NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`pid` smallint(6) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `pid` (`pid`),
CONSTRAINT `users_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `provinces` (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8