I am new to database and web application development. I want to know how to store a list for a particular object in a database. For example, user comments for a particular post(object), or the friends or followers list of a particular user.
Normally we save data in the form of row
|user_id | user_name | use_password | etc | etc
|123 | neha | 123 | ... | ...
but here you cannot save them in rows because its a list:
|post_142524 | comment1 | comment2 | comment3 | etc...
How do you store comments? I can't think of creating new columns for each comment. and I can't create a table which stores data column-wise like this:
|post_142524|
|comment1 |
|comment2 |
|comment3 |
|comment4 |
|comment5 |
etc...
I want to know how to manage lists for particular object. I've searched around but, I think my search terms were not perfect to get what I am looking for, as I don't even know what term to use to search for this problem. Any help would be appreciated!