Muhammad al-Xorazmiy nomidagi
Toshkent axborot texnologiyalari universiteti
Nurafshon filiali
Kompyuter injiniringi fakulteti
Kiberxavfsizlik injiniringi
730-22 guruh talabasi
MAMAJONOV AKMALJON
Ma’lumotlar bazasi fanidan
AMALIYOT ISHI
3-Amaliyot ishi
Mavzu: Standart funksiyalardan foydalanib so’rovlar yaratish. Agregat
funksiyalardan foydalanib so’rovlar yaratish.
1-rasm. employees jadvali
2-rasm. jobs jadvali.
Ismi(first_name) John bo’lgan xodimning oylik maoshi(salary)ni 12 ga ko’paytirib chop etuvchi so’rov yarating.
SELECT first_name, salary * 12 AS updated_salary
FROM employees
WHERE first_name = 'John';
employee_id si 200, 201, 202 bo’lgan xodimlarning maoshlari 50 foizi qanchaligini chop etuvchi so’rov yarating.
SELECT employee_id, salary * 1.5 AS updated_salary
FROM employees
WHERE employee_id IN (200, 201, 202);
job_id si 6 ga teng bo’lmagan barcha xodimlarning ma’lumotlarini chiqaruvchi so’rov yarating.
SELECT *
FROM employees
WHERE job_id != 6;
employees jadvalidan ishga qabul qilinish sanasi (hire_date) 1998-01-01 dan keyingi xodimlar ma’lumotlarini chop etuvchi so’rov yarating.
SELECT *
FROM employees
WHERE hire_date > '1998-01-01';
1987-01-01 dan 1995-01-01 sanasigacha ishga qabul qilingan xodimlarning ismi, familiyasi va maoshini chop etuvchi so’rov yarating.
Dostları ilə paylaş: |