difference between different SQL code example
Example 1: sql difference between tables
SELECT *
FROM Table1
MINUS
SELECT *
FROM Table2;
SELECT *
FROM <table-1>
MINUS
SELECT *
FROM <table-2>;
Example 2: between vs in sql
• BETWEEN operator is used to display
rows based on a range of values in a
row whereas the IN condition operator
is used to check for values contained
in a specific set of values.
• Example of BETWEEN:
SELECT * FROM Students
WHERE ROLL_NO BETWEEN 10 AND 50;
• Example of BETWEEN:
SELECT * FROM students
WHERE ROLL_NO IN (8,15,25);