Skip to content

Instantly share code, notes, and snippets.

@mepsrajput
Last active November 11, 2020 05:25
Show Gist options
  • Save mepsrajput/a2fbbc3455df6f4446fe4db79b917f2b to your computer and use it in GitHub Desktop.
Save mepsrajput/a2fbbc3455df6f4446fe4db79b917f2b to your computer and use it in GitHub Desktop.
SQL Notes

Operators in the where clause

  1. Equal (=)
  2. Greater Than (>)
  3. Less Than (<)
  4. Greater Than or Equal (>=)
  5. Less Than or Equal (<=)
  6. Not Equal (<>)
  7. BETWEEN () : Between a certain range
  8. LIKE () : Search for a pattern
  9. IN () : To specify multiple possible values for a column

AND, OR, NOT Operators

SELECT * FROM Customers WHERE Country='Germany' AND (City='Berlin' OR City='Munchen') AND NOT (Street='Legiendamm');

NULL Operator

SELECT * FROM Cust_table where CustID IS NOT NULL AND MobileNo IS NULL ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment