我的这段代码哪里不对?怎么改?
mysql> SHOW CREATE TABLE province \G
*************************** 1. row ***************************
Table: province
Create Table: CREATE TABLE `province` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
mysql> CREATE TABLE user1(
-> id SMALLINT UNSIGNED KEY AUTO_INCREMENT,
-> name VARCHAR(20) NOT NULL,
-> pid SMALLINT UNSIGNED,
-> FOREIGN KEY (pid) PREFERENCES province (id) ON DELETE CASCADE);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PREFERENCES province (id) ON DELETE CASCADE)' at line 5
mysql> SHOW CREATE TABLE province;