You are on page 1of 1

1) Select Name, salary, salary+300, from Employees;

Here salary+300 is not a new column. It is for display only.


) !rit"metic #perators precedence$
%ultiplication and di&ision occur 'efore addition or su'traction.
#perators of same priority are e&aluated from left to ri("t.
)alculations in parent"esis are done first.
3) ! N*++ is a &alue t"at is una&aila'le, unassi(ned, un,nown or inapplica'le. !
N*++ cannot 'e a -ero or 'lan, space. .ero is a num'er and space is a c"aracter.
/) ! )olumn !lias renames a )olumn "eadin(.
E0$ Select last1name as name, commission1pct comm from employees;
Select laste1name 2N!%E3, salary41 2!nnual Salary3 from employees;
5) 6"e 2773concatenation operator is used to concatenate 'ot" t"e strin(s and (i&e a
sin(le output )olumn. )oncatenatin( a N*++ &alue wit" a c"aracter strin( will
result in t"e )"aracter strin( itself. E0$ +!S61N!%E 77 N*++ is +!S61N!%E.
8) )"aracters and 9ate &alues s"ould 'e enclosed in sin(le :uotes.
;) 2#rder 'y3 clause is used to sort t"e rows in a specific order eit"er ascendin( or
descendin( order.
<) 6"e default 9!6E display format in S=+ is >99?%#N?@@A.
B) Select S@S9!6E from 9*!+;
10) !991%#N6HSCA1?D!N?08A, 8) ?????????? A1?D*+?08
11) +#EEF,*GGEF,INI6)!G,)#N)!6,S*HS6FCcolumn,mInJ),+ENK6H,6FI%
Conly a&aila'le in <i and later &ersions)
E0$ )#N)!6C>Gra&eenA,ALumarA) ??? Gra&eenLumar
S*HS6FC>HelloEorldA,1,5)??????? Hello
6FI%C>HA from >HelloA) ???????? ello
INS6FC>HelloworldA,AwA) ?????8
1) F#*N9 ?M Founds t"e column or &alue to n decimal places. E0$
F#*N9C/;.B<;8,) is /;.B<, F#*N9C/;.B<;,0) is /<
13) 6F*N)?M 6runcates t"e column or &alue to n decimal places. E0$
6F*N) C/;.B<;8, ) is /;.B<, 6F*N) C/5.B3) is /5
1/) %#9?M Nins t"e remainder of t"e first ar(ument di&ided 'y t"e second ar(ument.
%#9C1000,5000) is 000, %#9C<00,5000) is 300
15) 9ate Nunctions$
%#N6HS1HE6EEEN C9!6E1, 9!6E)
E0$ %#N6HS1HE6EEEN CA01?SEG?B5A,A11?D!N?B/A) ?? B1.8;;/1B/
!991%#N6HS C9!6E, n) CA?%!F?<5A, 8) ????? >?SEG?<5A
NEO619!@ C9!6E,A c"arA) CA01?SEG?B5A, >NFI9!@A) ??? A0<?SEG?B5A
+!S619!@ C>01?SEG?B5A) ???????? A30?SEG?B5A