mysql> SELECT * FROM xodimlar right JOIN qismlar ON xodimlar.xodim_id = qismlar.qism_id union
SELECT * FROM xodimlar left JOIN qismlar ON xodimlar.xodim_id = qismlar.qism_id;
+----------+-------------+--------------+------------------+---------+--------------------+------------------+---------+---
---------------+-------------------------------------------------------------------+---------------+-----------------+--------
-----------+
| xodim_id | ism | familiya | ishga_kirgan_yil | maosh | lavozim | ish vaqti (soat) | qism_id |
qism_nomi | qism_vazifasi | xodimlar_soni | mashinalar_soni |
nazoratchi_xodim |
+----------+-------------+--------------+------------------+---------+--------------------+------------------+---------+---
---------------+-------------------------------------------------------------------+---------------+-----------------+--------
-----------+
| 1 | Islomjon | Ismoilov | 2017 | 5000000 | direktor | 8 | 1 | Buxa nka non
sexi | Buxanka non, qora non, baton, kabi maxsulotlarni ishlab chiqarish | 12 | 6 | Behruz
Keldiyev |
| 2 | Otabek | Tursunov | 2017 | 2500000 | sifat nazoratchisi | 8 | 2 | Pech eniye
sexi | Pecheniye maxsulotlarni ishlab chiqarish | 12 | 6 | Behruz Keldiyev |
| 3 | Akmaljon | Nosiraliyev | 2017 | 2500000 | sifat nazoratchisi | 8 | 3 | Pish iriq
sexi | Tort, keks, pirog, kabi maxsulotlarni ishlab chiqarish | 14 | 7 | Abduvohid
Komilov |
| 4 | Behruz | Keldiyev | 2017 | 2200000 | ishchi xodim | 8 | 4 | Pish irish
pechi | Barcha sexlardan chiqqan maxsulotlarni pishirish | 18 | 9 | Abduvohid
Komilov |
| 5 | Abduvohid | Komilov | 2017 | 2200000 | ishchi xodim | 8 | NULL |
NULL | NULL
| NULL | NULL | NULL |
| 6 | Shahriyor | Abdulhamidov | 2017 | 2000000 | mexanik | 8 | NULL |
NULL | NULL
| NULL | NULL | NULL |
| 7 | Nodirbek | Mahamadjonov | 2017 | 2000000 | mexanik | 8 | NULL |
NULL | NULL
| NULL | NULL | NULL |
| 8 | MuhammadAli | Rayimjonov | 2017 | 3000000 | nazoratchi | 8 | NULL |
NULL | NULL
| NULL | NULL | NULL |
+----------+-------------+--------------+------------------+---------+--------------------+------------------+---------+---
---------------+-------------------------------------------------------------------+---------------+-----------------+--------
-----------+
8 rows in set (0.00 sec)
Dostları ilə paylaş: