LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2001, 03:26 PM   #1
oulevon
Member
 
Registered: Feb 2001
Location: Boston, USA
Distribution: Slackware
Posts: 438

Rep: Reputation: 30
Database Design Question


This is a more general question on database design. I'm working on a web application in java that is very database intensive. Can you create a table that contains tables that contains tables? For instance
LinuxQuestions.org is a table that contains all the forums, and each forum can be a table that contains all the questions, and in turn each question can be a table (albeit small) that contains the repsponses. So in summation it looks like this:
LinuxQuestions.org(a table consisting of tables)
|
Each Forum section i.e Programming(a table consisting of tables)
|
Each specific question i.e this one(a table consisting of responses)
|
each response(just a record)


So can a database be designed like this, and if so is this a good design or is there another way to go about this? If anyone has any info or links, I'd appreciate it. I want to make sure the design of my database is solid before moving forward with the application. Thanks alot.
 
Old 09-12-2001, 03:53 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980
That's kinda of the whole point of relational databases like SQL / Oracle.

They don't 'contain' tables, but use foreign / primary key pairs to look up values in another table.

Quick example... if i can think of one...
well, i did a cd database in my degree course...

Collection table:

Title ID, Date of purchase

CD table:

Title ID, Title, Artist ID, Length, Label, er... Colour!

Artist Table:

Artist ID, Artist, #members etc....

And so it goes on. now each pair of ID fields is associated (SQL generally uses the 'references' keyword) to maintain data integrity, and then you rebuild an entire 'record' with a slightly more drawn out SQL statement.

You'd do well to buy a book. Very easy to pick up once you get teh gerneal idea.
 
Old 09-12-2001, 04:18 PM   #3
oulevon
Member
 
Registered: Feb 2001
Location: Boston, USA
Distribution: Slackware
Posts: 438

Original Poster
Rep: Reputation: 30
Thanks for your post. I've looked at a few books, but none seem to focus on database design. I'm using MySQL , and I checked out the book by O'Reilly. They have a good chapter on design, but I felt looking for a few more answers after reading it. Do you have any recommendations on books?
 
Old 09-12-2001, 04:27 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980Reputation: 1980
i've got:

The Practical SQL Handbook
Bowman Emerson Darnovsky
Addison Wesley

Pretty good i've found. It's not really a 5 minute thing though, relational DB's...
 
Old 09-12-2001, 04:38 PM   #5
oulevon
Member
 
Registered: Feb 2001
Location: Boston, USA
Distribution: Slackware
Posts: 438

Original Poster
Rep: Reputation: 30
Thanks for the book title. I'm not looking for a quick answer. I'd rather have a solid understanding of this stuff. I've done some reading on relational database design and normalization. Where I'm new to database programming I have a real narrow view on how they work, and I don't think I'm even close to taking advantage of all the features. So I think I've got to sit back and get some concepts down. Thanks for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
a good book for relational database design? kpachopoulos General 3 11-20-2004 08:14 AM
Design question blmack44 Linux - Hardware 1 08-22-2004 10:05 AM
More database design issues logicdisaster Programming 7 08-11-2004 04:52 PM
Database design issues logicdisaster Programming 6 08-07-2004 10:52 AM
web database design issues spyghost Programming 3 08-29-2003 05:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration