Choose partial key in table creation : Key : Table MySQL TUTORIALS


MySQL TUTORIALS » Table » Key »

 

Choose partial key in table creation


mysql>
mysql>
mysql> CREATE TABLE Employee (
    ->   last_name VARCHAR(30NOT NULL,
    ->   KEY lastname_idx (last_name(3))
    -> );
Query OK, rows affected (0.03 sec)

mysql>
mysql> SHOW KEYS FROM Employee;
+----------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table    | Non_unique | Key_name     | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+----------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Employee |          | lastname_idx |            | last_name   | A         |        NULL |        | NULL   |      | BTREE      |         |
+----------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
row in set (0.00 sec)

mysql>
mysql> drop table Employee;
Query OK, rows affected (0.02 sec)

mysql>
mysql>



Leave a Comment / Note


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

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Table
» Key