Hi,
Ok, so custID should only be PK in the customer table.
The difference between userRegistration and the Customer table is the customer table has the person's name, address, email and all contact info.. userRegistration has custID, username, password, signup date, last login ect..
Here is my SQL code for each table:
UserRegistration Table:
CREATE TABLE userRegistration (
custID INT( 5 ) NOT NULL ,
username VARCHAR( 10 ) NOT NULL ,
password VARCHAR( 10 ) NOT NULL ,
info VARCHAR( 30 ) NOT NULL ,
userLevel INT( 2 ) NOT NULL ,
signupDate VARCHAR( 10 ) NOT NULL ,
lastLogin VARCHAR( 10 ) NOT NULL ,
activate INT( 2 ) NOT NULL ,
misc VARCHAR( 10 ) NOT NULL
);
Customer Table:
CREATE TABLE customerInfo (
custID int(5) NOT NULL default '0',
fname varchar(13) NOT NULL default '',
lname varchar(13) NOT NULL default '',
gender char(2) NOT NULL default '',
address varchar(20) NOT NULL default '',
city varchar(14) NOT NULL default '',
stateProv varchar(20) NOT NULL default '',
country varchar(14) NOT NULL default '',
zipPostal varchar(10) NOT NULL default '',
tel varchar(14) NOT NULL default '',
email varchar(20) NOT NULL default '',
contact int(1) NOT NULL default '0',
misc varchar(4) NOT NULL default ''
) TYPE=MyISAM;
Warranty Table:
CREATE TABLE warranty (
custID int(5) NOT NULL auto_increment,
wtyID int(5) NOT NULL default '0',
skuNum int(7) NOT NULL default '0',
batchNum varchar(14) NOT NULL default '',
purchaseDate varchar(20) NOT NULL default '',
date varchar(20) NOT NULL default '',
PRIMARY KEY (custID),
KEY skuNum (skuNum)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
What in your opinion should be the PK in every table?
Also, what i was planning to do is link custID to every custID in both other tables, with Customer being the linking table, would this be a correct approach?
Also, are you saying that custID should ONLY be an auto-increment in the customer table and not the other ones?
Thanks
MK