EXP6
EXP6
The N Cpeaa bo
Va lwes claset
ebrm brue f the value nmathesamy yalue
2) NOTIN
The NoTLN Opexa bov it Fec bopey a Jut
of vawes for Cemmpaason inuHERe clate
ebuand s u e f bhe vawe cees ne mat
Cny vawe in he lsl
3)JoME /ANY
The
Jubasay Tubquey lreburas tue 4the ompas
bue hakleast one valwe n b¥e beé
4), ExitI
bo bed a tuealhe
hcieny cnacthease pDefomeel
eu beCom
sebieval
taslks thin lu
queies emmbedbmg caba eenmplex byqueaies
mamipulabe
bada
mad filbe buens fullPowen aConcite
amc
Clasect ebh Exubs In Like bong Opeu
lueng dQt, ineuees Ceonclusioni
ested
bement. Jta deL ingle af
Jcepe
ci
hin sefered beCen bhat feb eulb nomec
bu yuu alleug xpreaien bablu
Ce ag
known clso CLAutg llTH Th
CLAwe wTH 6)
Jubguesy itbne
lcbhes
a
beok bo
EXII 5),NOT
312
exp6
CREATE TABLE DEP (
department_id INT PRIMARY KEY,
department_name VARCHAR(50),
location_id INT
);
INSERT INTO DEP (department_id, department_name, location_id)
VALUES
(1, 'HR', 1700),
(2, 'Finance', 1800),
(3, 'IT', 1700);
1> USING IN
SELECT *
FROM DEP
WHERE location_id IN (1700, 1800);
2>USING NOT IN
-- Select departments not located in location_id 1700
SELECT *
FROM departments
WHERE location_id NOT IN (1700, 1800);
3>USING ANY
SELECT *
FROM DEP
WHERE department_id IN (
SELECT department_id
FROM employees
GROUP BY department_id
HAVING COUNT(*) > 1
);
4>USING IN
-- Select departments with at least one employee earning more than $60000
SELECT *
FROM department
WHERE department_id IN (
SELECT department_id
FROM employees
WHERE salary > 60000
);