I'm tasked with designing an application that will allow a person to scan a legal document, save that associated with a Name and save it to a database.
Now, inside of the Organization, there are many departments, and each department can have many sub departments.
Problem lies in that some larger organizations will have many departments and smallers ones will only have 1 or two.
I've though about creating a Department table and a Supdepartment table to create associations, etc. That way it's extensible and users can dynamically create departments to fit my program to their organizational scheme.
Am I approaching this the right way? As I said, this is my first commercial application so I want to do it right and set a name for myself for delivering things on time and good code for other to expand upon.
Edit: Something like this do you think is better?
Department
ID Name Description ParentDepartment
If ParentDepartment is null then that is a root department, correct? Is this the optimal solution? The design is oriented that way because I want to load buttons on my form according to the number of root departments.
If its set up this way won't I have to scan every single entry in the Department table to verify it's "rootiness"? :P