Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Performance Question 1

Status
Not open for further replies.

uncLez

Programmer
Jun 18, 2002
38
NL
Hi all.

I've got a question:
I am designing a database for musical instruments. In this dbase there are going to be instruments of different sorts/types/categories and so forth.

The amount of layers wil be variant.

eg: guitars wil have electrical/non-electrical, but saxophones would have alt/soprano/tenor, each with their own subclasses.

I was thinking of doing this as follows:
Make 1 table with ALL the categories. Every category will have one field "ParentID" which contains the primary key field of the category that is this one's parent.

So this will be a field containing a primary key from the same table...

This gives me great flexibility concerning the multi-layered separation in classes, but I wil have to do a recursive sort after retrieving the informartion from the database.

Is this wise? Or are there better ways do do this?

Thanx in advance for your advice,
Anton de Wit.
 
From a data-efficiency standpoint, its probably the best way to go. Also consider the analogy of a geneaology database, where each person's FatherID and MotherID values point to the same People table.

You're right that some of the queries will start to seem complicated because of the self-joins, but that's half the fun! --------------
Low Cost Prints:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top