[thelist] addressbook table design [sql]

Atul Paul atul79 at rogers.com
Tue Feb 11 10:03:49 CST 2003


There are a couple of things you can do.
- Even though you're searching by first and last name its a good idea to
create indices on all the appropriate fields, if you choose to query by
those fields at a later date. It won't speed up queries THAT much but its a
good practice nonetheless.
- Create the IDs in such a way that you are easily able to traverse through
the records. I had a problem once where I had to sort and traverse through
the records (in order) by a field (in a PHP app) that was neither a primary
key nor an index. Therefore, I had to work around it at the application
level. Its always better to deal with such issues at the database level. So
keep that in mind and see what you can do in your context.
- Its always good to keep some redundant information in tables and have
them linked as foreign keys. (Or you might even keep the whole table for
backup purposes)

Looking forward to seeing what you come up with. Good Luck.
Atul

At 10:36 PM 10/02/2003 -0400, you wrote:
>I am trying to come up with a table design for an address book.
>Databases haven't been my strong point so I ask here for advice.
>I am trying to design a simple address book, and am ending up
>with a lot of fields in just two tables. Is there a better way
>to go about it and are there any fields I might be missing
>(efficiency, normalization, easy of writing queries)? I
>will be searching the databases by first or last names
>and probably by affiliation (e.g. if they went to the same
>highschool). Here are the two tables:
>
>Persons:        ID,
>                 Fname,
>                 Lname.
>                 Mname,
>                 Bday,
>                 Gender
>
>                 HomePhone1,
>                 HomePhone2,
>                 MobilePhone,
>                 Fax,
>                 PersonalEmail1,
>                 PersonalEmail2,
>                 CorporateEmail,
>                 Website
>
>                 Street1,
>                 Street2,
>                 Postal,
>                 City,
>                 Province,
>                 Country
>
>                 AcademicInstitution,
>                 GraduationDate,
>                 FieldOfStudy,
>                 CurrentProfession,
>                 Hobbies,
>
>Affiliations:   ID,
>                         MyPrimarySchool,
>                         MyHighSchool,
>                         MyUniversity,
>                         Other
>
>
>
>thanks
>
>aleem
>
>[ http://members.evolt.org/aleem/ ]
>
>--
>* * Please support the community that supports you.  * *
>http://evolt.org/help_support_evolt/
>
>For unsubscribe and other options, including the Tip Harvester
>and archives of thelist go to: http://lists.evolt.org
>Workers of the Web, evolt !

My Blog: http://blog.verticalinsanity.com






More information about the thelist mailing list