Sql tilida index yaratish. Tasavvur, view yaratish va undan foydalanish


Download 350.21 Kb.
Pdf ko'rish
bet1/3
Sana17.06.2023
Hajmi350.21 Kb.
#1530992
  1   2   3
Bog'liq
SQL tilida INDEX yaratish



SQL tilida INDEX yaratish. Tasavvur, VIEW yaratish va undan 
foydalanish. 
mysql> show indexes from sotuvchilar
+-------------+------------+----------------+--------------+-------------+-----------+-
------------+----------+--------+------+------------+---------+ 
| Table | Non_unique | Key_name | Seq_in_index | Column_name | 
Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | 
+-------------+------------+----------------+--------------+-------------+-----------+-
------------+----------+--------+------+------------+---------+ 
| sotuvchilar | 1 | in_sotuvchilar | 1 | ismi | A | 1 |
NULL | NULL | | BTREE | | 
+-------------+------------+----------------+--------------+-------------+-----------+-
------------+----------+--------+------+------------+---------+ 
1 row in set (0.00 sec) 
select ismi,familyasi from sotuvchilar; 
Query OK, 0 rows affected (0.22 sec) 


mysql> show full tables; mysql> create view oybek 
-> as 
+------------------------------+------------+ 
| Tables_in_dp_savdo_tashkioti | Table_type | 
+------------------------------+------------+ 
| elitp_beruvchi | BASE TABLE | 
| elitp_beruvchlarga_buyurtma | BASE TABLE | 
| imntxonlar | BASE TABLE | 
| oybek | VIEW | 
| savdo_nuqtasi | BASE TABLE | 
| sotuvchilar | BASE TABLE | 
| talabalar | BASE TABLE | 
+------------------------------+------------+ 
7 rows in set (0.00 sec) 
XULOSA 
Index yaratish nimaga kerak ma’lumotlarni izlashda indexdan 
foydalanish eng vaqtni tejash uchun yaxshi variant ekan. Bazamizdagi index 
kitoblarni orqasidagi mundarijaga o’xshaydi, va ma’lumotni topishni tezlashtiradi. 


Localhost 
mysql> use dp_savdo_tashkioti; 
Database changed 
mysql> create user 'oybek'@'localhost'; 
Query OK, 0 rows affected (0.24 sec) 
mysql> select user from mysql.user; 
+-------+ 
| user | 
+-------+ 
| oybek | 
| root | 



Download 350.21 Kb.

Do'stlaringiz bilan baham:
  1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling