• So`rov: SELECT *FROM zavod xodimlari; Natija: 5.1-rasm.
  • So`rov: SELECT xodim_id, substr(FISH ,1,1)||’.’|| lavozimi, FISH, manzili, length(manzili), oyligi FROM zavod_xodimlari WHERE xodim_id IN(1,2,3) AND oyligi>5000000;
  • So`rov: SELECT FISH, length(lavozimi), manzili, oyligi FROM zavod_xodimlari WHERE NOT xodim_id=3; Natija
  • So`rov: SELECT xodim_id, Lower(FISH), manzili, length(manzili), oyligi FROM zavod_xodimlari WHERE xodim_id BETWEEN 1 and 2; Natija
  • AND, OR, NOT,IN, BETWEEN, LIKE
  • SELECT id_st, surname FROM




    Download 2,98 Mb.
    bet11/17
    Sana18.01.2024
    Hajmi2,98 Mb.
    #140320
    1   ...   7   8   9   10   11   12   13   14   ...   17
    Bog'liq
    Uslubiy qo'llanma 1-6

    SELECT id_st, surname
    FROM student
    WHERE surname LIKE 'A%'


    Ishni bajarish tartibi

    1. Oyligi 4 000 000 dan ko’p yoki id 2 dan katta Xodimlar Idsini, FISHini lavozimini esa katta harflarda chiqaramiz;

    Zavod va kon xodimlari jadvallarini ko’ramiz;
    So`rov: SELECT *FROM zavod xodimlari;

    Natija:
    5.1-rasm. Zavod_xodimlari jadvalidagi ma’lumotlarni ko’rish
    So`rov: SELECT xodim_id, FISH, UPPER(lavozimi) FROM zavod_xodimlari
    WHERE oyligi>4000000;
    Natija:
    5.2-rasm. UPPER funksiyasini qo’llanishi natijasi

    1. So`rov: SELECT xodim_id, substr(FISH ,1,1)||’.’|| lavozimi, FISH, manzili, length(manzili), oyligi FROM zavod_xodimlari WHERE xodim_id IN(1,2,3)

    AND oyligi>5000000;
    Natija:
    5.2-rasm. Substr va mantiqiy amallarning qo’llanishi

    1. So`rov: SELECT FISH, length(lavozimi), manzili, oyligi FROM zavod_xodimlari WHERE NOT xodim_id=3;

    Natija:

      1. – rasm. Length funksiyasi va NOT mantiqiy amalining qo’llanishi





    1. Zavod xodimlarining ism, familiyasini LOWER yordamida kichik harflarda, manzilining uzunligi va IDsi 1 va 2 oralig’idagi xodimlarni chiqaramiz:



    So`rov: SELECT xodim_id, Lower(FISH), manzili, length(manzili), oyligi
    FROM zavod_xodimlari WHERE xodim_id BETWEEN 1 and 2;


    Natija:


      1. rasm. Lower, length funksiyalari va Between mantiqiy amalining qo’llanishi



    Vazifalar

    1. Yuqorida ko`rsatilganlardan foydalanib tanlangan variyantga muvofiq mavzu uchun MySQL da AND, OR, NOT,IN, BETWEEN, LIKE buyruqlari bilan ishlaymiz.

    2. Bajarilgan ishlar haqida hisobot tayyorlang (1-2-ilovalarga qarang).




    Download 2,98 Mb.
    1   ...   7   8   9   10   11   12   13   14   ...   17




    Download 2,98 Mb.