This was asked in an interview question that what will be the data structure schema of database if you are given to save folder and they have files stored in it and also they contain sub folders in it.
So the best schema for this type of problem is that we will only require one table.
Yes one Table will do the job and more interestingly only 3 fields are enough to save this information.
Field Name – Key – Data Type – Nullable
1). Dir – Primary Key -int – Not Null
2). Dir_Parent – Foreign Key -int – Null Allowed
3). Description – Null -Varchar – Not Null
Here on top is the description of how data will be save in database using one table and .