Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database with Tables within Tables

 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to design a database with tables within tables?
For instance:
The Big Moose Saloon can be one table consisting of all the forums which each can be one table consisting of all the queries which in turn each can be a table consisting of all the replies.

So in summation it looks like this:
BigMooseSalon--->Individual Forums---->Individual Queries--->Replies.
So BigMooseSaloon is a table consisting of all the individual forums which each is a table consisting of all the individual queries which in turn can be its own table that consists of all the replies.
So getting back to my original question, can you design a database like this, using tables within tables? And if so, is it a good idea or bad idea?

Thanks for any input.

- Sean
 
Daniel Dunleavy
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it but the downside is it may make sql statement down the line more difficult as your system becomes bigger. Its easier to modify a simple design than a complex one.
Dan
 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I figured that out on my own. Instead I took some time to design the database and used foreign keys. Thanks for your reply though.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic