| RE: [SQLDownUnder] Table Design (Names) |
- From: Greg Low
- Subject: RE: [SQLDownUnder] Table Design (Names)
- Date: Thu, 07 Sep 2006 19:16:05 -0700
- Follow-Ups:
- RE: [SQLDownUnder] Table Design (Names), Bill McCarthy
- References:
- Prev by Date: RE: [SQLDownUnder] Table Design
- Next by Date: RE: [SQLDownUnder] Table Design (Names)
- Previous by thread: RE: [SQLDownUnder] Table Design (Names)
- Next by thread: RE: [SQLDownUnder] Table Design (Names)
- Index(es):
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
Most Australian anti-discrimination documents say that
rather than first/last names, you should use:
FamilyName (not required - some people only have one
name)
GivenNames (required)
Based
on that, you can't then decide how to create a FullName so I normally prefer to
store that as well.
I
notice on the Virgin Blue Velocity site, they also asked what you liked to be
called and they store that too. I think that's a nice touch as well. (Not
even my mum calls me Gregory any more but lots of letters from companies do
:-( )
Regards, Greg Dr
Greg Low
From: SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx [mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of sql@xxxxxxxxxxx Sent: Friday, 8 September 2006 12:07 PM To: SQLDownUnder@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [SQLDownUnder] Table Design (Names) On the topic of storing
names… what is the best approach in collecting storing and using
names? Two columns, FirstName
and LastName is obviously unsuitable for a application that is
multicultural… My best guest would be
to just store one column FullName, but then there would be some
application logic
required to figure out the format of the name and then pull out first name or
last (family) name or…
middle name? What are your
experiences guys? Jonathon
Kresner From:
SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx
[mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Greg Low Hi
Jake, Couple of thoughts that
might help. It sounds like you're
really trying to model several things into the one table. Whenever you find
yourself adding a column that says "what type of thing this is", you need to
stop and wonder whether it should be a separate table. In your case, it's hard
to know how many columns are common to all contacts but rather than having
everyone as a contact and then trying to subdivide the contacts, you might
consider storing the appropriate columns for each type of contact in a
separate table. Then when you need a list of contacts, you just grab them out of
all the required tables using a union statement. Also, consider how you
would "compute" a display name from a Last Name and First Name. By "last name"
are you thinking of the person's surname or are you really talking about their
"last" name? Would what you have in mind work for people who's family names come
first and their given names are last? HTH, Greg Dr
Greg Low
From:
SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx
[mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jake Ginnivan Hi all, Was wondering if you could help me
with my table design for a small CRM I have running at work, I don’t think it is
the best way to do it but I don’t know how else I would do
it. I want to have 3 types of entries,
Individuals, Companies and Contacts. Contacts are individuals that are entered
under a company. At the moment I have something like
this. Id, Type (int 0 for company, 1 for
individual, 2 for contact), Display Name (what will be displayed
in crm, either business name, or individual name depending on type, this is a
computed column which is persistent) Company, Firstname Lastname And a few other things, email
address/phone numbers are stored in related tables. My problem is that when I query for
the data, I exclude type 2, they are displayed below when a company is selected.
But I want the company related to the contact to be displayed if that record
matches the search terms. What I want to be able to do is all
entries of type 2 that are matched, add the company entry to the results, then
at the end remove all duplicates, I can see this is a extremely inefficient way
to do it (if possible), so if anyone can help me with the Table design I would
greatly appreciate it. Jake
Ginnivan to unsubscribe to this list, please send a message back
to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List
managed by http://www.readify.net |
(Click here for more information on the sqldownunder mailling list)
