RE: Table design question
Posted in 1999
Don: Once I worked with a pharmacy system that created a key based on three caracters from the last name, three characters from the first name, a number based on a very simple hashing algoritm based on the full name and for duplicates a sequence number. This approach has multiple benefits. It is likely to be a little bit slow to insert the information, but, for a pharmacy, where inserts are more frequent than on staff (hopefully you get a lot more new clients than new employees) it was reasonable fast. With this approach queries, are simpler and the user does not have to remember a key, you build it at query time. If more than one client matched First and Last name you simply show a pick list and let the user pick the right one. HTH Tino > -----Original Message----- > From: owner-informix-list@iiug.org > [mailto:owner-informix-list@iiug.org]On Behalf Of Don Pritchard > Sent: Friday, March 19, 1999 8:12 AM > To: informix-list@iiug.org > Subject: Table design question > > > Hi All > > I've always battled against this one : > > If you were creating a staff table > > Would you have the following > > staff_id serial > fname char(20) > mname char(20) > lname char(20) > .. > .. > .. > > where obviously staff_id is the primary key > > *or* > > fname char(20) > mname char(20) > lname char(20) > .. > .. > .. > > Where the primary key is a combo of the first 3 fields > > The second is a bigger index but it dispenses with a code field. > > Any thoughts? > > Thanks. > > > > >