0% found this document useful (0 votes)
6 views20 pages

Computer Applications in Business: DDL, DML, DCL

Uploaded by

STÈVÉ SMÎTH
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)
6 views20 pages

Computer Applications in Business: DDL, DML, DCL

Uploaded by

STÈVÉ SMÎTH
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

COMPUTER APPLICATIONS

IN BusTNESS
AsSI4N MENT

Sw GMTTTED By:
Nom Roxti Maumken
Class: B. Com 3 SEM
RoLL Na.: UC 21-017-0587
SECF'
DDL
Ihe Full FoKm of DDL a Dala Dehinition
Language
DDL i a compulo language usud lb build and
ansorm the asangemunF os dalbase ohjec3
nadatabase. The dalabase ohjecls comptuise
Vasuuaus lemen ike Views, tables, ndexes,
AChamas le. In borm. kilialtons, t h a
Known as a aala descupuon Aanguage because
udelbminu the sulds and Haconds n Hhe
database table.
Thue ae diheunt yees o DDL Commands whieh
Can aused o add, deleie, on modiy tables
Within a dalahase . DDL Commanos comphise
CREATE, ALTER DROP, TRUNCATE and RENAME
Lets analyze taceh. thu3 Commands
(A) CREATE
CREATE commands have a phedesened syntax
and a9e olen o used to oeale a new table .

The CREATE language slalement ts


CREATE TaBLE tokle namu(column dehinaline
takls pakamulis
B)ALTEER
An AL1ER omman hos th o dhon?ts p moke
anges n an
existing dala base table .
Tn &hon
This command will tho tabl.
modiby
ute command s uud han moodiy"a he
table
I. ADD

ALTER TABLE table name ADD


(Colun-name dalatype)
2. RENAME
ALTER TABLE
table- name
RE NAME
Old column.-name To new- column- name
3. DROP
HLTER TABLE
table-name
DROP
(Column-name)
4. MoDIFY
ALTER TABLE

EmployeeMODIFY
([Link]. daltype)
(C) DROFP
Tne DROFP Commanad has the authotity o delel any
Shjels auch as a. takla, undex, or View. 7 we

deluta any. objtels with tha DROP Command, thu.


Thene us no othes way tetnieve üt. DROP
Comman language slalement u

DROP TABLE able- name


(D) TRUNCATE
The TRUNCATE Command ts also stmilas lo
The DROP. Tt i geneeall used u y o want
Dtmmedialasamove all tho dala kom a
able. Howeven, h o e one diAesaree Tn
he DROP Command We Cannothataeve dala ,
whoreas w the Case o TRUNCATE, We Can
save th souucluse to ke haussd lalin.
TRUNCATE Command language. slalumerit s
TRUNCATE TABLE table name
(E) RENAME
The RENAME Command ts ustd lb mo
OH edit the name. a xisting datbase
such table and column lo a new
Gkojee as

name While hnameng the dala, You dont


have to r abut any dala ka8 as it will
kt Aeure. The RENAME Command language
&latoment
RE NAME TABLE Cursent- lable_name 10
new-alols - name

(2 DML
Ih
Full Foum e DML a Dala Manipalation
Language
Dala maniaulatiin Language(DML) a
pogHammung language, also a categony
PPy Lseul takle fonmat and omulas o
xohanging unormation, with tha dala limited toa
poin n he dlalabase, uLing SQL Howevert, a.

Teme
might oceuo whn dala inlraetions that
aeai Complicated asne. Pequised. In the
nalanee, lala Maipulotion Larguage. iú aspplicab

TYPES OF DML
OHah-Level ort Non-frocedumal DML
Low-Level on focedhusral DML
FEATURES OF DML-
Runs only data unlispetation quuris
U d in dalabase schuma to kacall or
manipulalc dala.
ADVANTAGES OF DML -
OModiy the dala slbrad within the database .
Delivenective human contact with the
machins
(3)
Could deliamine what dala us
C4) DML A Atveral nuwded
Vanilis and
beluween tha
operations
vencorts tha delverd the olatahas-

