SQL Operators-Copy
SQL Operators-Copy
programmer
Curious_.Programmer
SQL OPERATORS
SQL operators are used to perform operations on data
in SQL queries.
Curious_.Programmer
Get Discount on Top Tech
Platform Name Deal Details Deal Link
Show
Coding Ninjas 10% discount, Coupon Code: KHUAG
Coupon
Show
KodeKloud 60% discount, Coupon Code: CWC10
Coupon
Curious_.Programmer
LOGICAL OPERATOR
The SQL AND operator is used with the where clause in the
SQL Query. AND operator in SQL returns only those records
which satisfy both the conditions in the SQL query.
Copyright: IG: Curious_.programmer
CodeWithCurious.com
QUERY>
SELECT *FROM Student WHERE NAME="Yadnyesh" AND City="Pune";
Output>
Curious_.Programmer
The BETWEEN operator in SQL shows the record within
the range mentioned in the SQL query. This operator
operates on the numbers, characters, and date/time
operands.
If there is no value in the given range, then this operator
shows NULL value.Copyright: IG: Curious_.programmer
CodeWithCurious.com
QUARY>
SELECT *FROM Student WHERE DIVISION="C" OR City="Delhi";
Output>
Curious_.Programmer
500+ Coding Projects
With Source Code Free
Download
Click Here for 500+ Projects Code
Curious_.Programmer
The BETWEEN operator in SQL shows the record within
the range mentioned in the SQL query. This operator
operates on the numbers, characters, and date/time
operands.
QUERY>
SELECT * FROM Student WHERE Roll_No BETWEEN 102 AND 104;
Copyright: IG: Curious_.programmer
Output> CodeWithCurious.com
Note: BETWEEN returns all the values from given start record to
end records
Curious_.Programmer
It filters the records from the columns based on the
pattern specified in the SQL query. LIKE is used in the
WHERE clause with the following three statements:
1. SELECT Statement
Copyright: IG: Curious_.programmer
2. UPDATE Statement CodeWithCurious.com
3. DELETE Statement
There are two wildcards often used in conjunction with the
LIKE operator:
The percent sign (%) represents zero, one, or multiple
characters
The underscore sign (_) represents one, single
character
QUERY:
SELECT * FROM Student WHERE NAME LIKE 'Y%';
output:
Curious_.Programmer
QUERY:
SELECT * FROM Student WHERE CITY LIKE '_u%';
Copyright: IG: Curious_.programmer
output: CodeWithCurious.com
Curious_.Programmer
NOT operator in SQL shows those records from the table
where the criteria is not met. NOT operator is used with
where clause in a SELECT query.
Copyright: IG: Curious_.programmer
Query: CodeWithCurious.com
SELECT * FROM Students WHERE NOT City = "Mumbai";
Output:
Curious_.Programmer
When we want to check for one or more than one value in
a single SQL query, we use IN operator with the WHERE
clause in a SELECT query.
Query:
SELECT * FROM Students WHERE City IN("Delhi","Pune");
Copyright: IG: Curious_.programmer
Output: CodeWithCurious.com
Curious_.Programmer
👆
Free Ebooks, Handwritten Notes Avaliable
Curious_.Programmer