Answer the question
In order to leave comments, you need to log in
Do I need to use relationships between mySQL tables?
Suppose I have a groups table, and a subscribers table (the id of users who joined the community - groups are stored here). That is, I select the groups table, do a join - that is, I attach the subscribes table by groups.id=subscribes.id_group. Well, in this way I understand whether the user is subscribed to a particular community or not.
It seems everything is ok. But recently I learned that there is a type of relationship many to many. Where in the database itself this connection needs to be created. The question arises, why indicate these links in the database, if this join works without them?
And the second mini-question.
I recently learned that when you make a database select, for example WHERE id=20, the database does not search for this record by enumeration starting from id=1, but accesses id=20 immediately. This was a shock for me. How does it find the entry right away? He's not Nostradamus)) Recommend someone an article on how the database works in this regard? And then in the internet I find only books of 700 pages :((
Answer the question
In order to leave comments, you need to log in
It seems everything is ok. But recently I learned that there is a type of relationship many to many. Where in the database itself this connection needs to be created. The question arises, why indicate these links in the database if this join works without them?
I recently learned that when you make a database select, for example WHERE id=20, the database does not search for this record by enumeration starting from id=1, but accesses id=20 immediately. This was a shock for me. How does it find the entry right away?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question