Chapter 03-8-How To Using SQL To Create A MySQL Database
Chapter 03-8-How To Using SQL To Create A MySQL Database
Warning
You should never alter a table or other database object in a
production database without first consulting the DBA.
Warning
You should never drop a table in a production database without
first consulting the DBA, but you probably won’t have the
privileges for doing that.
A statement that…
Creates an index based on a single column
CREATE INDEX customerID
ON orders (customerID);
Creates a unique index
CREATE UNIQUE INDEX emailAddress
ON customers (emailAddress);
Creates an index based on two columns
CREATE UNIQUE INDEX customerIDorderNumber
ON orders (customerID, orderNumber);
Creates an index that’s sorted in descending order
CREATE INDEX orderTotal
ON orders (orderTotal DESC);