Code:
CREATE TABLE IF NOT EXISTS `orderdetails` (
`DetailsID` int(11) NOT NULL AUTO_INCREMENT,
`DetailOrderID` int(11) DEFAULT NULL,
`DetailProductID` int(11) DEFAULT NULL,
`DetailProductName` varchar(50) DEFAULT NULL,
`DetailProductDesc` varchar(255) DEFAULT NULL,
`DetailQuantity` int(11) DEFAULT NULL,
`DetailPrice` decimal(6,2) DEFAULT NULL,
PRIMARY KEY (`DetailsID`),
KEY `DetailOrderID` (`DetailOrderID`),
KEY `DetailProductID` (`DetailProductID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE IF NOT EXISTS `orders` (
`OrderID` int(10) NOT NULL AUTO_INCREMENT COMMENT 'Unique record ID - the Primary key',
`OrderReferenceID` varchar(50) DEFAULT NULL COMMENT 'Internal Tracking number - defined as text to allow alphanumeric entry',
`OrderUserID` int(10) DEFAULT NULL COMMENT 'Foreign key for Visitors table',
`OrderShipping` decimal(19,2) DEFAULT NULL COMMENT 'Shipping cost for order',
`OrderTax` decimal(19,2) DEFAULT NULL COMMENT 'Tax charge for order',
`OrderTotal` decimal(19,2) DEFAULT NULL COMMENT 'Total for order',
`OrderDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Date when order was placed; defaults to Current_Timestamp function',
`OrderStatus` int(11) NOT NULL,
`OrderShipAddress1` varchar(50) DEFAULT NULL COMMENT 'First address line for shipping',
`OrderShipAddress2` varchar(50) DEFAULT NULL COMMENT 'Second address line for shipping',
`OrderShipCity` varchar(50) DEFAULT NULL COMMENT 'City of shipping address',
`OrderShipStateID` int(10) DEFAULT NULL COMMENT 'Foreign key for States_Provinces table',
`OrderShipZip` varchar(50) DEFAULT NULL COMMENT 'Zip or postal code of shipping address',
`OrderShipCountryID` int(10) DEFAULT NULL COMMENT 'Foreign key for Countries table',
KEY `OrderID` (`OrderID`),
KEY `OrderReferenceID` (`OrderReferenceID`),
KEY `OrderShipCountryID` (`OrderShipCountryID`),
KEY `OrderUserID` (`OrderUserID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE IF NOT EXISTS `products` (
`ProdID` int(11) NOT NULL AUTO_INCREMENT,
`ProdBrandID` int(11) DEFAULT NULL,
`ProdName` varchar(255) DEFAULT NULL,
`ProdShortDesc` varchar(255) DEFAULT NULL,
`ProdLongDesc` mediumtext,
`ProdKeywords` mediumtext,
`ProdPrice` decimal(6,2) DEFAULT NULL,
`ProdRRP` decimal(6,2) DEFAULT NULL,
`ProdSKU` varchar(255) DEFAULT NULL,
`ProdThumb` varchar(255) DEFAULT NULL,
`ProdImage` varchar(255) DEFAULT NULL,
`ProdImageAlt` varchar(64) DEFAULT NULL,
`ProdCatID` int(11) DEFAULT NULL,
`ProdIsFeatured` int(11) DEFAULT NULL,
PRIMARY KEY (`ProdID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=34 ;
Bookmarks