Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL database construction

Status
Not open for further replies.

ITGL72

MIS
Jul 2, 2001
105
US
I'd like to request from someone with more experience then me in MySQL database construction a few recommendations. I have in the past done some cold fusion basic programming (very basic!) and did some very basic work with Access and SQL7 server databases. I am working on a project now that is with a MySQL DB. Its my first experience with it. Thank goodness this web host installed phpadmin.

Below is the code of a template DB I am setting up on the server. Any recommendations, best practices, tips on a DB like the one listed below would be greatly appreciated. If you see anything that's not good, please point it out.

Do I have the correct DATA TYPES for the PHONE NUMBER, ZIP CODE, DATES fields? etc...





CREATE TABLE template (
ID int(6) DEFAULT '0' NOT NULL auto_increment,
SIC varchar(15) DEFAULT '0',
FIRSTNAME varchar(15) DEFAULT '0',
LASTNAME varchar(15) DEFAULT '0',
CONTACT varchar(30) DEFAULT '0',
COMPANY varchar(30) DEFAULT '0',
MADDR1 varchar(25) DEFAULT '0',
MADDR2 varchar(25) DEFAULT '0',
MCITY varchar(20) DEFAULT '0',
MSTATE char(3) DEFAULT '0',
MZIP int(10) DEFAULT '0',
SADDR1 varchar(25) DEFAULT '0',
SADDR2 varchar(25) DEFAULT '0',
SCITY varchar(20) DEFAULT '0',
SSTATE char(3) DEFAULT '0',
SZIP int(10) DEFAULT '0',
COUNTY varchar(20) DEFAULT '0',
EMAIL varchar(35) DEFAULT '0',
DEMAIL char(3) DEFAULT '0',
URL varchar(35) DEFAULT '0' NOT NULL,
DURL char(3) DEFAULT '0' NOT NULL,
TITLE varchar(15) DEFAULT '0' NOT NULL,
SPOUSENAME varchar(15) DEFAULT '0' NOT NULL,
SOURCE varchar(15) DEFAULT '0' NOT NULL,
DAYPHONE int(12) DEFAULT '0' NOT NULL,
NIGHTPHONE int(12) DEFAULT '0' NOT NULL,
TOLLFREE int(12) DEFAULT '0' NOT NULL,
FAX int(12) DEFAULT '0' NOT NULL,
MOBILE int(12) DEFAULT '0' NOT NULL,
FUPDATE date DEFAULT '0000-00-00' NOT NULL,
RENEWDATE date DEFAULT '0000-00-00' NOT NULL,
SLSPSNCODE char(3) DEFAULT '0' NOT NULL,
ENTRYDATE date DEFAULT '0000-00-00' NOT NULL,
LUPDATEDDATE date DEFAULT '0000-00-00' NOT NULL,
PRIMARY KEY (ID),
KEY ID (ID)
);



Your contribution to thi thread would be GREATLY appreciated by myself. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top