E
E
ezh_official2021-03-09 22:57:07
MySQL
ezh_official, 2021-03-09 22:57:07

How to add a lot of data in mysql?

I need to add several values ​​to the database for the user.
Requires adding the ID (6-digit) of multiple "rooms" for the same user. How to make it practical and convenient. Create many fields, or somehow cram into one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SagePtr, 2021-03-10
@ezh_official

Through a separate table that contains at least two fields: user id and room id (well, and possibly other fields as well, such as the date this user joined this room, the access level in the room, and the like, depending on what else you need need to know about the user's membership in a particular room).
Such a relationship is called many-to-many, and is implemented by a separate table

R
Romses Panagiotis, 2021-03-10
@romesses

Read about database normalization on Habré: https://habr.com/ru/post/254773/
If you still have specific questions, come back.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question