I am writing a learning application. I can not understand how I keep in the database of friends, as in contact.
I have a table that contains the user name, his ID, and other information, but does not contain information about who is friends with him.
I wanted to ask you how I can structure my database so that I can get to know friends of a certain user.
I have only one solution, but, in my opinion, it is very bad: create the exact same table, and then connect these tables through auxiliary with the help of a foreign key.