1.为数据表t_press设置主键press_id,为t_book设置主键isbn和外键press_id，外键press_id参照t_press表中的主键press_id。
ALTER TABLE t_pRESS ADD PRIMARY KEY(press_id);
ALTER TABLE t_boOK ADD PRIMARY KEY(isbn);
ALTER TABLE t_book ADD CONSTRAINT fk_pressid FOREIGN KEY(press_id) REFERENCES t_press(press_id);


插入数据验证
INSERT INTO t_press(press_id) VALUES("101");
INSERT INTO t_press(press_id) VALUES("102");
SELECT * FROM t_press;
INSERT INTO t_book(isbn,press_id) VALUES("8-301-2345-567","101");
INSERT INTO t_book(isbn,press_id) VALUES("8-302-2345-567","103");

2创建数据表t_borrow_record1，表结构与t_borrow_record一致，设置主键borrow_id，外键reader_id和ISBN，外键reader_id参照t_reader中的主键reader_id，外键ISBN参照t_book中的主键ISBN。
CREATE TABLEt_borrow_record1 (
 borrow_id char(6) ,
 reader_id char(6) ,
 ISBN char(17) ,
 Borrow_date date ,
  PRIMARY KEY (borrow_id),
  CONSTRAINTfk_ISBN FOREIGN KEY (ISBN) REFERENCESt_book (ISBN),
  CONSTRAINTfk_readerid FOREIGN KEY (reader_id) REFERENCESt_reader (reader_id)
) ;


