Creating a Table with an Index : Create Table : Table MySQL TUTORIALS


MySQL TUTORIALS » Table » Create Table »

 

Creating a Table with an Index


mysql>
mysql> CREATE TABLE myTable
    -> (
    ->    ID SMALLINT UNSIGNED NOT NULL,
    ->    Name        VARCHAR(40NOT NULL,
    ->    INDEX (Name)
    -> );
Query OK, rows affected (0.01 sec)

mysql>
mysql>
mysql> desc myTable;
+-------+----------------------+------+-----+---------+-------+
| Field | Type                 | Null | Key | Default | Extra |
+-------+----------------------+------+-----+---------+-------+
| ID    | smallint(5unsigned | NO   |     |         |       |
| Name  | varchar(40)          | NO   | MUL |         |       |
+-------+----------------------+------+-----+---------+-------+
rows in set (0.02 sec)

mysql>
mysql> drop table myTable;
Query OK, rows affected (0.01 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Table
» Create Table