Adobe Scan 19 Mar 2023 PDF
Adobe Scan 19 Mar 2023 PDF
data n
eeded for an org;:il'\:
. . . . l!Za_ij
F osMS of the rotected from damage I 0~,
11.2 PURPOSE O 0 silotJ and P . · t sh
b a rep private, t requirements can em.pl o
1 uld e tate, . nt da a d'ff oy tl
s)1sten1 s ,o Id be accl.1 ·th diffeie swill have i erent View i1
A database . ta shoU ·ons w1 end user soft
~
r-;::::;.:::;.::;;::.-
Processing. That dda' erse appJicall 11d diffcrent erall data
that n ers a ov
organized so . n rograinm coinrnon . the data
Dl·fierent applicaho ~ ,d (rotll a . searching A DBMS (D
i, denvc . g o1
hi
w c1 I must be t·
I ds o " ,,ccess1n M anagement Systeata
"tructure. Their met ,o . 1· c existing data a software that is r Ill) re
~ tti 1Z W storing, maintainin 0°1
esp
will differ. users want to t demands for ne 1
databases. A datgband o
The waJ'S in which end .l in some cases tly. The .extent . a ase
J gc onu d urgen . h with a DBMS is ref
will constantly c 1~n ;ise rapidly an. . d determines t e database systern. erred 1
uses of the data will a ~ n be sat1sf1e
. h . demands ca . . . .
to which t ese the database system- cords are stored m various files. Anull\
overall \"alue of in" system, permanent re tract records from and add records
In a hmical file-process t, • written to ex .
•Jr . ograms a1e b of maJor ,
different applicat10n pr . me has a num er 1. . • •.
approp
riate files. But this sche h data redundancy
. ta es sue as . f
lin ·tations and d1sadvan g ' . ( ultiple copies o
u d t ·nconststency m l
(duplication of data), a a 1 • other) unsharab e
chin with one an '
same data but not mat . g d t incorrect data etc. A
data, unstandardized data, i~secure at~ all these problems as
database management system ts answer h d t thereby
it provides a centralized control of t e a a, Mismatched multiple cop.e
minimizing these problems in the database. same data, is known as
Inconsistency.
11.3 RELATIONAL DATABASE MODEL
In relational data model, the data is organized into tables (i.e., rows and columns). Theseta
are called relations. A row in a table represents a relationship among a set of values. Sin~a
is a collection of such relationships, it is generally referred to using the mathematicaJ
relation, from which the relational data model derives its name.
Le_t us see how a sample database can be represented in relational form. The sample dal~
bemg shown here has three tables (relations) . Sup . It Sh . t
• p1zers, ems, ipmen s.
Suppliers (SuppNo, Supp Name St tu c·
a S, 1ty)
- I
Items (ItemNo Item_Name, Price)
Shipments (SuppNo, ItemNo Qty . 1]
Each of these three tables closely' _supplied) [coloured fields represent primanJ keythe 5
IJ~
. resembles of
correspondmg to records of the f'l1 a conventional sequential file with rows ca~1
th t bl · e and col ' ds P
ese a es is actually a special UJnns correspondin t fi Ids of the recor .. (JII
about relations and their ch ca~e of the construct kn . g o e . a re/atton•
aracteristics w own m mathematics as
Rows of relations are gene U ' e shall learn llnd ti ) ~1
attnbutes. ra y referred to .tu er sec on 11 .4 . f J
as pies anct the columns are usually re e
1. Primary-key is the key-field that can .
uniquely iden .
Britannia 10 DelN
S2 New Bakers 30 Mumbai
S3 Mother Dairy 10 Delhi
S4 Cnokz 50 Banplore
S5 l laldh-.1m '10 Jaipur
It-ems Sltipments
ltemNo
I1
ltem_Name
Milk
Price
15.00
- - SuppNo
S1
ltemNo
I2
Qty_supplied
10
20
12 Cake 5.00 S1 13
13 Bread 9.00 S1 16 20
19 Nam.keen 15.00 S5 19 30
Notice, that here each supplier has a unique supplier number, exactly one name, status value
and location. Likewise, we assume that each item has a unique item number, name, price ; and
also that, at any given time, no more than one shipment exists for a given supplier/item
combination.
Components of a Table
Let us quickly have a look at various components of a table.
These are:
Byte A byte is a group of eight bits and is used to store a character.
Data Item A data item is the smallest unit of named data. It may consist of any number of bits or
(Field) bytes. A data item represents one type of information and is often referred to as a field or
data element
A record is a named collection of data items which represents a complete unit of
Record
information.
A table is a named collection of all occurrences of a given type of logical record.
Table
le
1 arg,'
rHtl 2uO! Jf]
LJlll{llllt
I h t N,111 ~1,111111
AllLll~A
~IN\ LI 1uunu
l ~ \,, 1111 IA i I(JI JtJ
\1NII A 2auuo
l ~ \' l•IIMAlt I' J( JI J( J
1,1'1 'll 11,(IIJIJ
l /\ 1 '
OHUl'I ~It
/\I H11 1/\
IlII J(JO
1uooo
N\. \0 l1INl \I I
till I I 00000
Nt ,, I,I IJOll
._ ANDI I I)
81 1111 20000
N ~J~J()( }()
1,\lM/\H
, Ul\l lA0I I
~/J{J(J()
2c,ooo
HWAMI R qulr
0"
ANf\ND
IOOOU iuoool=-~r--- 6 b1/(9
\II Nl,U I };W/\MI = =ID""-==
oOn aaouu 32000
w. 17 VIJf\~• UI IAI I \.
2
,,ooo
ANUJ '-.. ~111/\1 {MA 'I /000 00
\~ ..,9
\~ ~, \IANPAN/\ PAI IW/\ 1U000 180
In o table, each rl!cord i~ k\1.\nliri~d with ,1 uniqm\ vnhw i.e., in ., fit,ld of lablu, there arc uni~u
voluPs for oll records. This unlqul1 vuluc ichmlifitls lhc record. For i11sl.1no.? in Fig. l 1.2, lht..' fie!
Salc~manNumber h,1s uniqttl' v,ilu~i; for nil lhl~ r(1cords. Sn S.tll'SntanNumbcr is tlw prltlh • 11'
key here.
ln a ta.ble, u,~re may b: m01c lhnn rnw fil'ld having uniquP ,·,lhtt'S. ln such ,. c ..lsc, only onc 0
them 1:s declared as tJ1·1111ary k,•y. 1
tuples, :md modify tuples. There ar~ sevl'ral 1, cs, 111f~nt l'\l'\W tuples (r('cord/row), c. er'/
such l:.rngu,1gcs are r~l.1tion,1\ qu~ry l(mgu,,, , ..111gu.J
..1gcs'-. or ~,nr n.'ssmg • lh CSl'\ opcr..ir1ons · '
, < gc Jnu l'l.'ltlhon"l ,11 "t'\br:1
Examples of common Rt_)l,1tional Dut iba, , ).t g '" · •
' ' st i, anag~m~nt S t ems include Oraclt' ,/ ,1 I ' 1,,,:.. ,
Micrnsoft SQl... Se,11er, MYSQL, lBM on 2 Jn11...- . . ys 1
S \p S l • IQ, •r n 1llJorm,x SAJ> .... - ,.,,r,st.
1
'
1 y ,a~e • tlro,lntci, PoshrreSQL' SQL.rte etc. ' ~yl>as,.• A,fo ,tfoe ~en,er 'Cut-e,,
~ 1 · ~
open-sour..._x, cnt<'q, St'
SQ It.? is a rcl<"'~,,:'lt l \i, taha&'.'
engine rcu'l~r ,, .." ''lb,,d, ,,d mh) th('\ 1'l(
database engin 0 .-is i . , . -4 ... J
'- ' ~l S('.... \'(h)\ h, S(' \\'1 .'\l\\ld~
-embedaed sy~tcab, \~--ud1 a~ .-.'\t"11.t"H 1~ pn(,tWs),
,
.~m,mg Mh('1-s
P0s+-greSQL .1 ~---c·"'I "ral
1s :. .
~ 0 t: purposl" anu ,,bJcct rt"lc1twna1 dM,'lh:,s<' )'\.'\ '\ ( ,
st 2
~o d"~~d open source database s) stern P0stg1·c~Ql 1s It('('., '\~ <)l'C '\ "-c)\
- :S source ...oae lS a"allable under PostgreSQl hcc1'l.sc, a hlwral ()}X'n S<)1m.<" ,"{'In\;\
Common database managemePt •ools for 'lr1ob1le de, 1cc~ 1( .. ~Qt Anya r tlH.2
Everywhere, IDA! Mobile Database, SQL Server Compact, SQt Server Compa t, ~Ql Ser&N-
E,.,-p1'e.ss, Oracle DatabaseLite, SQLite, SQLBase etc. Out of these SQt ite ls .a public Jom~m
Open Somce implementation.
There are some other database models namely network data model, hierarc idlJ
object oriented data model. But covering these here is beyond the scop~ of the book
figure 11.3 SuppNo in Suppliers and Shipments draw values from same domain.
In the sample database, observe that relations Suppliers and Shipments have a commond
supplier numbers domain) and so do Items and Shipments (Item numbers domain).
See that in the table Shipments the supplier S1 is supplying 10 units of item 12 and fro
table S11pplim it can be said that a Delhi based supplier Britannia is supplying 10 .
item 12. That is how the association between rows (S1, 12, 10 of Shipments and S1, Britann
Delhi of S.,,,,lim) can be represented.
Tuple.~ rows of tables (relations) are generally referred to as Tuples (usually pronoun
rhyme with u couples").
Attributes. The columns of tables ( la.
re tions) are generally referred to as attributes.
Degree. The number of atbibutes • . . Areli
having 3 attributes is said to be m _a relation determine the degree of a relatton, 'bu
said to be a relation of degree : ~~on of degree 3. Similarly, a relation having nattfl
said to be unary, relations o f ~ two ons ~f degree one are . . .:
degree three are ternary, ....., and rela:' binary, relations of d columns
n-ary. ons of degree n are The rows an as 1
known W
Cardinality The relation are pecti~
· number of tuples ( and Attributes r\u1es '
called the CIITdinality of the relation . rows) in a relation is number . of eadtt:,.,a~
Sldp,nnt, relation ii 9 Simi1ari
ttlation is 5 •
' e.g., the cardinality of
y, the card~l~-
relation ,s call ~n"a~'J'
f oWS I
• __ --111111ty of S,,,,,liers number O r rd.,.,,. /
known as Cl /
1tll I\ 1111 I 1 11) llt1
1 1111dll h111 I
I l 1 II ,•1111 1111 Ill 1111 I 11111 I I''
11,1•ll11d 1111,,1,h (1tl111i11111111,1y11111,,v1 1,,
1111 11l1l1 1h11 ,,1111lly1111i1,1l11d,1111 IIHII lllll
wilt 1111 dt IIVul 1111111 111111' I ,1,11 (111
) 11,t 'l lr:t 1111 , H'Ellt d ,,,, nl1,il111-1, 111, 11,1,, ,,
if 1\ vh w I \it 1yll111t• , vi, w ,,. ,. 11 ,u d tu, fl 1w1
111
1
1nhh 1u 11lt1tl ,1 dt ll,11111111 '1 lw , 11 vJ, w I 11 a
/1,li/1,
I oll( 1Wl11gI lt , 11. I mq ii 1l111t ti 1t1 w11u•11t vi ft vlr w ✓ I• w1t Ht' 1H t wmduw
\ 11 w dt l,t•tl l11lt11 ,,, 1llu11 1l1111 l11 n• 11mlly ,l(va·d 111 i• Im ,. talllt,
£th wrrd1w,, ,
I
IJ1Jflt1llk1n
ul 111 vlow
(i)oudllorn• (/, Vlr un lt«;m• tnt,lu)
ltumNo
11
MIIV. Oro ,j 14 lJO
14
lw Cruom 10 ()()
1/
NorrrkMr, 1t, 00
A vkw c II be u cd 1111t likt 111y otl1e1 lolile, ft rn11 bl' ,1uerll'd, upd,,t :I, in rt d into, d l ned
from, and joiiwd with otl,cr t,,1,lt• m,t.1 viuw ,
View grcotly extend the wntrol you hove ,>vet your d,1ta, I hey ,re n x II nt way to give
people ou;c ~ to om<' Out ""' 111 or lhu "'''"'" ,lion 111 ., I hie I vcn l<cntl 011/y vi ;w can al.., be
created which mt!nn.s that they, an be ,111t:rwd, but U,cy cannot be ut* tcd to update u_,mmand8,
(Thoush there I a lot thot ,on be d, cu ud ohnul vi ws yet we ore nut going further In
explalnlng vlcwtl a it i beyond the l;opc of thl chapter ,mcl the book,)
Nl'lllll!lteaie
MyS QL w er t d nd upp orte d by MyS Ql AB, a
{ww w .my sql com ) Thi com p ny I now
mp ny ,
a ub 1d1 ry of Sun MtCrtY;]f te, ch
cop yrig ht tom t of the cod b . On Apn l 20th, 2009 Oracle Corp., whi d d vcloJ
the prop tary O l atab , ann oun d a d 'ti
al to acqu ir Sun Micr0; ,
The chi 1n'\r ent r of MyS QL w Michael Wid
niu (a k,a, Monty,. ~yS QJ ba>n na
1'1o nty' d t r My. Th logo of MyS QL, the dolp hin, i nam
ed O
r-n1 ',
11.6 MYSQL DATABASE SYSTEM
The key ro of a data base man ag m nt y tern
1 info rm.a hon ma O
mcn t. A data ba
the ~ to solv ing the prob lem s of info rma tion man
agem ent. In ge <?Ta)., a M!rv ~
relia1:>iv numa1~e a larg e amo unt of data in
a mul ti-us er envi ronm L>nt 60 that ma y ._ ~
:rren ttv acce ss the sam e data . A data base serv
er mus t also prev ent unau th(., , /.J _
de effi. oent solu tion s for failu re reco very .
MyS QL data base syst em refe rs to the com bina
tion of a MyS QL serv er insta nce and a M
data hits e MyS QL oper ates usin g clien t/ser ver
arch itect ure in whic h the serv er run, on 1
mac hine cont aini ng the data base s and clien ts
conn ect to the .6CTVCT over a networ'.G. 1be ten.
ope ratin g sy tern s is usu ally a Linu x (like
Redhat 9,0 etc,) Qr Wind ows oper ating fi'f
Typ icall y MyS QL is supp orte d on Wind ows XP.,
Wind ows Serv er 2003, Red Hat Fedora Linux,
Deb um Unu x, and othe rs. As with any othe r clien
t/ser ver appl icati on., Z.AySQL is a mul
data base syste m., mea ning seve ral user s can
acce ss the data base simu ltan eous ly.
Her e:
<;}The serv er (My SQL serv er) liste ns for clien t
requ ests com ing in over the netw: }:;
acce sses data base cont ents acco rdin g to thos e
requ ests and prov ides that to the diero
<S) Clie nts are prog ram s that conn
ect to the data base serv er and issue queries
pre- spec ified form at. MyS QL is com patib le · i
with the stan dard s base d SQL (Structure!
Que ry Lan guag e). The clien t prog ram may
cont act the serv er prog rarnm atic. aJly (mean:'
a prog ram call the serv er duri ng exec ution )
or man uall y. For exam ple, when you
issu ing com man ds over a sess ion to a MyS
QL serve r., you are issu ing the requests to
serv er by typi ng com man ds at your com man
d prom pt man uall y. On the othe r hand,
you hav e inpu t som e data (say your cred it card
info rma tion on the Inter net toWa!'
purc hase of som e good s) in a form , and the form
is proc esse d by usin g a server
prog ram. , then the MyS QL serv er is cont acte d prog
ramm atica lly. This is often the cast
cred it card appr oval s, mem ber subs crip tion
s etc.
Som e of the key featu res of MyS QL are:
L Spee d. If the serv er hard ware is opti mal,
le¢
MyS QL runs very fast. It supp mts duS
serv ers for dem andi ng appl icati ons.
2.. Ease of USt!!. MyS QL is a high -per form t1:t
ance , relat ively simp le data base syste m. FCOfJl ttJ
beginning, M ySQ L has typic ally been conf igur
ed,
com man d line. How ever , seve ral MyS QL grap hica mon itore d, and managed frOf!'l
l inter face s are also available, ff
3 _ cost . My5 QL is avai lable free of cost. MyS QL is a "Op
en Sour ce" datab ase- M~~
part of LAM P (Lin ux, Apa che, MyS QL, PHP
/ Perl / Pyth on) enviroruJteflt, ,#
owi ng ope n sour ce ente rpris e softw are
. Mor e and mor e com pani es ~ ~
~ as an alter nativ e to expe nsiv e propstack rieta ry softw are stac ks beca use of 1
cost , relia bility ., and docu men tatio n.
· Rl:lATIONAl DATABASES
5· P~rtahili ty. MySQL provides portabltlity u it haa been tested with a broad range of
di~ferent com p ilers and can work on many different platforms. It is fully multi-threaded
usmg kernel threads. It can easily use multiple CPUs if they are available.
6. Data Type~. M) SQL provides many data types to support different types of data. It also
supports fn,ed-length and \ ariable-length records.
7. Seatrity. MySQL offers a privilege and password system that is very flexible and
secure, and that allows host-based verification. Passwords are secu re because all
password traffic is encrypted when you connect to a server.
8. Scalability and Limits. MySQL can handle large databases. Some real life MySQL databases
contain 50 million records, some have up to 60,000 tables and about 5,000,000,000 rows.
9. Comiecti.vity. Clients can connect to MySQL Server using several protocols:
10. Localizati.on. The server can provide error messages to clients in many languages.
11. Clients and Tools. MySQL provides several client and utility programs. These include
both command-line programs such as mysqldump and mysqladmin, and graphical
programs such as MySQL Administrator and MySQL Query Browser. MySQL Server
has built-in support for SQL statements to check, optimize, and repair tables.
11 7 STARTING MYSQL
Starting MySQL is similar to the way you start other applications in Windows platform. Make
sure that MySQL Server is installed on your machines. Once it is installed, you need to click at
Start ➔ All Programs ➔ MySQL ➔ MySQL Server ➔ MySQL Command Line Client (see
figure below)
~
l!!J ,. ----------~
osoft Word lcJt
'C!I
NetBeans
Ghost(JUm
IC!!I Ghostscnpt
It will start the MySQL client where you have to specify the password. Ask your teacher about
the password for the MySQL installation in your _la__h_. _ _ _ _ _ _ _ __
•
!Ent password: -
\Je ~ : - to the PtySQL ,.on itoP. CoNIM.tllds end with ; or ,g.
~ Pt SQL connection id is 1
f:~epyuersion: 5.1.33-co-•mity PtySQL Co,..,unity SePuep <CPL)
rype 'help;' OP ·,h' fop help. Type •,c• to cle .... tho buffer.
py::ql> -
"II y o u c rt
a n s t a working in My ,e n You a1e u o u g h w
fr o m M y S Q · . it h you
L b y ly p m g u it at the 1nysq l> p r o m p t (sec f 1 g b e r¼o
Q lo w ) .
t~ , ~
1
L l'()n l'\l!lan • e "~ tl l ; 01
on tt \ to l' , o n • ,u •
u , i fit• lo
1 .3 3 co n 2
nn
14 SQ1, C on
'lt 9 y A un
it ll G et v o
r <GPI,')
p a 'h 'l \l •' ..
0 • ,, 11 ' (0 1·
t , ,c • to c lo t\ l' th n h u ff
\c l\ l- IJP o l" .
ql'> q u
it;~
1 1 .8 t\llYSQL A N
D SQL
I n o r d e r to
access d a ta
Q u e r y Lang w it h in th e M
uage (SQL) . y S Q L d a ta b
SQL is th e s a s e , a ll p r o
U s a g e of SQ e t of c o m m grams and
L has becom a n d s th a t is u s e r s must U
e a s ta n d a r d r e c o g n is e d St;
M y S Q L to b y nearly all
o ls o ft e n a for m o s t o f
a p p li c a ti o n ll o w u s e r s RDB~s. T
s in tu m m u to access d ho ~ g h appli
s t u s e SQL a ta b a s e w it cation p: "
T h e S tr u c tu when execu h o u t d ir e c tl y
r ed Q u e r y L ti n g th e u s u sing SQl,
Telational d a n g u a g e (SQ er 's r e q u e s
a ta b ases, w L ) is a la n g u a g t.
h ic h a re s e ts e th a t e n a b
T h e d a ta b a of r e la te d in le s y o u to c
s e w o r ld is f o r m a ti o n reate and.,
s ta n d a r d la b e c o m in g in s to r e d i n ta
n g u a ge th a c re a s in g ly b le s .
e n v ir o n m e n t can be u in te g r a te d,
t. T he S Q L (S s e d to o p e a n d th is le d
a ll o w s u s e r tr u c tu re d Q u r a te i n m to a c1
s to le a r n o n ery Langua a n y d if f e r e n t k
m a ti o n r e g a e s e t of c o m ge) has pro inds of
r d le s s of w h mands and v e d to b e a
e th e r th e y a u s e it to c r e standard l ~
There are n re w o r k in g a te, r e tr ie v
u m e r o us v e o n a P C, a w e , alter, and ua
Research Lab rs io n s of SQ o r k s ta ti o n , r,,
oratory (n o w L. T h e o r ig a mini, or am
w a s im p l~ m th e Almande in a l v e r s io i:
e n ted a s p a n Research C n ,v a s d e v e
:t of th e S y enter). T h is lo p e d at IBM 3
e v o l: 'e d s m s te m R p r o la ng u a g e , o
c e th e n, ~ d je c t i n e ar ri ginally call~
Institute (AN it
• . SI) p ub lish s n a m e h a s c h a n g e d ly l 9 7 0 s . T
h
e d a n SQL to e Se,1 uel \~~,
u p d a ti o n s m 1
e u d e u p d a ti s ta n d d th SQL. I n 1 9 86, th.e A
o n s in y e a r s a r mc,ica i °N" ,111
S Q L h a s c le at was upd . l.
w e p r e s en t a rl y establi sh e d its e 1992, 200 a te d a g a in m v times f',
a b rie fe d su lf s th t 3 a n d 200 an)
r v e y o{ S QaL 8 d 8.
1 1 .8 .1 P r o . e an a .
c e s s in g C o r d r e la ti o n a ~ bl~
p a b i\ it ie s o l d a tab a s e
t SQL la n g u at> ·
T h e SQL h a
s p r o v e d to
programme b
r s . It offers e a la n a
b y th e f o r a v a ri e ty~ f
m e r a n d th g e tha t _can
c a p a b il it ie s e m o r e co be used by s ,,-e\\ ;,
of SQL a re p ~ o c e s s m g c a p a b il it b o th c a su a
: 111
ie l u s e rs .; .d l t1
P ex b y th e s , s im p ler o 1f~
1 . D a ta
D e fi n it io n
Langua
la tt e r c la s s o f u s e rs .
n e s o f "'
Th e varl
\tis rt""\:
r e la ti o n sch 'D
emas, d e le ti ge , D L ) T
ng . h
re1ations,· c r e S Q L D D L p r
e a ti n in o ,i d e s coll1 rnll1'l:\~' t\'£-;v:
" · ': '
~- Embedde M#nWI
..."''"••
within gl'l1l'l'lll-purpose - -
nnd C', ( t ➔ l'll',
4. View Defiuition. 1hl' SOL DI )L 11l1m Includes cOffllNtA4'
5. A11t1,orl: 11tlo11 1 lw SOI. DDI. include~ commnnds for spedlyltls ...,. ..... to
relations ,1nd Vtl'WS.
6, Integrity. Tlw SQI. provides (limited) form s of lnlcgrHy checking. Future products and
stnndnrd s of SQI. are likely lo include enhanced features for integrity checvmg.
7. Transact/011 Co11trol. SQL inclt1dcs commands for specifying the beginning and ending
of lransacttons nlong with commands to have a control over transaction processin g.
The SQL commands covered later in this unit, include DDL commands also.
1l '"' " t If, If 1t, II l111 IHU 'Hn lt
I I iii ,11 tt ,1 lo lhl• 1/nioh h1•t111, Ii
1..11 1 dmll fl 1u1,111111 1,ci 111 •· '< 'o, ·1lf1t•, ,,II111 ), I~
1
11 )l\ I 11\ t 6 [I IL cl l111 dlllu, (lfll !% /JIJ/11,H 'JY C '[I~
I I 'o/1/
\J l I "'' ldt U\ \11\ lI '< I~
1
m I dh hlnl h1to 11 , (I II ll ) ( 11 , 11 111a111111
I I li 11 l\llmllh•ll l (IJMI ,) l u111111011d
1 1 11 11
1tl 11 t, Mnntpnlll1 m " 1 ::~'\ ( (;I,)
1
c
01 11111 111d
I I i•n t '1111 II •I ' nnn 11 / oI •m C:0111, of ~
I I( ,11111rn11dM ,,~
tHlff Ion t;Ol11,ol con, ,nond d , " ;.
( ) I II ' I lw lllll 111 H 1'11111
l "''''
I k 011
-..: ut '-'l th rn "'' 1 I llu• ump(• ol lhl 1 ,oo ,
't 6111 ,1'"
l\' ""' l\d thd, un lo 'L') o11l
l ,iA DL t 111111ands ,, ,,
(IX)! ) 1,11111111 r111 de, ris Ih,' 11,,11w But,1,cs1s, ,,flowYou~
l .ksl rdt l~dmllion
tt,1 I ,ngttWt'
to t!ot' dl•lh1 I tll\, ['.) lh~tW <0111111i1nd s, you c,n p~rfor011
Hf' 11 11fl ls' 1'1,·out1h
I ~ 11 •,,11111 ub'(ltfs,
(1)t) ·rti~n Ift,1,mttf tltl/J.c J I
1lilH Rflc•llon I
, ot Dl)J, comm<111dsC 1s cd
m u( 1
·"' fmt' oi \.: rnnHe, u,· \Jc
1 ,J ,, 1 , 11 "'o...J
l, \ ,lijl'dS such c,s n /11/J 1•, n Iv1,•10, on 111, ICl etc. REAfErr.,..
used 10 cac 111, ~, hcm,1 ubj,•>'lN, AL l'hl~ ro11111u11ic s ni-u 11sc, lo inod1fy or
r 11111101, of nh-c,1d1 1•xlRtl11g Ndwm,, nhj1•r1s ond IJl~OJ' rnnrnwnds are us~d to
1 11 1
0 -c •dicmn ohf1•ll~. Ho11w 1'\,t111plu~ 111' s111•h I li11 sin lco1e111 s are : CllEAT!·
ALTllR T \Ill I DRIW 'l'Alll F, ('!{HATH INDF\, ALTFI~ INDEX, DROP INDEX ,r
TABLE, lRllN\.' \l'h lllc,
(11) Gra 111 and 1cvo k,, pl'Ivllrgce nnd 1·0 lrN, 'l'h Is sc1'1i o11 o( I) I) L Co 11 un,mdi is Ul!I
or re, okc pc, 111 is<iuns ,,,. prM I,•gt'N Iu work ti po 11 sl'I 1c, 1111 ob j1•els, For cxnmpl~ aII!
C.IOlt) 11 ho o-en l~s n lnb f,, (s,t)' I11/J/1• I) b,•1·, 11ncs tlw ow 11,•r of ti w I, 1bI,'. The owner of I~
nllo1, ollwrs lo 11•ork on hls/lwr l,1bl,,, ThiN run be ,1chi,•wd by CIUNTing privilege for
~
to othe1 s, 1o l'!'1•okc nh ,,a dy r,tnli•d prlvll,•gcs, I{ EV o KE comm,md is used. fhi, ~
OOL commnnds is also k11uwn ,ts D11111 l'o11lm/ Lmtg11ng,• (DCL) Commands.
(111) ~talntenanct c_o1nn1ands, Thts s,•rtlon of DDI, c,mtm,inds is u<!•d i,'
lnfo1m :ion on ni_nble ''.'1lh n,'. ,lin1 of ntnint,1i11l11g ii. F,,unpl1•s ol t,1h[,, m,1i11t,•u,111cen~
ANAL\ZE IAllLI•, Cl lt·CK 'I'Alll.E. RFl'AIR T.\Jll E. Rl \STORF TAl!LE !'I<',
11 .8.3B DML Commands
B) d l mnnipulntfon, ,, c nwnn :
◊ Utu 1 /11 1 1/ of lnfo1111611011 ll'e .
61
~ tI,c m r, flou of new info, mnt.l l1. tn t11c dntnb,lsl' · ~
A Data ManlpU ~,
~ th\! dcfotio,r of infor1nntion t ton into th"c (inttl b\\SQ, (DML) Is u 1ansu11i! ,r,
user, to ucc:a". ~r~ ~
~ tht' mo t,r,r ,trou of dnta st rom the dnt ll l),lSl\
J • • or&'"' ,J
datn as i ta ni,\'I<'
111 the dnt b
1 ht" DML~ nre bnsknllv ot 1.( .. or~'-l
t ' '' lls~ . nppropriatc ta
., '", H,es :
(r) Prt. et'dw 11 DML.s i~quire ~·!
(i1) Non Prm'td11m/ DMts reg ll,User to spe.:1'f1• 11>/tat data is llt'()clc-.1 and '111 'I' ~l~• '
hm, lo j\l't It. Utre a llSl!r to SPf.'Clf) l<'lm/ d ti~ i• nr~d,•,f "llh•'''1
in a ,
statementD
LET Us REVISE
f
.~ illel:tion cl •ignny related data tables is called a _ _
CNpti --. .. of data is known as data _ _
of ml '" whelmrm • field can draw values, is called
--
• I I !'Ian. is celled •
--
• ntl :!Dn-..a:P i m
,. 7
--
aan)Uk-► iltcdedits
--
......... in .. I )1 liol, • a:Bie 4 tis
--
...--. .... ____
__. Nllttan ta .utd - -
tdad Nlltlonl ancl Unktd throql\
laa\Odll
of ciaia)., d;..iil ina:ms:s;ency. :mslU1Table data, unstandardized data, insecu1'e data, incotl'ect data etc. On the
oi..'1er hand, a database system overromes all these limitations and ensures continuous efficiency.
1he arl.vaTUages provided by a database system are :
(1) Reciuc:ed data redundancy (it) Controlled data inconsisten cy
(iii) Shared data (iv) Standardize d data
(u) Secured data (vt) Integrated data.
'Iberefore, to have the systems with increased performanc e and efficiency, the database systems are
p1efe11ed.
2. Can you think of disadvantages of using a datnbase system ? What are these ?
Solution. With the complex tasks to be performed by database systems, certain things may crop up
that may be termed as disadvantag es of using database system. These are :
1. Security may be compromis ed without good controls.
2. Integrity may be compromis ed without good controls.
3. Extra hardware may be required.
4. Performanc e overhead may be significant.
5. System is likely to be complex.
f- /
f.
~ &:aliag
~ tg
0
uag
,__. Rig
0, I g
Do;
♦t I
mltlt\Clt
for dlent llq\lllt l
according to thoae requeata and provld
7. 'vVlznt do yo11 1111dc,~tnnd by My Q
C.olutton . MySQL Clienh are program th.a cormecl M,sQL Wffflf and,. ._ •F •lel • •
pre-specified format Mv5QL is compatible wtth ttaalld.alllt '--1 9QL (91aa I ft ()Illy
Language). The client program may contact the server programmatkally «
manua lJ
8. MySQL provides some com111n11d line programs nnd GUI programs. Name somt oft~
Solutia11 Comma nd line program ms: mysqldump and mysqladmm
Gul program s : MySQL Administrator and MySQL QueryBrowser
9. Whnt is SQL ? What are different categories of commands available in SQL ?
<;elution In order to access data within the Oracle database, all program
s and users must use,
Structured Query Langua ge (SQL). SQL is the set of comma nds that is recogni
sed by nearly all
RDBMSs.
SQL comma nds can be divided into following categories :
1. Data Definit ion Langua ge (DDL) Comma nds.
2. Data Manipu lation Langua ge (DML) Comma nds.
3. Transac tion Control Langua ge (TCL) Comma nds.
4. Session Contro l Comma nds.
5. System Contro l Comma nds.
10. Write the full form of the following abbreviations : (i) DDL (ii) DML CBSE _ '.!oc;
Solution. (i) DDL : Data Definit ion Langua ge
(it) DML : Data Manipu lation Langua ge
11. Differentiate between DDL and DML commands.
Solution The Data Definit ion Langua ge (DDL) comma nds, as the name
suggest s, allow you to
perform tasks related to data definition. That is, through these comma nds,
you can perform tasks
like, create, alter and drop schema objects, grant and revoke privileges etc.
The Data Manipu lation Langua ge (DML) comma nds, as the name suggest s,
are used to manipu late
data. That is, DML comma nds query and manipu late data in existing schema
ob1ects.
GL O SSA R Y
-=:I