SELECT first_name, last_name, salary
FROMemployees
WHERE hire_date BETWEEN '1987-01-01' AND '1995-01-01';
Maoshi(salary) 6000, 8000,10000 ga teng bo’lgan xodimlarning ismi hamda telefon raqamini chop etuvchi so’rov yarating.
SELECT first_name, phone_number
FROM employees
WHERE salary IN (6000, 8000, 10000);
Maoshi 4000 dan 10000 gacha bo’lgan xodimlarning ma’lumotlarini chop etuvchi so’rov yarating.
SELECT *
FROM employees
WHERE salary BETWEEN 4000 AND 10000;
Ismi(first_name) “S” harfi bilan boshlanuvchi xodimlarning barcha ma’lumotlarini chop etuvchi so’rov yarating.
SELECT *
FROM employees
WHERE first_name LIKE 'S%';
Familiyasida “o” harfi qatnashgan xodimlarning ism-failiyasi, email hamda telefon raqamini chop etuvchi so’rov yarating.
SELECT first_name, last_name, email, phone_number
FROM employees
WHERE last_name LIKE '%o%';
10000dan ko’p maosh oluvchi xodimlarning ismi, hamda telefon raqamini job_id ustuni bo’yicha teskari tartibda chiqaring.
SELECT first_name, phone_number, job_id
FROM employees
WHERE salary > 10000
ORDER BY job_id DESC;
Telefon raqami 8 bilan tugallanuvchi xodimlar oylik maoshidan qancha daromad solig’i to’lashi mumkinligini chop etuvchi so’rov yarating. Daromad solig’i 12% deb hisoblang.
SELECT first_name, last_name, phone_number, salary, salary * 0.12 AS income_tax