DISADVANTAGES OF DML
OCanno u. usmd o modiht thi databass
Suclne.
2Restict thu able view, that is DML coula
hide bome labl columns
(3) Aces dalá wthou storang it in tha device
4) Should not be ustd b cuala on delete.
keetions OH iss

(3) DcL
Ihe Full Foum o DeL a Dala Contol Language
DeL Commanas ase. UBed cContol the asesss
dala Stoned un a dalabasL. To execula any
Opexation ulalad a dalbase
ko uch as caeatin-
tha table, managing tho dala, we eque
peRmisson. And hure Comes he usl tho
DCL Commands. Ths Commanad us used lo
perom all thuse k s and halos un controlli
tha dalabase ayshm.
COMMANDS IN DeL
s A ase wo împorlant commands n DeL-
Gtant and ReveKe
ant A the name. kuggsl, thi command
ULd
rant Consunl to tha usw AD exeeule a
pasdaeudas opertation hi tanl Command i ustd
to add nuw permisfons o a. dalsbas u . Th

ntax hor this command -


RANT Privilege- A
ON 0bjee- name.
Usn-Nama

RevoKe. The RE VOKE. command us uLed lb eliminae


latäbase asces duom a uu The syndax foe
RE VOKE Command
REVOKE phivilege. ü t
-

ON objec- name
FROM w - Name
NEED FOR DCL COMMANDs
To achiwe steuUily and psuvent the. dalabase
Hom nauihonized acA3, The DeL
reueed.
he chtabas
(2) DeL Commanas helps h mainlatntrg
Even an admnitrator Can not aseAAs without
pekmission.

(1 0c commannt eicantdull &uReOK ana lexibi(,


AD
The administhaton to sustain he dalabase
ADVAN TAGGES OF DCL
DeL has the ahility b vher
the dala
enuse euait
us alisclosed tbvasnuous uss
2) beL
hully protecsad. Tt hushucs
uaul and unohhtctal usss
Aho database ftom. hoacug
Dala adminiskuatons can use the
7RANT and
REVORE to psavenl the dala gtom ang qhmage
ADVAN TAGES AND DISADVAN TA6ES OF DBMS-
ADVANTAGES
(a) No kedundant dlale
(b) Aala
Consislaney and
(C) dala Secusi
inlhgrity
(d) Puvae
E a s awces o olala .
(6) Easy HRCove
(9 Flextble
DISADVANTA GES-
(a) Hgh cost.
(b) Huge. &ize.
) Doibau failurs
d) Complxify.
e) Zncuaud slas cos.
Reauemunt tichnucal stladh
Cos Cos eolaka Convension
h) Pendoxmane
5 ER MODEL
ER model &lnck gont an
tnliby-Kelationshup mok
I* us a hzgh- lavel dala mode. This moodel us
at o define the dala lmins and telationshp
o peeilid Syslom
Jt
develops a concaplual design gon the ohtaba
iT also alevelope a Veny. &2mpla. and a s Lo
design vie odala.
n ER molelng, the dalabakl slbucliae us
pordsayec
0
as a
oliagtam called an
enlily-
Ha lationshap dagkam

Fot example, Suppose. We alesiqn a school


onlabase. n this dalabase, the student will ke an
wntity wth atbilkulus ike addka1s, name, la, age,
Tha add ness can ke anothe vtib with
aluikulis k e culy. souut nama, pin eode. ete.
and thue wil ku. a Palationship befwen thum
hame.
addhe3s

Student

COMPONENT OF ER DIAG RAM-


ER MoDEL

Entity Atts'bute Relation


Key AHibute - Ont to ong
Weak
Entity Composite On to many
Ath bule
Many to
-

one
MuHivaluud
Attru'bute
-

Many to
many
Deri ved
Ati bulo
6) ENTITY
fin entiy may ke any thje, class. penso
placa. n he ER dagkam, an entidy can be

ap ustnld rectangles
as

Considen an ongan'zaton as an exampe


Managen., pHOduct, employee, depanlment ee. he can

takn as an
entiy
These are one
ype oenlily
Weak Entity
Weak Entity An ntily that depends ovn anothase
Callod a ak enTily. The weak enlily
tnty
a0esn Conlatn ny Key atlsu bule s oV
The weak enltly hephuLnlod y o double
9no cHangle

