what's wrong with this table sql syntax?# Database - 数据库
ET
1 楼
CREATE TABLE model_by_res (
res_id SMALLINT UNSIGNED NOT NULL,
model_id TINYINT UNSIGNED NOT NULL,
PRIMARY KEY (res_id, model_id),
CONSTRAINT fk_model_by_res_res FOREIGN KEY (res_id) REFERENCES resistor (
res_id) ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT fk_model_by_res_model FOREIGN KEY (model_id) REFERENCES res_
model (model_id) ON DELETE RESTRICT ON UPDATE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
dont' know why yah?
res_id SMALLINT UNSIGNED NOT NULL,
model_id TINYINT UNSIGNED NOT NULL,
PRIMARY KEY (res_id, model_id),
CONSTRAINT fk_model_by_res_res FOREIGN KEY (res_id) REFERENCES resistor (
res_id) ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT fk_model_by_res_model FOREIGN KEY (model_id) REFERENCES res_
model (model_id) ON DELETE RESTRICT ON UPDATE CASCADE
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
dont' know why yah?