I have a database called data that is going to contain some data about writers, books and images. I've created these tables so far, but I don't know how to struct the images table. A writer or book can have more than one images, so I thought I could solve this issue by creating a table called img and attach to other tables. Is that a correct solution? If it's not, how can it be improved? I use innodb as a storage engine.
Table name : Book
book_id (Primary Key)
book_name
writer_id (Foreign Key)
Table name : Writers
writer_id (Primary Key)
writer_name
writer_bio
Table name : Images
image_id (Foreign Key for all tables that need to hold an image including book,writers, etc.)
image_url
I have an additional question. I started adding data into my tables, but didn't create the relationships yet. Would it be a problem when I create the relationships? Will the indexes be created automatically?