A
A
artshelom2019-01-24 20:28:40
PostgreSQL
artshelom, 2019-01-24 20:28:40

How to set up a database?

I am studying ASPNet, I don’t know how to arrange a Postgresql database, the idea is that there will be users and posts (for the sake of an example, you can say not posts but questions like on this site). What should I do:
1. Divide the database into 2 databases (users and posts) and add a link to the user in the post with a new post and make a link to the post from the user?
2. Also divide into 2 databases and add a link to the user only in the post with a new post, if the user asks for all his articles, then just parse all posts
3. Make 1 database, where everything will be together.
Interest is the best option, which can be bad (Where can I read about the implementation of the database?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail, 2019-01-24
@artshelom

Split into 2 databases

No need. Create one DB but with two tables. The structure is something like this:
Users(id, name, password)
Posts(id, user_id, post)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question