Answer the question
In order to leave comments, you need to log in
How to correctly enter data in PostgreSQL?
Hello. I did not work with relational databases, so I ask for help.
There are 2 tables, books and authors. A book can have multiple authors, and authors can have multiple books.
books:
ID | Title
22 | GOT
34 | Hello
author:
ID | Name
11 | Martin
23 | John
books_author:
ID | aID | bID
10 | 11 | 22
11 | 23 | 34
Answer the question
In order to leave comments, you need to log in
can this be done with a single request?Everything can be done in one query if you put the operations in a stored procedure. In your case, it will accept a book title and a list (or table) of authors' names.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question