Loan Installment

(A) ENTI TY SET


An enlily k u in bBMS s a &u thaf collectrel

9apesun a gtoup o nliliis sa stmilas ype."


Fon 49An enlely kel ean8, an tntily Atutok
bank accounts ete. In DBMS, the whole fable in
the abulat. hephisunlalion oaala tå an enlily
HOlol Pn
ni(O th thblo u's an
h ae lwo
upes s tnlily su
Weak entty &et.
Stnon9 ntity Aut
Weak eniil ku- A Weak
wniity enlily
&uF thaE does not contain
sut ui an

rTi butes to
AuhAsesen
n
oth
wiquuly, udentihy inian ilb
nwonds, a
phumasy key does not exist hoK a.
weak entty Att.
Honlevert, Econ tains a f i a l
Ket Calleo as a aiscsimina ton Discimina7on .

d e r n t 8 a goup of rd Hies gtom ihe en1ity


ll Aiseoumina tor. ueptc1nted bh unerin
With
dashad a
.
StMong tntily &et- A strong enlil
nlily ut that contains siuricient an
alibulb to
Uniquelh iolentib all ib unlilus. In other wonds
a
phumasy key exists hoH a
sbrong ntt su.
Himany kes h a slhong
ntity s l us hephesentes
byundenlining, t .

(7 A7TRIBUTE (TYPES)
Tnise ant hour ypes altbikults
a) Key Attibule- hu key attra buls is ud to
uphesur the min charaelneslics a n enlity.
1 huphsinls a Phumary key The key athikute
t3 hophLunled ky an llpse with the texF
undeilinud.
id
Phone-no

Stucent

name

6) Compos?te AHri bula


An attui buti that
Composed mary o7he
altoibulos s known as a Composite affibute
he Composite atuibula us hephsurnltd by an

llipse and hose elipse ae Conneelool wiHh


an ellpse

Name

Middle-nome Last-name
FiNs-name

(C) Multivated AHibute


have mOH Than value. Thu
An obiktula can
0 , .dad
oni
ble oval s
Usedo
attikulo . uphesent mutivae
Fot a sli dent can have moKa than. ont
phone numbe

Phone. no

d) dedved Atribule
An atti'buli that can be dena'ved dHom 0thr
atfndbute s deni'veal atribute. 7t
Known as a

Can be hepsuesunlecd bH a dashed ellipse


and
FOm eg - A pensons age changes ovet time
vea om anothe athebuko Like
Can h eni
a l a o4 Binth

Binth oate
Name

Student

Roll-no age
DE
GREE OF A RE LA TIONSHIP
DBMS,
humkse n
a
degn ehtiônshujp epsesen
the

tpes that 30ciates t n a

uladionship. Fon we have tnwo entitis, onu


ludent and the oth us bag, ag. and
and they a
COnneolid with he 1h. Ke
So
Do, hae we can ku phimas Ke and
o
that the degue
ulationship 2 as 2 eniitiis dar D.4
aasociat
n a sulationship
A) TYPES OF
DEGREE
Now,
Vo, basad on the number linked ent r
e have 4 ypes o oegrus helationships.
1 Unany
(2) Binart
(3) Texnak
(4) N-aH*
naw - As te nama kugaLsls, n a unay

enll s nvowed. Thn


Holathonship onlh ,
onu
is only a single unlil set, ie., the assocíalion
s batween a single stityh Hexe, the degHee of
frelationshap also known as a Jucustve Helationshi
Thwe anl two enlilus involved un a
(2)1Binany -

a deput. o kuladibrship 2.
binah Hla-ti'onship.
This Thi most Common pe helationship.
3) the
ag

I n a rnay htlationship, entities


letnanh
Th enf?tles involved The thouee ae

that pastieipaing n the ralatonship ereaea thes


As tn
ho degne o the helationship u 3. thcrDs inliiis
on&hup th numbta oh
lo a
a bit dihpieult lo conver t
helational table.
asa
aenraleisod gonm enti
4)N-a
9N-anh Tha's i -
a
Lotal
ties|
halatlonshlp whon the n numkt. numbeh o
these an n
pakticpating Whon have a

