শো ইনডেক্স, শো ইনডেক্স এবং শো কী এর মধ্যে কোন পার্থক্য নেই। তাদের একই অর্থ আছে।
আসুন প্রথমে একটি টেবিল তৈরি করি -
mysql> create table DemoTable1549 -> ( -> EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> EmployeeName varchar(20) -> ); Query OK, 0 rows affected (0.82 sec)
−
একটি সূচক তৈরি করার জন্য নিচের প্রশ্নটি রয়েছে DemoTable1549(EmployeeName) এmysql> create index name_index1 on DemoTable1549(EmployeeName); Query OK, 0 rows affected (0.41 sec) Records: 0 Duplicates: 0 Warnings: 0
সূচী প্রদর্শন −
-এর জন্য নিচের প্রশ্নটি রয়েছে DemoTable1549 থেকেmysql> show index from DemoTable1549;
এটি নিম্নলিখিত আউটপুট −
তৈরি করবে+---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | +---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | demotable1549 | 0 | PRIMARY | 1 | EmployeeId | A | 0 | NULL | NULL | | BTREE | | | YES | | demotable1549 | 1 | name_index1 | 1 | EmployeeName | A | 0 | NULL | NULL | YES | BTREE | | | YES | +---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ 2 rows in set (0.17 sec)
এখানে সূচী প্রদর্শনের জন্য ক্যোয়ারী আছে -
mysql> show indexes from DemoTable1549;
এটি নিম্নলিখিত আউটপুট −
তৈরি করবে+---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | +---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | demotable1549 | 0 | PRIMARY | 1 | EmployeeId | A | 0 | NULL | NULL | | BTREE | | | YES | | demotable1549 | 1 | name_index1 | 1 | EmployeeName | A | 0 | NULL | NULL | YES | BTREE | | | YES | +---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ 2 rows in set (0.00 sec)
এখানে SHOW KYS -
বাস্তবায়নের জন্য প্রশ্ন রয়েছেmysql> show keys from DemoTable1549;
এটি নিম্নলিখিত আউটপুট −
তৈরি করবে+---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | +---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | demotable1549 | 0 | PRIMARY | 1 | EmployeeId | A | 0 | NULL | NULL | | BTREE | | | YES | | demotable1549 | 1 | name_index1 | 1 | EmployeeName | A | 0 | NULL | NULL | YES | BTREE | | | YES | +---------------+------------+-------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ 2 rows in set (0.00 sec)