If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > DB design, a few issues.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-10-10, 09:12
monkeydb monkeydb is offline
Registered User
 
Join Date: Aug 2010
Posts: 3
DB design, a few issues.

I've been developing for someone, I'm new so it's all free thus it's for experience only. I say that because you'll likely notice lots of errors here that I'm not aware off and boil your blood because someone could be profiting off such tripe!

anyway:

They're the bulk of my tables, it's all important.

http://i.imgur.com/8wbL4.jpg

I'm having trouble deciding the relationships. Here's what I think you should know:

A customer can only be an exhibitor, trader, food vendor or weekender.
A customer cannot be more than one of the above.
The aforementioned can only be one registered customer even if they bring x amount of staff.

That tells me it's a simple 1-1 relationship. At first I thought they were 1-n but I'm convinced they should be 1-1. If I create a form I get a lot of errors, although 1-n worked fine when I had that set up (you'll notice multiple IDs).

The reason I've kept customer types separate and not just included a field determining the customer type is because different data is stored depending on the customer type.

So, am I handling this the right way? or do I have my wires crossed?

thanks.
Reply With Quote
  #2 (permalink)  
Old 08-10-10, 15:25
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,516
do a search for supertype/subtype -- i believe you are on the right track

well, except for the additional id columns (foodvendorid, etc.) that you are assigning to customers



__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 08-10-10, 15:34
Pukisoft Pukisoft is offline
Registered User
 
Join Date: Jul 2008
Posts: 7
I see it alright, although those address lines seem kind of suspicious. You may have to normalize some tables a little, so I recommend you to read about normalization as well as what r937 told you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On