This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Database with Tables within Tables  RSS feed

 
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
 
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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!