Savollar: Matematik standart funksiyalar haqida ma’lumot bering


Download 14.3 Kb.
Sana16.11.2020
Hajmi14.3 Kb.
#146830
Bog'liq
Barotov Mirfayz YN MT


214-17 – guruh talabasi Barotov Mirfayzning Ma’lumotlar Bazasi fanidan Yakuniy Nazorat ish

2-Variant

Savollar:


  1. Matematik standart funksiyalar haqida ma’lumot bering.

  2. EXISTS standart so’zi va uning sintaksisi.

  3. Uchta jadvalni INNER JOIN orqali birlashtirilsin va har biridan bittadan ustun chiqarilsin.

Javoblar:

1 . Ma’lumotlar bazida 20 dan ortiq matematik standart funksiyalar bor. Odatda biz min(),max(), count(), avg() shularni ishlatamiz. Bu funsiyalarni biz har doim Select dan keyin ishlatamiz. Masalan kichik jadval yaratamiz, :

CREATE TABLE "phones" (

"id" INTEGER,

"name" TEXT,

"price" REAL

);

INSERT into phones VALUES



(1,'Iphone 11 64Gb', 800),

(2,'Samsung s20 64Gb', 750),

(3,'Sumsung s20 plus 128Gb',1000),

(4,'Iphone 11 pro 64Gb',1000),

(5,'Mi Note 10 64Gb', 600);

Select *from phones;



1

Iphone 11 64Gb

800.0

2

Samsung s20 64Gb

750.0

3

Sumsung s20 plus 128Gb

1000.0

4

Iphone 11 pro 64Gb

1000.0

5

Mi Note 10 64Gb

600.0

Bizga eng arzon tefon kerak bo’lsa min() standart funksiyadan foydalanamiz:

SELECT name, min(price) as "price" from phones;



Mi Note 10 64Gb

600.0

Bizga eng qimmat telfon kerak bo’lsa, max() standart funksiyadan foydalanamiz:
Download 14.3 Kb.

Do'stlaringiz bilan baham:




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