0% found this document useful (0 votes)
10 views

SQL Day 2

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

SQL Day 2

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

SQL DAY-2

• We have two clauses used in this


 WHERE
 ORDER BY  by default ASC order

• USING WHERE
• Syntax:
• select * from <table_name> where <condition>;
CONDITIONAL
SELECTIONS • the following are the different types of operators used in where

AND clause.

OPERATORS  Arithmetic operators


 Comparison operators
 Logical operators

• USING ORDER BY
• Syntax:
• select * from <table_name> ORDER BY < col> DESC <ASC>;
 Arithmetic operators -- highest precedence
• +, -, *, / (select nsal,nsal+20 from nani)
 Comparison operators
 =, !=, >, <, >=, <=, <> (select * from nani where nno!=12; )
 between, not between
 in, not in
 null, not null (select * from nani where nno is not null;)
 like (select * from nani where nname like 'kani')
 Logical operators
 And (select * from nani where nno=12 and nname='kani';)
 Or -- lowest precedence
 not
FUNCTIO
NS
Two types
of SQL
functions

You might also like