• So’rov: Select id as ‘7 kop oqilgan kitoblar’ , count(oqilgan_kitoblar_soni) as ‘kitoblar soni’ from faollar group by id having count(oqilgan_kitoblar_soni)>7; N at
  • So’rov: Select count(*) as ‘kitob turlari’ from faollar; N at i j a: 11.7– rasm. Count()
  • Rand()
  • 11.9– rasm. Round()
  • So`rov:Select id, sqrt(id) from mutolachi; N at i j a: 11.11– rasm. Sqrt()
  • So`rov: Select max(id) as ‘eng oxirida turgan mutolachi’ from mutolachi




    Download 15,05 Mb.
    bet17/19
    Sana16.05.2024
    Hajmi15,05 Mb.
    #237968
    1   ...   11   12   13   14   15   16   17   18   19
    Bog'liq
    mal.B.2-ish

    So`rov: Select max(id) as ‘eng oxirida turgan mutolachi’ from mutolachi;
    Natija:

    11.5– rasm. Max() agregat funksiyasidan foydalanib, oxirgi Idni aniqlash
    5. COUNT() – Ustundagi qatorlar sonini sanaydi.
    a) Ikki va undan xodimlar ishlaydigan qurilmalar chiqarilsin.
    So’rov: Select id as ‘7 kop oqilgan kitoblar’ , count(oqilgan_kitoblar_soni) as ‘kitoblar soni’ from faollar group by id having count(oqilgan_kitoblar_soni)>7;

    Natija:

    11.6– rasm. Count() agregat funksiyasidan foydalanish
    b) “xodimlar” jadvalidagi xodimlar sonini aniqlaymiz.
    So’rov: Select count(*) as ‘kitob turlari’ from faollar;
    Natija:

    11.7– rasm. Count() agregat funksiyasi orqali qurilmalar sonini aniqlash
    Bu funksiyalarga qo`shimcha ravishda quyidagi funksiyalarni ham ko`rib chiqamiz:

    1. Rand() - tasodifiy son.

    So’rov: Select id,FISH, rand(id) from mutolachi;
    Natija:

    11.8– rasm. Rand() funksiyasidan foydalanish
    7. ROUND() - Butun sonni yaxlitlash funktsiyasi.
    So`rov: Select id, FISH, round(oqilgan_kitoblar_soni/id, 3) from mutolachi;
    Natija:

    11.9– rasm. Round() funksiyasidan foydalanish

    8. POWER() - Sonning darajasini hisoblash.


    Select id, oqilgan_kitoblar_soni, power(oqilgan_kitoblar_soni, id) from faollar;
    Natija:

    11.10– rasm. Power() funksiyasidan foydalanish
    9. SQRT() - Sonning kvadrat ildizini topish.
    So`rov:Select id, sqrt(id) from mutolachi;

    Natija:

    11.11– rasm. Sqrt() funksiyasidan foydalanish
    10. SIN() - Ifoda sinusini hisoblash.

    Download 15,05 Mb.
    1   ...   11   12   13   14   15   16   17   18   19




    Download 15,05 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    So`rov: Select max(id) as ‘eng oxirida turgan mutolachi’ from mutolachi

    Download 15,05 Mb.