I need to combine data from two tables. This is how the diagram looks.

enter image description here

In the maze table there are data that are not in ozone, you need to combine the data. For this, I created two tables in which I write the book_id and isbn.

I did it this way because one book can have a lot of isbn

here is an example table

enter image description here

Now I need to compare two maze tables_book_id and ozone_book_id, and compare them on isbn.

And based on this, get a summary of information on the books. I do not know how to write this request. Help. I want to display data in a table on the web in this form.

enter image description here

I specify a question a little

There is a Labyrinth table with books. I take book_id and isbn from it, I do the same in ozone. Then I compare these two tables maze_book_id and ozone_book_id by isbn and if isbn matched then I take book_id from the matched entries in the first and second table and take book_id from ozone_book_id from ozone, for the maze I do the same, just from ozone and the maze different book_id. and the name does not matter which one to take.

  • what on your top scheme means dividing tables into 2 parts, i.e. making isbn and book_id in a separate table with an arrow? And what relation to the task has book_id if the grouping seems to be needed by isbn. And where to get the book_name if they are suddenly different in the ozone and the maze - Mike
  • There is a Labyrinth table with books. I take book_id and isbn from it, I do the same in ozone. Then I compare these two tables maze_book_id and ozone_book_id by isbn and if isbn matched then I take book_id from the matched entries in the first and second table and take book_id from ozone_book_id from ozone, for the maze I do the same, just from ozone and the maze different book_id. and the name does not matter which one to take. - shatoidil
  • but since you have several isbn for one book_id, which of the cover_type should you take if for this book_id there are several different isbn in the maze with different cover_type - Mike
  • No, here I first compare this maze_book_id and ozone_book_id, I find matches by isbn if a match is found, then I have roughly speaking it turns out so from maze_book_id book_id: 322 isbn: 1234 and ozone_book_id book_id: 430 isbn: 1234. Then I climb into the maze using this data and take a book on book_id from maze_book_id and do the same for ozone and create generalized data from them. Is it possible to do this? - shatoidil
  • everything's possible. you just need to understand the task. And I do not understand yet. If you simply compare 322 and 430, then write in the question. And you write about what page_type and cover_type are many for one book_id judging by the data example you cited - Mike

0