Here is the given code:
SELECT *
FROM CUSTOMERS
WHERE ID IN (SELECT ID FROM CUSTOMERS
WHERE SALARY > 4500);
Why we can't simply write:
SELECT *
FROM CUSTOMERS
WHERE SALARY > 4500;
?
Here is another code:
SQL>
INSERT INTO CUSTOMERS_BKP
SELECT * FROM CUSTOMERS
WHERE ID IN (SELECT ID
FROM CUSTOMERS);
Again, I don't understand the point of this subquery, wouldn't it bring the same result if I was to write, -
INSERT INTO CUSTOMERS_BKP
SELECT * FROM CUSTOMERS;
?