Hi,
I'm working on a project that is going to require a member database, along with keeping some information relative to each member. It is going to be for a community, trading site, where the user's will be able to communicate, have a profile page, etc.
I've tried to normalize the tables as best as possible, taking into consideration performance, and what data is usually grouped together in queries. For instance, if I see where a table could be broken into three parts, but I will never query the data individually, it will always come as a whole, I typically left the table together, rather than break it apart and have to do joins everytime. Not only that, it creates extra columns because each smaller table would require its own id and a column for the parent id.
I've create generic table designs, where I simply name the column and its datatype. I've already built alot of code around this table structure, but before I move any further I want to take another look at what I'm doing. It will be easy for me to mod my code at this point. If you have any advice or ideas on how you might approach collecting the data below, please by all means speak up! I'll be very appreciative. Ask questions, challenge my logic.
I have much functionality working around this structure, but before I launch the site, I want to make sure its as good as can be. Like I said, i made all the functions work, so if I just need to rearrange some things, make some changes, it won't be a big deal. Please advise.
tbl_member_core
member_id (int-identity-pk)
user_name (varchar-30)
type (varchar-16)
status (varchar-16)
status_memo (varchar-128-null)
password (varchar-24)
password_hint (varchar-24)
created (datetime)
created_ip (varchar-15)
last_modified (datetime-null)
last_modified_ip (varchar-15-null)
cancel_datetime (datetime-null)
cancel_ip (varchar-15-null)
tbl_member_contact
contact_id (int-identity-pk)
member_id (int-fk)
organization (varchar-50-null)
first_name (varchar-50)
last_name (varchar-50)
middle_initial (varchar-1-null)
street (varchar-50-null)
apartment (varchar-30-null)
city (nvarchar-50-null)
state (varchar-50-null)
country (varchar-50)
zip (varchar-16-null)
phone_number_a (varchar-20-null)
phone_number_a_type (varchar-16-null)
phone_number_b (varchar-20-null)
phone_number_b_type (varchar-16-null)
fax_number (varchar-20-null)
email_a (varchar-50)
email_b (varchar-50-null)
contact_last_modified (datetime-null)
contact_last_modified_ip (varchar-15-null)
tbl_member_profiles
profile_id (int_identity-pk)
member_id (int-fk)
profile_headline (nvarchar-45-null)
profile_shortline_a (nvarchar-25-null)
profile_shortline_b (nvarchar-25-null)
profile_shortline_c (nvarchar-25-null)
sex (varchar-12-null)
birthday (smalldatetime-null)
marital_status (varchar-12-null)
religion (varchar-25)
ethnicity (varchar-25)
here_for_trading (bit-null)
here_for_dating (bit-null)
here_for_friends (bit-null)
here_for_networking (bit-null)
here_for_serious_relationships (bit-null)
children (bit-null)
smoke (bit-null)
drink (bit-null)
sexual_orientation (bit-null)
sign (bit-null)
home_town (nvarchar-50-null)
home_state (nvarchar-50-null)
home_country (varchar-50-null)
height_feet (smallint-null)
height_inches (smallint-null)
body_type (varchar-25-null)
computer (varchar-25-null)
education (varchar-25-null)
occupation (varchar-25-null)
income (varchar-25-null)
favoriteweb_a (nvarchar-255-null)
favoriteweb_b (nvarchar-255-null)
favoriteweb_c (nvarchar-255-null)
phone_number_a_show (bit)
phone_number_b_show (bit)
location_show (bit-null)
homepage_db_list (bit)
ad_show (bit)
homepage_show (bit)
homepage_last_modified (datetime-null)
homepage_last_modified_ip (varchar-15-null)
last_login (datetime)
tbl_member_events
event_id (int-identity-pk)
member_id (int-fk)
event_time (datetime)
event_ip (varchar-16)
event_class (varchar-25)
event_type (varchar-50)
event_title (varchar-50)
event_description (varchar-500)
I'm working on a project that is going to require a member database, along with keeping some information relative to each member. It is going to be for a community, trading site, where the user's will be able to communicate, have a profile page, etc.
I've tried to normalize the tables as best as possible, taking into consideration performance, and what data is usually grouped together in queries. For instance, if I see where a table could be broken into three parts, but I will never query the data individually, it will always come as a whole, I typically left the table together, rather than break it apart and have to do joins everytime. Not only that, it creates extra columns because each smaller table would require its own id and a column for the parent id.
I've create generic table designs, where I simply name the column and its datatype. I've already built alot of code around this table structure, but before I move any further I want to take another look at what I'm doing. It will be easy for me to mod my code at this point. If you have any advice or ideas on how you might approach collecting the data below, please by all means speak up! I'll be very appreciative. Ask questions, challenge my logic.
I have much functionality working around this structure, but before I launch the site, I want to make sure its as good as can be. Like I said, i made all the functions work, so if I just need to rearrange some things, make some changes, it won't be a big deal. Please advise.
tbl_member_core
member_id (int-identity-pk)
user_name (varchar-30)
type (varchar-16)
status (varchar-16)
status_memo (varchar-128-null)
password (varchar-24)
password_hint (varchar-24)
created (datetime)
created_ip (varchar-15)
last_modified (datetime-null)
last_modified_ip (varchar-15-null)
cancel_datetime (datetime-null)
cancel_ip (varchar-15-null)
tbl_member_contact
contact_id (int-identity-pk)
member_id (int-fk)
organization (varchar-50-null)
first_name (varchar-50)
last_name (varchar-50)
middle_initial (varchar-1-null)
street (varchar-50-null)
apartment (varchar-30-null)
city (nvarchar-50-null)
state (varchar-50-null)
country (varchar-50)
zip (varchar-16-null)
phone_number_a (varchar-20-null)
phone_number_a_type (varchar-16-null)
phone_number_b (varchar-20-null)
phone_number_b_type (varchar-16-null)
fax_number (varchar-20-null)
email_a (varchar-50)
email_b (varchar-50-null)
contact_last_modified (datetime-null)
contact_last_modified_ip (varchar-15-null)
tbl_member_profiles
profile_id (int_identity-pk)
member_id (int-fk)
profile_headline (nvarchar-45-null)
profile_shortline_a (nvarchar-25-null)
profile_shortline_b (nvarchar-25-null)
profile_shortline_c (nvarchar-25-null)
sex (varchar-12-null)
birthday (smalldatetime-null)
marital_status (varchar-12-null)
religion (varchar-25)
ethnicity (varchar-25)
here_for_trading (bit-null)
here_for_dating (bit-null)
here_for_friends (bit-null)
here_for_networking (bit-null)
here_for_serious_relationships (bit-null)
children (bit-null)
smoke (bit-null)
drink (bit-null)
sexual_orientation (bit-null)
sign (bit-null)
home_town (nvarchar-50-null)
home_state (nvarchar-50-null)
home_country (varchar-50-null)
height_feet (smallint-null)
height_inches (smallint-null)
body_type (varchar-25-null)
computer (varchar-25-null)
education (varchar-25-null)
occupation (varchar-25-null)
income (varchar-25-null)
favoriteweb_a (nvarchar-255-null)
favoriteweb_b (nvarchar-255-null)
favoriteweb_c (nvarchar-255-null)
phone_number_a_show (bit)
phone_number_b_show (bit)
location_show (bit-null)
homepage_db_list (bit)
ad_show (bit)
homepage_show (bit)
homepage_last_modified (datetime-null)
homepage_last_modified_ip (varchar-15-null)
last_login (datetime)
tbl_member_events
event_id (int-identity-pk)
member_id (int-fk)
event_time (datetime)
event_ip (varchar-16)
event_class (varchar-25)
event_type (varchar-50)
event_title (varchar-50)
event_description (varchar-500)
