Есть две базы данных:
База 1:
CREATE TABLE book
(
ID int not null auto_increment,
NAME varchar(500) not null,
ISSUE_YEAR YEAR,
PUBLISHER_ID int,
ISBN char(17),
PRICE DECIMAL(10, 2),
QUANTITY int unsigned not null default 0,
PRIMARY KEY (ID),
INDEX IX_BOOK_PUBLISHER (PUBLISHER_ID),
FOREIGN KEY FK_BOOK_PUBLISHER (PUBLISHER_ID) references publisher(ID)
ON UPDATE RESTRICT
ON DELETE RESTRICT
);
#И остальные таблицы
База 2:
CREATE TABLE IF NOT EXISTS store
(
ID int not null auto_increment,
CITY varchar(255) not null,
PRIMARY KEY (ID)
);
CREATE TABLE book
(
ID int not null auto_increment,
NAME varchar(500) not null,
ISSUE_YEAR YEAR,
PUBLISHER_ID int,
ISBN char(17),
PRIMARY KEY (ID),
INDEX IX_BOOK_PUBLISHER (PUBLISHER_ID),
FOREIGN KEY FK_BOOK_PUBLISHER (PUBLISHER_ID) references publisher(ID)
ON UPDATE RESTRICT
ON DELETE RESTRICT
);
CREATE TABLE book_store
(
BOOK_ID int not null,
STORE_ID int not null,
PRICE DECIMAL(10, 2),
QUANTITY int unsigned not null default 0,
PRIMARY KEY (BOOK_ID, STORE_ID),
FOREIGN KEY FK_BOOK_STORE_BOOK (BOOK_ID) references book(ID)
ON UPDATE RESTRICT
ON DELETE RESTRICT,
FOREIGN KEY FK_BOOK_STORE_STORE (STORE_ID) references store(ID)
ON UPDATE RESTRICT
ON DELETE RESTRICT
);
Необходимо перенести данные BOOK_ID, PRICE, QUANTITY из таблицы book базы1 в таблицу book_store базы2.
Как это выполнить?