Re: db design questions

2001-07-07 Thread Siomara Pantarotto

My comments are bellow:



Pretty much was Siomara says is the way I think, except that I would have 
made the extra table for the two addresses.

SIO: If you are sure that two addresses are enough for your business then I 
really don't see the reason to put in an extra table. Keeping it simple by 
putting them together with the simple attributes. It won't affect anything, 
and it will avoid extra selects to get this information. It will also avoid 
unnecessary joins.
BUT... if in your business the user will be free to inform more than one 
home address or more than one comercial address and then mark the preferred 
one ...then go for the separated table.
If you are not sure about what your business wants then go for the second 
option. It will provide more flexibility in a long run.


For the kids field it depends on what you want.  If you want to have 
information for each child then you would create a separate table, but if 
you just need to record the number of kids then I think one field in the 
main table would be fine.

SIO: I definetly agree

Also if you have information like you mentioned, gender and marital status, 
instead of making it a char or varchar field with the words Male and Female 
or Married and Single just use a tinyint and make the values 0 or 1.  You 
should either comment somewhere what the 0 and 1 means or actually create 
another table for sex that just has two fields and two records.  0-male, 
and 1-female and same with marital status.

SIO: I would handle gender in the application instead of creating a table 
for it.

Another example of using a second table to store information would be the 
interest checkboxes you'll see on most web pages registration form.  Its a 
list of check boxes that you are supposed to check what interests you have, 
movies, stocks, computers and so on.  For this you would have your main 
table with no interest field, just the rest of your information plus your 
unique id.  A second table (interest_definitions) would have two columns,
interest_id and interest_text. and the third table (interests) would have 
user_id and interest_id.  The interest_definitions would have all the 
possible interests someone can choose and the third table would have a row 
for each interest the user is into.

SIO: I definetly agree specially if you consider that the number of 
interests in table may increase at anytime.

Siomara

Hope that wasn't too long winded. :)

Roger

