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 > Relationships?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-17-04, 09:22
toxi toxi is offline
Registered User
 
Join Date: Mar 2004
Posts: 16
Relationships?

Can you please check my relationships and suggest me any improvements?

thanx
Attached Images
File Type: jpg relationships.jpg (53.9 KB, 129 views)
Reply With Quote
  #2 (permalink)  
Old 03-17-04, 12:01
pinakdb pinakdb is offline
Registered User
 
Join Date: Feb 2004
Posts: 108
Any brief description of requirements will help in understanding this model.
Reply With Quote
  #3 (permalink)  
Old 03-17-04, 12:09
toxi toxi is offline
Registered User
 
Join Date: Mar 2004
Posts: 16
By saying requirements what do you mean?
It's a system for Car sales management....
Basically the relationship I'm mostly not sure of is the one between the SaleItem and TBLservices & TBLCars...I want the user to enter the id of the item sold, but i want it to be taken from 2 different tables....like when someone buys a car, he'll enter the CarID in the same field he'd enter the serviceid if he bought a service...
I hope I managed to explain it
Reply With Quote
  #4 (permalink)  
Old 03-18-04, 14:04
pinakdb pinakdb is offline
Registered User
 
Join Date: Feb 2004
Posts: 108
Yea, services and Car ... what if a customer wants to purchase both - he buys a car and purchases some service plan for the same car. Or already has a car and wants just to purchase some service. (Is it allowed?)
I suggest it should have two entities - both carid and serviceid - preferably optional.
Both are independent of each other.

I assume the payment table is duplicated in the diagram.
Reply With Quote
  #5 (permalink)  
Old 03-19-04, 15:52
toxi toxi is offline
Registered User
 
Join Date: Mar 2004
Posts: 16
I don't wanna do that, because it will not look good when printing reports. I've been told to create an update query for that....
Reply With Quote
  #6 (permalink)  
Old 03-19-04, 16:04
pinakdb pinakdb is offline
Registered User
 
Join Date: Feb 2004
Posts: 108
But how do you distinguish carid from serviceid ?
ok, you have different sequence/series for both ids. But every time you get the id, you'll have to search two different places to determine whether it's a carid or a serviceid.
How will this be done in reports ?
You can have a flag indicating the type of id.
like .. if flag = 'C' then the id belongs to carid
if 'S' then it's a serviceid.

Update query ? Dont' know ...
Reply With Quote
  #7 (permalink)  
Old 04-01-04, 15:33
bobweeks bobweeks is offline
Registered User
 
Join Date: Mar 2004
Posts: 3
Why do you have two tblPayments? They look to be the same.
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