Attribute | Description |
---|---|
PRIMARY_KEY | Specifies that the column is the primary key for the table. |
AUTO_INCREMENT | Automatically generates an integer value for the column. By default, this value starts at 0 and increments by a value of 1. |
CREATE TABLE customers ( customerID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, emailAddress NOT NULL UNIQUE );
CREATE TABLE customers ( customerID INT NOT NULL AUTO_INCREMENT, emailAddress NOT NULL UNIQUE, PRIMARY KEY(customerID) );
CREATE TABLE orderItems ( orderID INT NOT NULL, productID INT NOT NULL, itemPrice DECIMAL(10,2) NOT NULL, discountAmount DECIMAL(10,2) NOT NULL, quantity INT NOT NULL, PRIMARY KEY (orderID, productID) );