hvolved enttias, We can Aay


that thy
entties
As thehe ane many
N-st
N-s helationship.
t à hasd Lob
C o n v e r t h a m to
a

involvea, 1t us an
uncommon kalationship
Fulational table.
nol as widel ULed as a bina
that nn'.
The olegr rolatonship
ulationshp.
(1) CARDINALITY
candinalilg plays
an

In dalabast managemenl,
Heru, Cardinalith Kaphusunls the
wmportarnt Hole.. an entlket
e l set
umber Teimes an unil o an
bil. On We can
n a helationship
paslicipates
a hulalónship i
kay the
that Casalalilg
Un a helatiorship. Types
the numku Hons
Tables a e
n
betweun Aabls a t e -
Cahoinalil
OOna to One

Husband

OneOne to man
Moth
chaldan
Man D on

Cousrse Tnstrwetore

) Many, to
man
Video Custome0

lo) kEYs IN DBMS (TYPES)


Keys a o &even bHoad p s n DBMs
a) Candioala
(b) Ruma
Ke
Ket.
(C) Foraign Ke Ke
(d) SupeH keh
() Altennali key

Composile key
Htmasy Keh = Tne puma ke P a p e r

Colur OH
OH a.
sel o columns o a
lalklthat hup
13
un denli
that
the hucorals unigun phes
all
Takle. A takle Can consists Je
Ono phmasf Ke Aso, this phumas k
Canno consist 6 thi same Valus rupea
o a eib "tons. A thi values o a
th values
PHamas key have to he #h19.0
and the dihkent,
should ke. no upet'tions.
Consbainl h a l
he THumasy ke allow
columns
Pul on a
column/sef o Won
thuse
Thse to have a null value on duplicafe. Any
Aakle can onsss oonly a kirgle phema
A hoveagn K Ahat uf ers to it
Ket
Ke Consinainl.
tn the
Can nLven harge ho values phLsenl
pumany
() Supee Key A Supen. key Fug18 Ao the
the seSet
eall
a l l those Keys that help uS niual
dent'8th all the Hos punls n table. a

Tt miana that all o these Columns presin


h a tkkle that Can udentih he columns
that Taklu Uniuly ack as the Supen key
A Supen key s a

the
candidales keys
&uper. We nwod to pYek phumany ke
asy Takle grom the &upen keys suFFso as to
E tablo dontitu
C) Candiolal key - The candidali key ,
thase attikut that identthy n
thu pinm
Hows

kable Tna table, We kelecl dtdate cand


a
Homcandidal keg. Thus,
a
he
that
h a s Atmilas PHOpenties as above
explainedc aaov
pHumaHy
Tn key that
"ONkeys We have

he multple
ndidal

Takle, thone Can

Keys
d) AlHennati key - As we have slilid above, ay
th
taklo an
CAn cansisl muhple chofoOshon Thus
[Link] one.
prumash Key euul, F can
kicome a phima
alt thase keys that did nol
at Knon as allhnala key .
e
io
Fors9n Key We ue a hoagn key
wslablish hulationshups kitween wo available

Jakls. The honaag" keys


hWould naause evenu
Column Ab match the
un a
Value phLLnt
lakles pHimany K fonuegn
Fufvenltal dala as wel as
us lo manlan
helps
heferunlia inlaprily
The Composilk key ufLss loa
Conaposile key
Stte mutiple that
alUtibults hulp us uniual
uh a Table. T
odent b veny tupleunphisnl
a ku may no ke
attoukults phusnl
whun eveH We Consic/en them &tperately
wnugue
when we Aake thum all legethes, i t
e total uniquenss
ko a
Aniaue key- A unsaus keg rafens
Columnmn /a Al o
columns thal identht v
H COtd uniaualy un a lable. All the vallues
thii key would haveo e unigue. Kemem
tha awniuue key lifnt Hom a
i
pHamaN Key. Tt ui because iF on
nul! value. A phima
Capakle ohaviina one
have null valut
Ket n the othi hand, annot

You might also like