0% found this document useful (0 votes)
4 views2 pages

SQL Operators Complete

The document provides a comprehensive overview of SQL operators, categorizing them into arithmetic, comparison, logical, bitwise, set, string, special, pattern matching, subquery, and JSON operators. It includes examples for each category to illustrate their usage in SQL queries. Additionally, a combined query example demonstrates the application of multiple operators in a single SQL statement.

Uploaded by

shivkumardiaries
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

SQL Operators Complete

The document provides a comprehensive overview of SQL operators, categorizing them into arithmetic, comparison, logical, bitwise, set, string, special, pattern matching, subquery, and JSON operators. It includes examples for each category to illustrate their usage in SQL queries. Additionally, a combined query example demonstrates the application of multiple operators in a single SQL statement.

Uploaded by

shivkumardiaries
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SQL OPERATORS - COMPLETE NOTES

1. Arithmetic Operators

+ Addition

- Subtraction

* Multiplication

/ Division

% Modulus

Example:

SELECT 10 + 5;

2. Comparison Operators

=, <>, >, <, >=, <=

Example:

SELECT * FROM employees WHERE salary > 50000;

3. Logical Operators

AND, OR, NOT

Example:

SELECT * FROM employees WHERE salary > 50000 AND department='IT';

4. Bitwise Operators

&, |, ^, ~, <<, >>

5. Set Operators

UNION, UNION ALL, INTERSECT, EXCEPT

6. String Operators

CONCAT(), ||, LIKE

7. Special Operators

IN, NOT IN, BETWEEN, IS NULL, EXISTS

8. Pattern Matching
LIKE, NOT LIKE

% and _ wildcards

9. Subquery Operators

IN, EXISTS, ANY, ALL

10. JSON Operators

->, ->>, #>, #>>

Combined Query Example:

SELECT name, salary FROM employees

WHERE salary BETWEEN 30000 AND 70000

AND department IN ('IT','HR')

AND name LIKE 'A%'

ORDER BY salary DESC;

You might also like