laika222
10/26/2016 - 10:56 PM

Creates table Customers2, includes CustomerID which is an integer that auto-increments. Line 12 makes CustomerID the Primary Key. Line 11 ma

Creates table Customers2, includes CustomerID which is an integer that auto-increments. Line 12 makes CustomerID the Primary Key. Line 11 makes a timestamp which is updated each time the row is updated.

CREATE TABLE Customers (
CustomerID INT AUTO_INCREMENT,
LastName VARCHAR(30),
FirstName VARCHAR(30),
Address VARCHAR(40),
City VARCHAR(30),
State CHAR(2),
PostalCode INT(5),
Country VARCHAR(30),
LifetimeValue INT,
LoyaltyNo INT,
AltName VARCHAR(30),
Modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (CustomerID)
);