self referencing tables, good or bad?
Posted
by
NimChimpsky
on Programmers
See other posts from Programmers
or by NimChimpsky
Published on 2012-11-30T13:08:06Z
Indexed on
2012/11/30
17:19 UTC
Read the original article
Hit count: 235
sql
|database-design
Representing geographical locations within an application, the design of the underlying data model suggests two clear options (or maybe more?).
One table with a self referencing parent_id column uk - london (london parent id = UK id)
or two tables, with a one to many relationship using a foreign key.
My preference is for one self-refercing table as it easily allows to extend into as many sub regions as required.
IN general do people veer away from self referencing tables, or are they A-OK ?
© Programmers or respective owner