What is wrong with this mysql INSERT statement? I have table:
Book:
- id:(int) primary key, autoincrement, not null,
- title:(varchar) not null,
- price: (decimal) not null

and
Artical:
- id:(int) primary key, autoincrement, not null,
- title:(varchar) not null,
- price: (decimal) not null,
- book_id:(int) foreign key referencing book

I already have couple of books in Book table while Artical table is empty, i want to have and insert statement in Artical that will insert data and fill in book_id foreign key properly. I came up to this statement wich is not good but i'm feeling i'm close, here it is:
INSERT INTO Artical (id,title,price,book_id) 
VALUES (
    null,
    'Six faces of shadow',
    15, 
    ( 
        SELECT book.id 
        FROM book 
        JOIN Artical AS ar 
        WHERE book.title = ar.title
    )
);
There are two way to insert data:

if you have to insert data in Artical table with specific book title then do following

INSERT 
INTO Artical (title, price, book_id) 
VALUES (
    'Six faces of shadow', 
    15, 
    (
        SELECT book_id FROM book 
        WHERE book.title = &quot;Six faces of shadow&quot;
    )
);


if you want to add all book title with id then do following

INSERT 
INTO Artical (title, price, book_id) 
SELECT title, price, book_id FROM book

Hope this Help!!!