在看《Learning SQL》第二版,

慢慢打实SQL的基础。

建表一:

), lname ), gender ENUM(), city ), state ), country ), postal_code ), CONSTRAINT pk_person PRIMARY KEY (person_id) );

建表二:

), CONSTRAINT pk_favorite_food PRIMARY KEY (person_id, food), CONSTRAINT fk_fav_food_person_id FOREIGN KEY (person_id) REFERENCES person (person_id) );

MYSQL建表语法(主键,外键,联合主键)-LMLPHP

05-02 08:07