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; NatijaSo`rov: SELECT xodim_id, Lower(FISH), manzili, length(manzili), oyligi FROM zavod_xodimlari WHERE xodim_id BETWEEN 1 and 2; NatijaAND, OR, NOT,IN, BETWEEN, LIKE |
SELECT id_st, surname
FROM
|
bet | 11/17 | Sana | 18.01.2024 | Hajmi | 2,98 Mb. | | #140320 |
Bog'liq Uslubiy qo'llanma 1-6Bu sahifa navigatsiya:
- 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 student
WHERE surname LIKE 'A%'
Ishni bajarish tartibi
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
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
So`rov: SELECT FISH, length(lavozimi), manzili, oyligi FROM zavod_xodimlari WHERE NOT xodim_id=3;
Natija:
– rasm. Length funksiyasi va NOT mantiqiy amalining qo’llanishi
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:
– rasm. Lower, length funksiyalari va Between mantiqiy amalining qo’llanishi
Vazifalar
Yuqorida ko`rsatilganlardan foydalanib tanlangan variyantga muvofiq mavzu uchun MySQL da AND, OR, NOT,IN, BETWEEN, LIKE buyruqlari bilan ishlaymiz.
Bajarilgan ishlar haqida hisobot tayyorlang (1-2-ilovalarga qarang).
|
| |