Re: Database help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I agree with you. You have also the problem "what will you do if both ID are
empty". Because you have to allow null values to do so. Not good...

I would add tables to do this.

Customers
ID
Type
ForeignKey on Contact or Business (or 2 keys if you prefer, but you can
use the smae key type for both)
Other Datas

Contact
ID
Other Data

Business
ID
Other Data

If you have individuals frome business, you can also add Adress table and
point to the table with a foreign key.

Look like you should use google a little bit and search for Relational
Database.

Ornette.

"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@xxxxxxxxxxxx> wrote in
message news:OFYfsuDdHHA.3960@xxxxxxxxxxxxxxxxxxxxxxx
What will you do if for whatever reason both id fields will have values? I
would prefer having just one id field and a separate field "CustomerType".

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Hayden Kirk kirk mobilepc.co.nz>" <hayden <dot@> wrote in message
news:%23S6sTzCdHHA.2332@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

Having issues designing something in a database. I'm trying to make a
customer table. Problem is I am trying to determin if they are contacts
or busineses.

Like, I want to be able to bill individual clients as well as businesses
but If I do this there will be redundant data.

The solution I came up with was a customer table having two fields.
CustomerID and BusinessID. If the contact has one or the other read from
that table to workout what type of customer they are.

Is this the best way of doing it?





.



Relevant Pages

  • Re: boolean datatype ... wtf?
    ... It is my conviction that a database should be modeled to ... lot of commercial mailings go to only the natural persons, ... an attribute to store whether a customer is a natural person. ... person" or "business" as its domain. ...
    (comp.databases.theory)
  • Re: What problems are people in the MV world trying to solve
    ... This is a combination of business and technical. ... system is centered around a customer account and the ID assigned to it so ... contact files by account ID. ... The sales analysis system only ...
    (comp.databases.pick)
  • Re: My Frustrations
    ... Again, this is not an issue of communication, or geeks versus business men. ... This is not an issue of proving or demonstrating the quality of ones self or service. ... This is an issue of enabling the customer to make the right decision. ... landing the customer in a very poor security state, ...
    (Pen-Test)
  • Re: boolean datatype ... wtf?
    ... It is my conviction that a database should be modeled to ... lot of commercial mailings go to only the natural persons, ... an attribute to store whether a customer is a natural person. ... person" or "business" as its domain. ...
    (comp.databases.theory)
  • Re: OOP/OOD Philosophy
    ... between database logic and "business" logic. ... this would not longer be "business" ... tomorrow be regarded as low-level data access logic. ...
    (comp.object)