N
N
naneri2014-12-15 08:56:10
MySQL
naneri, 2014-12-15 08:56:10

Do I need to add an ID column in pivot tables?

I was interested in the question - does it make sense to add an ID column in pivot tables in MySQL? Is it possible to do without it? Or is it always needed?
Are there any cases by which you can understand when they are needed and when they are not needed?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Wolf, 2014-12-15
@naneri

No, don't.

A
Alexey, 2014-12-15
@rdifb0

You can create for convenience if you need to manage a specific record. Especially if there are additional fields there, such as sorting, or a counter.
If you don't explicitly specify a primary key, MySQL will create one anyway, "hidden".

I
Ivan Gontarenko, 2014-12-15
@dez-fafara

everything depends on the task. and how they will be used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question