aspose file tools*
The moose likes JDBC and the fly likes Database with Tables within Tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Database with Tables within Tables" Watch "Database with Tables within Tables" New topic
Author

Database with Tables within Tables

Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
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

Joined: Mar 13, 2001
Posts: 276
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

Joined: Dec 16, 2000
Posts: 625
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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database with Tables within Tables