Relational Tables, Yah or Nay?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Relational Tables, Yah or Nay?

Post by $var »

I know this is more an SQL question, and perhaps I should find a different forum for that sort of thing, however, I know that a lot of PHP programmers love wrapping their head around all problems... so, let's see what we can come up with here.

I am making a new database for a Content Management System that I am to create.
As there is a lot of shared information between the tables, I have thought that I would use ID#'s to connect the different tables.

For example:
- There are different User Levels (5)
- 1 of those user levels is associated with a Company Profile
- Each Company has Delegates
- Each Delegate attends an Event
- Each event has an ID

Does it sound logical to create:
- Members
- Comany
- Delegates
- Events

And within any given table, lets use Events for example:
- Event_ID
- Company_ID
- Delegate_ID
- Topic
- Date
- ...

I have never really done a relational structure like this, so best guess is that
- You link to Events first
- Open a link to Company
- Close Company link
- Open a link to Delegates
- Close Delegates link
- Close Events link

Will this train of thought lead me in the right direction? Of am I heading for a wreck?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Databases.
Post Reply