Talaba: Fathiddinov Saidmahbub


(-------- WHERE ----------- SHART -----------------)


Download 277.09 Kb.
bet5/8
Sana07.01.2023
Hajmi277.09 Kb.
#1082163
1   2   3   4   5   6   7   8
Bog'liq
7-labaratoriya2

(-------- WHERE ----------- SHART -----------------)
(--- NOT ---)
(-------- AND -------------------------)
(-------- OR --------------------------)
Bu operatorlar yordamida yaratilgan bir necha so‘rovlarni ko‘rib chiqamiz.
Masalan: Sotuvlari xaqiqiy xajmi rejadagidan yoki $300.00 dan kam bo‘lgan xizmatchilarni aniqlash
SELECT NAME, QUOTA, SALES
FROM SALESREPS
WHERE SALES < QUOTA OR SALES < 300.0
Sotuvlari xaqiqiy xajmi rejadagidan va $300.00 dan kam bo‘lgan xizmatchilarni aniqlash
SELECT NAME, QUOTA, SALES
FROM SALESREPS
WHERE SALES < QUOTA AND SALES < 300.0
Sotuvlari xaqiqiy xajmi rejadagidan kam, lekin $150.00 dan ko‘p bo‘lgan xizmatchilarni aniqlash
SELECT NAME, QUOTA, SALES
FROM SALESREPS
WHERE (SALES < QUOTA) AND (NOT SALES > 150.000)
AND ifodasi algebrasi.
Qiymat Natija
-------------- ----------
TRUE AND TRUE -> TRUE
FALSE AND TRUE -> FALSE
TRUE AND FALSE -> FALSE
FALSE AND FALSE -> FALSE
NULL AND TRUE -> NULL
TRUE AND NULL -> NULL
FALSE AND NULL -> FALSE
NULL AND FALSE -> FALSE
NULL AND NULL -> NULL
OR ifodasi algebrasi.
Qiymat Natija
-------------- ----------
TRUE OR TRUE -> TRUE
FALSE OR TRUE -> TRUE
TRUE OR FALSE -> TRUE
FALSE OR FALSE -> FALSE
NULL OR TRUE -> TRUE
TRUE OR NULL -> TRUE
FALSE OR NULL -> NULL
NULL OR FALSE -> NULL
NULL OR NULL -> NULL
NOT ifodasi algebrasi.
Qiymat Natija
-------------- ----------
NOT TRUE -> FALSE
NOT FALSE -> TRUE
NOT NULL -> NULL
Qo‘shma izlash operatorlarining xar biri o‘z ustivorligiga ega. Eng yuqori ustivorlik NOT ga tegishli, undan so‘ng AND va oxirida OR!
SQL92 standartida IS operatori yordamida ifoda rost, yolg‘on yoki aniqlanmaganligini tekshirish mumkin. Uning sintaksisi quyidagicha:

Download 277.09 Kb.

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




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