10 amaliy ishi. Agrеgat funksiyalardan foydalanish


Download 50.92 Kb.
Pdf ko'rish
bet6/6
Sana02.06.2024
Hajmi50.92 Kb.
#1837712
1   2   3   4   5   6
Bog'liq
mb amaliy 3

Document Outline

  • 1.SUM(); select sum(yoshi) as 'Xodimlarning yoshlari yigindisi' from ustozlar;
  • 2.AVG(); select avg(ish_staji) as 'ustozlarning ortacha reytingi' from ustozlar;
  • 3. MIN(); select min(yoshi) as 'eng yosh oqituvchi', FIO from ustozlar;
  • 4.MAX(); select max(ish_staji) as 'eng ish staji katta ustoz' from ustozlar;
  • 5.COUNT(); select count(*) as 'kollejdagi kafedralar soni' from kafedra;
  • 6&7. RAND(); & ROUND(); select id, FIO, round(rand(yoshi)*100, 0) as 'random yosh' from xodim;
  • 8.BETWEEN(); select id, FIO, yoshi from ustozlar where yoshi between 23 and 40;
  • 9.MID(); select mid(FIO, 1, 3) as 'boshidagi 3ta harf', FIO from ustozlar;
  • 11 – Amaliy ish. Murakkab so‘rovlar yaratish
    • 2. select * from oqituvchi limit 1,2;
    • 3. select id, ism from ustozlar order by ism desc limit 1,2;
  • 12 - Amaliy ish. SQL tilida INDEX yaratish
    • 2. create index asosiy_ustozlar on ustozlar(id, FIO);
    • 3. show indexes from ustozlar;
    • 4. alter table ustozlar drop index asosiy_ustozlar; & show indexes from ustozlar;

Download 50.92 Kb.

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




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