Gurux talabasi Qambaraliyev Ahliddin 2-deadline


Har bir talaba o’ziga berilgan predmet soha mavzusi bo’yicha AVG, SUM, MIN, MAX, operatoridan foydalanib so’rovlar yaratishi va natijasi bilan ko’rsatib o’tishi kerak


Download 73.76 Kb.
bet5/6
Sana02.06.2024
Hajmi73.76 Kb.
#1835492
1   2   3   4   5   6
Bog'liq
Ahliddin baza

Har bir talaba o’ziga berilgan predmet soha mavzusi bo’yicha AVG, SUM, MIN, MAX, operatoridan foydalanib so’rovlar yaratishi va natijasi bilan ko’rsatib o’tishi kerak.

mysql> select * from kemalar;


+------+------------+-----------+---------------+------------+-----------+--------+-----------------+----------------+---------------+
| id | k_i_raqami | kema_nomi | kema_turi | y_sanasi | ish_vaqti | o_soni | v_qurilmasi | haydovchi_turi | joylashtirish |
+------+------------+-----------+---------------+------------+-----------+--------+-----------------+----------------+---------------+
| 1 | 1 | Arslon | Yuk tashuvchi | 2020-12-12 | 12:12:20 | 25 | yelkan | Tajribali | Kasbiy |
| 2 | 2 | Lochin | Kater | 2021-02-02 | 11:10:30 | 20 | Qutqaruv qayigi | Mutaxasis | Lablador |
| 3 | 3 | Bear | Kuryer | 2022-03-03 | 10:10:10 | 30 | Qayiqlar | Mutaxasis | Shimoliy |
+------+------------+-----------+---------------+------------+-----------+--------+-----------------+----------------+---------------+
3 rows in set (0.00 sec)

mysql> select count(*) as soni


-> ,
-> max(ish_vaqti) as kop_ishlaydi,
-> min(ish_vaqti) as kam_ishlaydi,
-> avg(ish_vaqti) as ortacha_ishlaydigan_xodimlar from kemalar;
+------+--------------+--------------+------------------------------+
| soni | kop_ishlaydi | kam_ishlaydi | ortacha_ishlaydigan_xodimlar |
+------+--------------+--------------+------------------------------+
| 3 | 12:12:20 | 10:10:10 | 111086.6667 |
+------+--------------+--------------+------------------------------+
1 row in set (0.10 sec)

mysql>


  1. Har bir talaba o’ziga berilgan predmet soha mavzusi bo’yicha standart funksiyalardan foydalanib so’rovlar yaratishi va natijasi bilan ko’rsatib o’tishi kerak.

mysql> select monthname(y_sanasi) from kemalar;


+---------------------+
| monthname(y_sanasi) |
+---------------------+
| December |
| February |
| March |
+---------------------+
3 rows in set (0.00 sec)

mysql> select dayname (y_sanasi) from kemalar;


+--------------------+
| dayname (y_sanasi) |
+--------------------+
| Saturday |
| Tuesday |
| Thursday |
+--------------------+
3 rows in set (0.11 sec)

mysql> select monthname(y_sanasi), dayname(y_sanasi) from kemalar;


+---------------------+-------------------+
| monthname(y_sanasi) | dayname(y_sanasi) |
+---------------------+-------------------+
| December | Saturday |
| February | Tuesday |
| March | Thursday |
+---------------------+-------------------+
3 rows in set (0.00 sec)

mysql>



  1. Download 73.76 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