10 amaliy ishi. Agrеgat funksiyalardan foydalanish




Download 0,56 Mb.
Pdf ko'rish
bet6/6
Sana04.12.2023
Hajmi0,56 Mb.
#110695
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 0,56 Mb.
1   2   3   4   5   6




Download 0,56 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



10 amaliy ishi. Agrеgat funksiyalardan foydalanish

Download 0,56 Mb.
Pdf ko'rish