0% found this document useful (0 votes)
2 views7 pages

SQL Test 1

Uploaded by

punithagopi0109
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)
2 views7 pages

SQL Test 1

Uploaded by

punithagopi0109
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
You are on page 1/ 7

o7lo6|24.

SQL Tes t-1

() RBMS, Soplatn
RDBMS Reyen to Relaonal databate Manaycmet
Sgtm.
Dt fs a Sol twan that maln tains ue
Databaye

Data ts sto m tue fom of tables (vos , Colounail

Trantetng of fle is Eun:

DBms t Relai mal mo del males t e

Ro Bms

prmay ke
forem kky is ed to
Tt is wyed to wiquely
etiee tue data
betueen te table
fom th table.
Jhere an be me

There an be mly ne

tan ane fore?gn key


pimay ky in a talole
’ foretzn lay is the
pnay lsey ts tue
pimay bey of Same
tat,le
tasle
ant
Dts the toem y
n anoter table,
Unie and distHrct dasse.
distint
wiue
Uvique ts the Costratnt
tthat Remeues däplicakd
Output table
Vales tn catatype tbel4
EX Empid pimag ky uiue

Jist all the datetypu and sytax,


5datatypu.
’ Char
Varchar
Date

Number

’ Large ebjut
* Charatr age objat
Belear aye objut
OChar
Char (size)

(aichar (size)
Varc bara (stz)
Date
Syntax, DAE

Numhes
nunter(pistm, sale)
L)ATD detais 6ff Bnp layees Sang
Comnision n ospt lo or s0.

Selet *
fom Emp
not null and deptno(lo , 2o) ;
Lhere Comm t's
ot

mplyees wsose Salay


ist all the
n the range of al t
. rept

Salemn.

Select
from Emp (looo, Sovw) and
bebueen SALESMAC;
whee Sal not Job not in
e, ao, 3o) and
deptno in
whse nane Start
Bnplees
wAgTD nam of
witu perentile.

Selet Ename

fom FmP
whee Ename

Enployces htied oyter


AG TD nouet of

&3 manayer m dupt to,


Selet Ehame
fom Emp JoL = MANAq ¬
redate > 3|- Dec - 83 nd
where
and deptno = o ;
List al tu Salyman mdeot 30 and hav tng
Salany qveater thon (so.
Seleet &
from Emp
deptno = 3o
hee Job- SALESMAN' and
nd
mplayees lany ut
o) ,

Comntsin moe then Salay


12 4 3o
/loo
Sal
Selt mp. Sal *12 +
from emp
ehee Cem m > Sal ;
witu annual
deti
n) emplyee cletnathion
it
youy of 3ooro
tn
has shg man
lal t 3o0o
Select Emp.
om Emp
MAN . ;
ike
LI here Job
ith deduti'n
12) WATD Saay worcg as ales man.

Salt sal ao(0b


Selet Ename
from tm pP
ALESM AN;
1) ete Jols ' = S
te name and 2amhg salany h rage
Selee frem EmP
ke ! and

Sal be buee n \ooo, ow)


salay

bowng lsratty
charukey 's
at et ane
elet fom
o and
Sal in not ull and dlept
Jhee
Ehame

name and trdat of Lmplayce


is) behween 9e and(417

Selet name, edate


Bom mp

Wreate b- 3an- 1949

details of mplayces
wtho
hale termm Salayiven to 2mplyee
dont Ea m Comnission

Seleet mp. Sal b


) aA TD deteils of all mplaus EKLept
Analyt 2, Salumn.

Seleet e
fom bmp SALES MAN')

Aame oa all Smplayes hovtng


Cosonaat

Selet

lele . a' ud
here name not
he ( "e
and
nae not
an
Enam
Enae hot
Leke o' and

Ehame
letter o'
olepartuut non heytng
ist tue tut cportment
well ay

names.

Selet Dname

And

Dname
) Seet sal disttet

Select (bisinet Sa)


from Emp
Selet

Seleet Emp.
fom mp:

3) Selet mame

)er Job MAA E2 ;

Selet neme

MANAG E e g a t 2 , 1

Set Ename Hredut alay

Selet Eneme, hrcdat, Cal

You might also like