- Original Message -
From: Siomara Pantarotto [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, July 06, 2001 5:07 PM
Subject: Re: db design questions


  Hi,
 
  Try to keep the simple attributes in one table and the repetitions in
  separated tables
 
  For example:
 
  A person has only one gender, one name, one marital stauts , etc
 
  however a person can have none,one or more than one kid. Create another
  table and create a relationship between both.
 
  I really don't know how many addresses you want to store for each person
but
  if it's not that many. keep them in the same table.
 
  Create fields for streetwork, citywork, ststework, etc...
  and streethome, cityhome, etc...
 
  This allows you to store only one professional and one home adresses.
 
  If you want more than that ...then put them in a separated table as I
  suggested to do for kids
 
  I don't have an example similar to your need but you can take a look at 
my
  website at:
 
  www.geocities.com
 
  and maybe get some ideas from the example I posted there.
 
  click tutorials and team5.com ecommerce sample.
 
  good luck
 
  Siomara
 
 
 
  From: Ed Peddycoart [EMAIL PROTECTED]
  To: MySQL [EMAIL PROTECTED]
  Subject: db design questions
  Date: Fri, 6 Jul 2001 10:25:42 -0700
  
  I am working on a website which will make use of a MySQL database.  I
know
  little if anything about the best way to design my db for efficiency, 
or
  anything else for that matter.  The information which I need to put in
the
  database will be contact/profile information on various people: Name,
  Address, Phone, Email, Marital Status, Spouse, kids, things like that 
and
a
  field for comments submitted from the various people.  Right now I have 
a
  single table with a record for each item I want to store.  Is that an
  acceptable way?
  
  What are some websites which contain some basic information on DB 
design
  etc.  Things such as the best way to structure the db for effiency,
  searches, what do all the terms mean (keys, index etc) etc.
  
  Ed
  
  
  -
  Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
  
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
  [EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

db design questions

2001-07-06 Thread Ed Peddycoart

I am working on a website which will make use of a MySQL database.  I know
little if anything about the best way to design my db for efficiency, or
anything else for that matter.  The information which I need to put in the
database will be contact/profile information on various people: Name,
Address, Phone, Email, Marital Status, Spouse, kids, things like that and a
field for comments submitted from the various people.  Right now I have a
single table with a record for each item I want to store.  Is that an
acceptable way?

What are some websites which contain some basic information on DB design
etc.  Things such as the best way to structure the db for effiency,
searches, what do all the terms mean (keys, index etc) etc.

Ed


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: db design questions

2001-07-06 Thread Siomara Pantarotto

Hi,

Try to keep the simple attributes in one table and the repetitions in 
separated tables

For example:

A person has only one gender, one name, one marital stauts , etc

however a person can have none,one or more than one kid. Create another 
table and create a relationship between both.

I really don't know how many addresses you want to store for each person but 
if it's not that many. keep them in the same table.

Create fields for streetwork, citywork, ststework, etc...
and streethome, cityhome, etc...

This allows you to store only one professional and one home adresses.

If you want more than that ...then put them in a separated table as I 
suggested to do for kids

I don't have an example similar to your need but you can take a look at my 
website at:

www.geocities.com

and maybe get some ideas from the example I posted there.

click tutorials and team5.com ecommerce sample.

good luck

Siomara



From: Ed Peddycoart [EMAIL PROTECTED]
To: MySQL [EMAIL PROTECTED]
Subject: db design questions
Date: Fri, 6 Jul 2001 10:25:42 -0700

I am working on a website which will make use of a MySQL database.  I know
little if anything about the best way to design my db for efficiency, or
anything else for that matter.  The information which I need to put in the
database will be contact/profile information on various people: Name,
Address, Phone, Email, Marital Status, Spouse, kids, things like that and a
field for comments submitted from the various people.  Right now I have a
single table with a record for each item I want to store.  Is that an
acceptable way?

What are some websites which contain some basic information on DB design
etc.  Things such as the best way to structure the db for effiency,
searches, what do all the terms mean (keys, index etc) etc.

Ed


-
Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail 
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: db design questions

2001-07-06 Thread Siomara Pantarotto

sorry I typed my website wrong. The right url is:

www.geocities.com/hisiomara


From: Siomara Pantarotto [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: db design questions
Date: Fri, 06 Jul 2001 18:07:36 -0300

Hi,

Try to keep the simple attributes in one table and the repetitions in
separated tables

For example:

A person has only one gender, one name, one marital stauts , etc

however a person can have none,one or more than one kid. Create another
table and create a relationship between both.

I really don't know how many addresses you want to store for each person 
but
if it's not that many. keep them in the same table.

Create fields for streetwork, citywork, ststework, etc...
and streethome, cityhome, etc...

This allows you to store only one professional and one home adresses.

If you want more than that ...then put them in a separated table as I
suggested to do for kids

I don't have an example similar to your need but you can take a look at my
website at:

www.geocities.com

and maybe get some ideas from the example I posted there.

click tutorials and team5.com ecommerce sample.

good luck

Siomara



From: Ed Peddycoart [EMAIL PROTECTED]
To: MySQL [EMAIL PROTECTED]
Subject: db design questions
Date: Fri, 6 Jul 2001 10:25:42 -0700

I am working on a website which will make use of a MySQL database.  I know
little if anything about the best way to design my db for efficiency, or
anything else for that matter.  The information which I need to put in the
database will be contact/profile information on various people: Name,
Address, Phone, Email, Marital Status, Spouse, kids, things like that and 
a
field for comments submitted from the various people.  Right now I have a
single table with a record for each item I want to store.  Is that an
acceptable way?

What are some websites which contain some basic information on DB design
etc.  Things such as the best way to structure the db for effiency,
searches, what do all the terms mean (keys, index etc) etc.

Ed


-
Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail 
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: db design questions

2001-07-06 Thread Roger Ramirez

Pretty much was Siomara says is the way I think, except that I would have
made the extra table for the two addresses.  For the kids field it depends
on what you want.  If you want to have information for each child then you
would create a separate table, but if you just need to record the number of
kids then I think one field in the main table would be fine.  Also if you
have information like you mentioned, gender and marital status, instead of
making it a char or varchar field with the words Male and Female or Married
and Single just use a tinyint and make the values 0 or 1.  You should either
comment somewhere what the 0 and 1 means or actually create another table
for sex that just has two fields and two records.  0-male, and 1-female and
same with marital status.

Another example of using a second table to store information would be the
interest checkboxes you'll see on most web pages registration form.  Its a
list of check boxes that you are supposed to check what interests you have,
movies, stocks, computers and so on.  For this you would have your main
table with no interest field, just the rest of your information plus your
unique id.  A second table (interest_definitions) would have two columns,
interest_id and interest_text. and the third table (interests) would have
user_id and interest_id.  The interest_definitions would have all the
possible interests someone can choose and the third table would have a row
for each interest the user is into.

Hope that wasn't too long winded. :)

Roger

- Original Message -
From: Siomara Pantarotto [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, July 06, 2001 5:07 PM
Subject: Re: db design questions


 Hi,

 Try to keep the simple attributes in one table and the repetitions in
 separated tables

 For example:

 A person has only one gender, one name, one marital stauts , etc

 however a person can have none,one or more than one kid. Create another
 table and create a relationship between both.

 I really don't know how many addresses you want to store for each person
but
 if it's not that many. keep them in the same table.

 Create fields for streetwork, citywork, ststework, etc...
 and streethome, cityhome, etc...

 This allows you to store only one professional and one home adresses.

 If you want more than that ...then put them in a separated table as I
 suggested to do for kids

 I don't have an example similar to your need but you can take a look at my
 website at:

 www.geocities.com

 and maybe get some ideas from the example I posted there.

 click tutorials and team5.com ecommerce sample.

 good luck

 Siomara



 From: Ed Peddycoart [EMAIL PROTECTED]
 To: MySQL [EMAIL PROTECTED]
 Subject: db design questions
 Date: Fri, 6 Jul 2001 10:25:42 -0700
 
 I am working on a website which will make use of a MySQL database.  I
know
 little if anything about the best way to design my db for efficiency, or
 anything else for that matter.  The information which I need to put in
the
 database will be contact/profile information on various people: Name,
 Address, Phone, Email, Marital Status, Spouse, kids, things like that and
a
 field for comments submitted from the various people.  Right now I have a
 single table with a record for each item I want to store.  Is that an
 acceptable way?
 
 What are some websites which contain some basic information on DB design
 etc.  Things such as the best way to structure the db for effiency,
 searches, what do all the terms mean (keys, index etc) etc.
 
 Ed
 
 
 -
 Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 

 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php