Another design question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Another design question

Post by Luke »

I have a pretty long list of rows for a particular table...

Code: Select all

business_id   	int(11)  	   	   	Yes   	NULL   	auto_increment   	  Change   	  Drop   	  Primary   	  Index   	  Unique   	 Fulltext
	 name  	varchar(50) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 owner  	varchar(50) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 contact_name  	varchar(50) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 contact_title  	varchar(25) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 address1  	varchar(50) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 address2  	varchar(50) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 city  	varchar(25) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 state  	varchar(2) 	latin1_swedish_ci 	  	Yes  	CA  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 zip  	int(9) 	  	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 phone  	int(10) 	  	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 alt_phone  	int(10) 	  	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 fax  	int(10) 	  	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 email  	varchar(50) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 website  	varchar(100) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 description_short  	tinytext 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 description  	text 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 season  	varchar(30) 	latin1_swedish_ci 	  	Yes  	NULL  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 hours  	varchar(100) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 directions  	varchar(255) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 created  	varchar(15) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 modified  	varchar(15) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 suspended  	varchar(15) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 county  	varchar(10) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 corridor_id  	tinyint(4) 	  	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 type  	varchar(50) 	latin1_swedish_ci 	  	Yes  	  	  	Change 	Drop 	Primary 	Index 	Unique 	Fulltext
	 interests
Is there any reason to split this into more than one table?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

can these businesses have multiple addresses? multiple contacts? multiple fax, phone, email or websites?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Just because there is a lot of data related to a row doesn't mean that the table needs to be split. I usually split tables when there is a potential for some of the data to be different for the same record id.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

feyd wrote:can these businesses have multiple addresses? multiple contacts? multiple fax, phone, email or websites?
no, I don't think so...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Then I see no reason to break it apart with the information given thus far.
Post Reply