I'm working on an Android app where people can register and login with their account. This information will be saved to some sort of database. So there will be a table, where each row is a new user. The table will have 3 columns for each user: username, password (encrypted of course), and friends. So yes, the users can friend other users.
The question I had is, what is the industry standard in implementing a table like this with the friends column.
I was thinking since each user will have an unique ID, the friends column for each user can just be a comma-separated list of the user IDs. Something like this:
ID Username Password Friends
1 blah **** 2,3
2 blah1 **** 1
3 blah2 **** 1
But the way I'm thinking of sounds super sketchy....how does someone like facebook setup their database to store friends. Or if facebook is too complicated...how is the best way to setup my database to store friends?