Select bolim id, ism from hodimlar where bolim id=



Download 3,22 Kb.
Sana11.01.2022
Hajmi3,22 Kb.
#341637
Bog'liq
17-18-19-20




17-18-loborotoriiya

mysql> select bolim_id, ism from hodimlar where bolim_id=(select id from bolimlar where bolim_nomi='savdo');

+----------+------+

| bolim_id | ism |

+----------+------+

| 2 | Aziz |

+----------+------+

1 row in set (0.00 sec)

19-loborotoriya

mysql> use loyixa;

Database changed

mysql> show tables;

+------------------+

| Tables_in_loyixa |

+------------------+

| bolimlar |

| hodimlar |

| loyixa_ishlari |

| savdolar |

| shartnomalar |

| shertnomalar_2 |

| tashkilotlar |

+------------------+

7 rows in set (0.41 sec)

mysql> select*from hodimlar;

+----------+--------+---------------+-----------+----------+-------+----------+---------------+

| Fam | Ism | Ota_ism | lavozim | bolim_id | jinsi | manzil | tugulgan_sana |

+----------+--------+---------------+-----------+----------+-------+----------+---------------+

| axrorov | jasur | qahhorovich | ishchi | 1 | erkak | Andijon | 2017-03-20 |

| mansurov | Aziz | Anvarovich | savdogar | 2 | erkak | Andijon | 2027-03-20 |

| Toxirov | oydin | Boburjon qizi | dasturchi | 3 | ayol | fargona | 1994-06-20 |

| azizov | Qahhor | Valiyevich | dastavka | 4 | erkak | namangan | 1996-06-14 |

+----------+--------+---------------+-----------+----------+-------+----------+---------------+

4 rows in set (0.13 sec)

mysql> creat index shaxslar on hodimlar(Fam, ism);

Query OK, 4 rows affected (0.67 sec)

Records: 4 Duplicates: 0 Warnings: 0

mysql> show index from hodimlar;

+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+

| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |

+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+

| hodimlar | 1 | bolim_id | 1 | bolim_id | A | 2 | NULL | NULL | | BTREE | |

| hodimlar | 1 | shaxslar | 1 | Fam | A | 2 | NULL | NULL | YES | BTREE | |

| hodimlar | 1 | shaxslar | 2 | Ism | A | 2 | NULL | NULL | YES | BTREE | |

+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+

3 rows in set (0.03 sec)

mysql> alter table hodimlar drop index shaxslar;

Query OK, 4 rows affected (0.28 sec)

Records: 4 Duplicates: 0 Warnings: 0

mysql> show index from hodimlar;

+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+

| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |

+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+

| hodimlar | 1 | bolim_id | 1 | bolim_id | A | 2 | NULL | NULL | | BTREE | |

+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+

1 row in set (0.00 sec)

mysql>


Download 3,22 Kb.

Do'stlaringiz bilan baham:




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish