Y
Y
Yuri Averyanov2019-02-24 19:52:50
PostgreSQL
Yuri Averyanov, 2019-02-24 19:52:50

How to make two tables?

The task is next. There is a table of users with data and there is a table of accounts linked to the user (one user can have two accounts). How to merge two tables so that when a user is deleted, all his accounts are deleted? Is this done through sql or is a separate method written?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-02-24
@aversys

This is done through foreign key constraints .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question