1. Har bir talaba o’ziga berilgan predmet soha mavzusi bo’yicha and, or


Har bir talaba o’ziga berilgan predmet soha mavzusi bo’yicha WHERE


Download 432.03 Kb.
Pdf ko'rish
bet2/6
Sana18.12.2022
Hajmi432.03 Kb.
#1027742
1   2   3   4   5   6
Bog'liq
2 - dedline

2. Har bir talaba o’ziga berilgan predmet soha mavzusi bo’yicha WHERE, 
IN, BETWEEN, LIKE operatorlaridan foydalanib so’rovlar yaratishi va 
natijasi bilan ko’rsatib o’tishi kerak. 
 
mysql> SELECT * FROM 
oqituvchilar 
WHERE `lavozim`='mexanik'; 
+----------+-----------+--------------+------------------+---------+---------+------------------+ 
| xodim_id | ism | familiya | ishga_kirgan_yil | maosh | lavozim | ish vaqti (soat) | 
+----------+-----------+--------------+------------------+---------+---------+------------------+ 
| 6 | Shoxruh | Jabborov | 2017 | 2000000 | mexanik | 8 | 
| 7 | Asror | Mahamadjonov | 2017 | 2000000 | mexanik | 8 | 
+----------+-----------+--------------+------------------+---------+---------+------------------+ 
2 rows in set (0.00 sec) 
3. Har bir talaba o’ziga berilgan predmet soha mavzusi bo’yicha Order by
Group by operatorlaridan foydalanib so’rovlar yaratishi va natijasi bilan 
ko’rsatib o’tishi kerak. 
mysql> SELECT * FROM oqituvchilar ORDER BY maosh; 
+----------+-------------+--------------+------------------+---------+--------------------+------------------+ 
| xodim_id | ism | familiya | ishga_kirgan_yil | maosh | lavozim | ish vaqti (soat) | 
+----------+-------------+--------------+------------------+---------+--------------------+------------------+ 
| 6 | 
Shoxruh 

Jabborov 
| 2017 | 2000000 | mexanik | 8 | 
| 7 | Aror | Mahamadjonov | 2017 | 2000000 | mexanik | 8 | 
| 4 | Behruz | Boriyev | 2017 | 2200000 | ishchi xodim | 8 | 
| 5 | Dilshod | Komilov | 2017 | 2200000 | ishchi xodim | 8 | 
| 2 | Otabek | Xaydarov | 2017 | 2500000 | sifat nazoratchisi | 8 | 


| 3 | Xatamjon | Nosiraliyev | 2017 | 2500000 | sifat nazoratchisi | 8 | 
| 1 | Muhammadali | Raimjonov | 2017 | 5000000 | direktor | 8 | 
+----------+-------------+--------------+------------------+---------+--------------------+------------------+ 
8 rows in set (0.00 sec) 
mysql> SELECT COUNT(xodim_id), lavozim FROM 
oqituvchilar 
GROUP BY lavozim
+-----------------+--------------------+ 
| COUNT(xodim_id) | lavozim | 
+-----------------+--------------------+ 
| 1 | direktor | 
| 2 | sifat nazoratchisi | 
| 2 | ishchi xodim | 
| 2 | mexanik | 
| 1 | nazoratchi | 
+-----------------+--------------------+ 
5 rows in set (0.00 sec) 

Download 432.03 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6




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