|
Ma’lumotlar bazasi” fanidan 11-amaliy topshiriq Bajardi: Farmonov Abdullojon Tekshirdi: Uralova Iroda Toshkent 2024
|
Sana | 18.05.2024 | Hajmi | 252,97 Kb. | | #242596 |
Bog'liq 11.11.11
MUHAMMAD AL-XOZAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
“Ma’lumotlar bazasi” fanidan
11-amaliy topshiriq
Bajardi: Farmonov Abdullojon
Tekshirdi: Uralova Iroda
Toshkent 2024
11 – Amaliy mashg’ulot
Mavzu: Murakkab so‘rovlar yaratish. TOP, LIMIT yoki ROWNUM
Ishdan maqsad: Berilgan predmet soha ma`lumotlar bazasidan foydalanib TOP, LIMIT yoki ROWNUM lardan foydalanishni o`rganish.
Masalani qo`yilishi: Predmet soha ma`lumotlar bazasi shakllantirilgandan so`ng undan unumli foydalanishni tashkil etish maqsadida TOP, LIMIT yoki ROWNUM lar orqali so`rovlar yaratish.
Uslubiy ko`rsatmalar: SQL LIMIT va SQL TOP operatorlarining vazifasi belgilangan satrlarni chaqirishdan iborat. SQL TOP operatori MS SQL Serverda ishlaydi, SQL LIMIT operatori esa MySQLda va Oracle da ROWNUM operatori ishlaydi ularnig vazifasi bir hil.
SQL Server / MS Access Syntax:
SELECT TOP number|percent column_name(s)
FROM table_name
WHERE condition;
MySQL Syntax:
SELECT column_name(s)
FROM table_name
WHERE condition
LIMIT number;
Oracle Syntax:
SELECT column_name(s)
FROM table_name
WHERE ROWNUM <= number;
SELECT TOP 3 * FROM Customers;
Misol. SQL da ishlash
SELECT * FROM Customers
LIMIT 3;
SELECT * FROM Customers
WHERE ROWNUM <= 3;
Ishni bajarish tartibi
SELECT * FROM xodimlar;
So`rov: SELECT * FROM xodimlar LIMIT 4;
Buyrug`ini kiritamiz natijada birinchi to’rtta satr hosil bo`ladi
Natija:
2.So`rov: Select lavozimi FROM xodimlar LIMIT 2;
Buyrug`ini yozamiz, natijada 2, 3 satrlar hosil bo`ladi.
Natija:
3.So`rov: select xodimlar_id ,FISH from xodimlar order by FISH desc limit 2,3;
Natija:
XULOSA:
Xulosa qilib aytganda ushbu amaliy topshiriqdan berilgan predmet soha ma`lumotlar bazasidan foydalanib TOP, LIMIT yoki ROWNUM lardan foydalanishni o`rgandim.
Foydalanilgan adabiyotlar:
1.youtube.com
2htttp/wikipediya.uz
|
| |