You need to add Foreignforeign keys that reference the Primaryprimary keys of the tables they are linked to.
I don't usually do a whole lot with building the actual tables but I know that you are missing the foreign keys.
inIn this Table:
CREATE TABLE `shipping_type` ( `type_of_shipping` VARCHAR(30) NOT NULL DEFAULT '', `price` DOUBLE(6, 2) NOT NULL, `aprox_delivery` INT(11) NOT NULL, PRIMARY KEY (`type_of_shipping`) ) engine=innodb DEFAULT charset=latin1;
type_of_shipping
is not a good primary key here. youYou should have a generic Table ID that is auto incremented and unique, so that each record has a unique idID on that table.
This Tabletable also needs a Table ID Column.column:
CREATE TABLE `state_tax` ( `state_name` VARCHAR(11) NOT NULL DEFAULT '', `sales_tax_rate` DOUBLE(6, 2) NOT NULL, PRIMARY KEY (`state_name`) ) engine=innodb DEFAULT charset=latin1;
evenEven though state_name
will be unique and isn't doubled up when you create the table, you still need a table idID for a table like this. ifIf the table ever grows there is the possibility for duplicates in that column. it'sIt's not good practice to write those two tables the way that you have them.
The Password ColumnPassword
column in your Customers TableCustomers
table needs to be encrypted. This Blog Postblog post looks like it talks about hashing and storing the password.