Académique Documents
Professionnel Documents
Culture Documents
for
P.C.C.
FLOWCHARTS
I ll ust rat io n: Com pute a nd p rint sim p le i nt e re st . START INPUT P,R,N I = P*R*N/100 PRINT I END P , R , N & I a r e va r ia bl es a s t he y c a n a s sume a ny v a l ue , i . e . , t he i r v a l ue i s not fixed.
LOOP
W he n s ome p or ti on of a p r og ra m i s t o b e e x ec ute d r e pe t it i ve l y , w e c r ea te a l oop . T hi s l oop ma y b e s e t a cc ord i ng t o t he ha p pe ni ng of c er ta i n c ond i t i on or i t ma y b e p r e se t f or s p ec i f ie d numb er of t i me s . L oop s e t a cc ord i ng t o t he ha p pe ni ng of c e r ta i n c ond i t i on A n i l l us t ra ti on: START INPUT P,R,N
I = P*R*N/100 PRINT I
C=1
M = N*C PRINT M
NO
C = C+1
COUNTER: A c ount er i s a va r i ab le us e d t o s t or e t he c ount of t he l oop . W he n t he c ou nt er r e a c he s t he p r e -s e t v a l ue , t he p r og ra m g e ts o ut of t he l oop . T he us e of t he c ount e r ma y b e o f t w o t y p e s - one f or p e r f or mi ng t he l oop a s p e ci f i ed n umbe r of t i mes a nd ot he r a s a v a r ia bl e f or c omp ut at i on p ur p ose . I n t he a b ove e xa mp le , a c ount er C ha s b e e n us e d a nd i t s e r ve s b ot h t he p ur p ose s. A CCUMULATOR: A me mory w hi c h i s us e d t o s t or e i nt er me di at e r e s ul ts d ur i ng t he e xe c ut i on of l oop i s c a l le d a cc umula tor . It i s g e ner al l y us e d f or c omp ut i ng c umul at i ve r e s ult s o f mat hemat ic al e x p re ss ion w i t hi n t he l oop . Ac c umul at or s a r e us ua l l y g i ve n a n i ni t i al va l ue 0 or 1 d e p e ndi ng u p on t he l og i c o f t he p r og ra m. I f t he a c c umul at or i s us e d t o a c c umul at e a s um, i ni t ia l v a l ue o f a c c umul at or i s g i ve n 0 . I f t he p r od uc t of a s e r ie s i s t o b e c omp ut ed , t he i ni t i a l v a l ue of a cc umula tor i s g i ve n a s 1 .
STOP H e r e , S ha s b e e n us e d a s a n a cc umula tor a nd i t s i ni t ia l v a l ue i s t a k e n a s 0 . A RRAYS : A va r ia bl e c a n s t ore a nd r e p re se nt o nl y one v a l ue . S ome t i mes i t i s r e q ui re d t o s t or e a l i s t o f va l ue s a nd r e f er t he n b y a c ommon na me . E . g . p r od uct i on of 12 mont hs of a ye a r i s a s e t of s i mi l ar i t e ms a nd w e w oul d l i k e t o us e t he s a me na me t o r e f e r t o t hi s l i st of v a l ues . W e ma y us e P 1, P 2 , . . . . . . P 12 a s va r i ab le na me s . T hi s e ns ur es t hat d i f f e r e nt v a r ia bl es b e l ong i ng t o s ame c l a ss a r e c a l le d b y a s i ng l e na me . E x amp le P . T he 1, 2 , 3, . . . . . . us e d i n t he a b ov e v a r i ab le s a r e c a l l ed s ub s cr ip ts a nd P 1, P 2 e tc . a r e s ub sc ri pt ed v a r ia bl es .
I ll ust rat io n: Dra w a f lo w chart t o a cce pt ma rks o f st ude nt s in si x s ub je ct s a nd p ri nt a v e ra ge m arks. STARTS READ M (X); X = 1,2, ---6 S=0 X=1 S = S + M(X) X = X+1
NO
So lve d P ro b lem s On F lo w chart s: Q1 . D raw a f lo w cha rt t o p rint t he hi ghe r o f a ny g iv e n t w o uni que num be rs. START
READ A, B
IS A > B? NO PRINT B
YES PRINT A
STOP Q2 . D raw a f lo w cha rt t o f i nd t he s um o f f ir st 1 00 o dd numb ers. START S=0 A=1 S=S+A A=A+2
NO
Q3 .
NO
STOP
A=A+1
NO
STOP
10
C=C+1
NO
11
Q6 .
S = S + C/[(C + 1) * (C + 2)]
C=C+1
NO
12
Q7 .
D raw a f lo w cha rt to ge ne ra te t he F ib o na cci numb ers: 1 ,1 ,2 ,3 ,5 ,8 ,1 3 , . . . , N t e rm s (i n t he F ib o na cci se r ie s, e a ch numb er i s e qua l t o t he sum o f t he p rev io us t wo num be rs). START
READ N FN = 1 SN = 1
PRINT TN FN = SN
SN = TN C=C+1
NO
IS C>N ? YES
13
14
H = Q1
YES H = Q2
YES H = Q3
15
C=C+1
16
IS Q < 400 ? NO
YES D=6
D=8
D = 10
D = 12
NO D = D-2
17
Q1 1 . D raw t he f lo w chart f o r f i nd ing t he a mo unt o f a n a nnuity o f R s. A i n N y e a rs, ra t e o f int e re st = r% , R = 1 + r a nd t h is am ount is g iv e n b y t he f o llo w ing se r ie s: S = A + AR + AR2 + . . . + A RN -1 START READ A, r, N R=1+r S=O C=O S = S + A * R ^C C=C+1
NO
STOP
18
Q1 2 . As sum e t ha t im po rt e d go o ds f rom f o re ign co unt rie s a re cla ss if ie d i nt o 4 ca te go rie s f o r t he p urp o se o f le v y ing cust o ms d ut y . T he ra t e f o r e a ch ca t e go ry i s a s f o llo w s: C la ss/Ca t e go rie s (K) Ca t e go rie s o f Goo ds C ust om Dut y (% ) On V a lue s o f Go o ds (V ) 1 Fo o ds, b ev e ra ge s 8 2 C lo t hing , f o o tw ear 12 3 He av y ma chine ry 15 4 Luxury it e m s 20 D raw t he f lo w chart f o r com put ing t he a p prop riat e cust o ms d ut y . START READ K, V
YES CD = 0.08*V
YES CD = 0.12*V
YES CD = 0.15 * V
19
Q1 3 . D raw a f lo w cha rt t o ca lcu la te t he co mm issio n o f a sa le s re p re senta t iv e b a se d o n t he f o llo w ing se t o f r ule s : ( i) I f t he sa le s is l e ss t ha n Rs .5 ,000 , t he re i s no co mm issio n. ( i i) I f t he sa le s is R s.5 ,000 o r a bo ve b ut le s s t han Rs .5 0,000 , t he n t he co mm issio n i s co mp ut ed @ 1 0% o f t he sa le s. ( i i i) I f t he sa le s i s R s.5 0 ,000 o r a bo ve , t he co mm issio n i s R s.5 ,000 a nd @1 2% o f t he sa le s a b ov e R s.5 0 ,000. P r int t he sa le s a nd t he co mm issio n. START READ S
IS S<5000 ? NO
YES C=O
C=0.10*S
PRINT S, C STOP
20
Q1 4 . T he p ro b lem is t o com pute , f o r a se rie s o f t ra nsa ct ions, t he gro ss sa le s (G) : t he q ua nt it y d is co unt s, (D) , if a ny ; a nd t he ne t sa le s (N ). T he ra w da t a t o b e s up p lie d i n t he p ro gra m i nc lude s t he q ua nt it y so l d (Q) a nd un it p r ice (P ). T he qua nt it y d is co unt s che dule is a s f o llo w s: I f qua nt it y so ld i s: T he d is co unt ra t e w o uld b e Le ss t ha n 1 ,000 unit s 5% 1 ,000 t o le ss t ha n 2 ,000 1 2 .5 % 2 ,000 a nd o ve r 2 0% START
READ Q, P
YES D=0.125*GS
NO
21
Q1 5 . D raw a f lo w cha rt t o com pute a nd p r int t he I ncom e-t a x a nd Surcha rge o n t he i nco me o f t he in di v i dua l. T he i nco me i s t o b e re a d f ro m t he t e rm ina l a nd t he t ax i s t o b e ca lcula t e d a cco rding t o t he f o llo w ing ra t e s: I ncom e ( in Rs .) Ra t e Up to 5 0,000 No tax Fro m 5 0 ,001 t o 6 0,000 1 0% of t he a mo unt e x ce e ds Rs .5 0,000 Fro m 6 0 ,001 t o 1 ,5 0,000 Rs .1 ,000 + 2 0% o f t he a mo unt a bo ve Rs .6 0,000 Abo ve 1 ,5 0,000 Rs .1 9 ,000 + 3 0% o f t he a mo unt a bo ve Rs .1 ,5 0,000 T he s urcha rge is l e v ie d @ 5% o n t he a mo unt o f t o ta l t a x , if t he i nco me e xcee ds Rs .6 0,000 START READ I
IS I 50000 ? NO IS I 60000 ? NO
IS YES I 150000 ? NO
T=1000+0.20*(I-60000) S=0.05*T
T=19000+0.30*(I-150000)
22
Q16.
Draw a flowchart to illustrate the following situation: Vishnu Limited calculates discounts allowed to customers on the following basis: Order Quantity Normal Discount 1 99 5% 100 199 7% 200 499 9% 500 and above 10% These discounts apply only if the customers account balance is below Rs.500 and does not include any item older than three months. If the account is outside both the limits, the above discounts are reduced by 2%. If only one condition is violated, the discounts are reduced by 1%. If a customer has been trading with Vishnu Limited for over 5 years and conforms to both of the above credit checks, than he is allowed an additional 1%.
START INPUT Q, C, I, T
IS YES Q < 100 ? NO IS YES Q < 200 ? NO IS YES Q < 500 ? NO D = 10 IS YES C < 500 NO
D=5
D=7
D=9
IS I<3 NO
YES
IS T>5
NO
YES
23
NO
NO
24
Q18.
A company has 5, 000 employees. Their salaries are divided in followin g categories: (i) Less than Rs.5,000 (ii) Rs.5,000 to Rs.10,000 (iii) Rs.10,001 to Rs.15,000 (iv) Above Rs.15,000 Draw the flowchart to find the percentage of the employees in each category. START
READ S(X); X = 1,2,3, ....., 5000 X=1 A=O B=0 C=O D=O
IS S(X)<5000 ?
YES
A=A+1
B=B+1
C=C+1
25
YES N=N+1
NO
IS X > 25 ?
26
STOP
DECISION TABLES
A d e c is i on t ab l e i s a t a b ula r p r es e nt at ion of p r ogr am l og i c . I t d i s p la ys a l l c ond i t i ons a f f ec ti ng a p ar t ic ul ar s i t ua ti on. I t g i v es a p p ropr i at e a c t ion or a c t i ons t o b e t a ke n f or e ac h s e t of c ond i t i ons . D e c is i on t ab l es a re us e f ul w he n a c omp ut er ha s t o mak e l a r ge numb e r o f d e c i si ons or i f t he re a r e a l a r ge n umbe r o f d i f f e re nt b r a nc he s w i t hi n a p r og ra m. Co mp onents o f a de ci sio n t a b le : Ta b le Hea ding Co ndit io n St ub Act io n St ub De cis io n Ru le s H ea ding Co ndit io n Ent rie s A ct io n Ent rie s
T ab le Hea ding : T he na me or numb er of t he D e c is i on Ta b le s p ec i f yi ng t he p r ob l em w hi c h i s b e i ng r e pr es ente d . F or c omp le x p r ob le ms , t he d e c is i on t ab l e i s s omet imes b r oke n i nt o p a r ts w he r e t he T ab l e he a d i ng w oul d i d e nt i f y t he p a r t of t he p r ogr am b e i ng r e p re se nt ed . Co nd it io n St ub : T he c ond i t i ons t ha t c oul d e x i s t i n t he p r ogr am l og i c a r e d e s cr ib ed . A ct io n St ub : T he a c t i on s ta te me nt s or p os s ib l e o ut c omes of t he s y s te m a re d e s cr ib ed . De ci sio n Ru le s: T he se may b e one or mor e d e c i si on r ul e s numb e re d 1 , 2 , 3 . . . . n r e p re se nt i ng t he a nsw er s t o t he C ond i t i on St ub a nd Ac t i on St ub d e s cr ib ed b e f ore .
27
T he f ina l de c is io n t a b le w o uld a p pe ar a s b e low : T ab le H ea di ng D ec i si on R ul e ( R 1) D ec i si on R ul e ( R 2 ) i.e. a u ni q ue i . e . a u ni q ue c omb i nat i on o f c omb i nat i on of `c ond i t i ons a nd ` c ond i t i ons a nd `a ct i ons ` a ct i ons C ond i t i on S t ub : C ond i t i on E nt r y C ond i t i on E nt r y i.e. if t he se i . e . if t he se c ond i t i ons e x i st c ond i t i ons e x i st (Ye s ) /not e x i st (Ye s ) / not e x i st (N o) (N o) C1 Ye s /No Ye s / No C2 Ye s /No Ye s / No C3 Ye s /No Ye s / No ..... ..... ..... Ac t i on S t ub : Ac t i on E nt r y i . e . Ac t i on E nt r y i . e . t he n t he f ol l ow i ng t he n t he f ol l ow i ng a ct i ons r e s ult a ct i ons r e s ult (X ) / not r es ul t ( - ) (X ) / not r es ul t ( - ) A1 X / X / A2 X / X / A3 X / X / ..... ..... .....
D ec i si on (R . . . . . )
R ul e
C ond i t i on E nt r y i.e. if t he se c ond i t i ons e x i st (Ye s ) / not e x i st (N o) Ye s / No Ye s / No Ye s / No ..... Ac t i on Ent r y i . e . t he n t he f ol l ow i ng a ct i ons r e s ult (X ) / not r es ul t ( - ) X / X / X / .....
T y pe s o f De cisio n Ta b le s: L im it e d Ent ry De cisio n T a b le : T he C ond i t i on St ub s a nd Ac t i on St ub s a r e e xha us t i ve l y d e f i ne d . T hi s mea ns t ha t t he c ond i t ion e nt r y ma y c ont a i n e i t her `Ye s r e p re se nt i ng e x i s te nce of c ond i t i on or ` No r e p re se nt i ng n on e xi st e nc e of c ond i t ion. In t he s a me ma nne r t he a c ti on e nt r y may c onta i n a `X r e p re se nt i ng e x ec ut i on o f a p ar t ic ul ar a ct i on or ` r e p re se nt i ng t ha t p a rt i c ula r a c t i on i s n ot t o b e e x ec ute d . I ll ust rat io n. A c ompa ny a l l ow s c r e d it t o i t s c us t ome rs i f t he y a r e f r om l oc a l c i t y a nd c a n e i t her p r ovi d e s ur et y or ha v e g ood c r e di t w or t hi nes s.
28
Gr a nt C r ed i t
De t e rm ine t he p o ssib le num be r o f ru le s. I f t he re a re N numb er o f co nd it io ns, t he re a re 2 N numb er o f p o ssib le ru le s. I n t he p re se nt ca se t he re a re 2 3 p o ssib il it ie s. i . e . 8 p o ssib il it ie s D raw t he t a b le w it h st ub s a nd re qu ire d numb er o f e nt ry co lum ns. i . e . co lum n f o r ru le s. F il l t he co nd it io n e nt rie s us ing ha lf r ule . Fo r e a ch co lum n e nte r t he co rre spo nding a ct io n o r a ct io ns t o b e t a ken. Sc rut ini se t he t a b le t o f in d if a ny o f t he ru le s ca n b e e l im inat ed. 1 2 Y Y N X DECI SI ON RULES 3 4 5 6 Y N Y X Y N N X N Y Y X N Y N X 7 N N Y X 8 N N N X
4. 5. 6. 7.
A LLOWI NG C REDIT FACI LIT Y CONDIT I ONS: C 1: L OC AL C IT Y C 2 : P R OVID E SU R ETY C 3 : GOOD C R ED IT W ORT HINESS A CT IONS: A1 : GR ANT C R ED IT A2 : R EFU SE C R ED IT Y Y Y X -
I f w e ob s er ve r ul e s 1 & 2, w e f i nd t ha t i f C 1 & C 2 a r e ` y , i t i s i r r e le va nt w he t her C 3 i s ` y or `N a s i t d oe s not a f f ec t a c t i on. S o r ul e s 1 & 2 c a n b e c omb i ne d . Al t e r na ti ve ly, r ul e s 1 & 3 c a n b e c omb i ned i n w hi c h c as e C 2 b e c ome s i r r e le va nt . Ag a i n, ob se r ve r ul e s 5, 6, 7 & 8 . If C 1 i s ` N , a c t ion i s a l w ay s t he s ame a nd i s not a f f e ct ed b y C 2 & C 3. Ab ove T ab le : R1 R2 R3 R4 R5 R6 R7 R8 New Table R1 R2 R3 1 CONDIT I ONS: C 1: L OC AL C IT Y C 2 : P R OVID E SU R ETY C 3 : GOOD C R ED IT W ORT HINESS A CT IONS: A1 : GR ANT C R ED IT A2 : R EFU SE C R ED IT Y Y X R4 DECI SI ON RULES 2 3 Y N Y X Y N N X 4 N X
29
4 E L S E R EFU SE
30
31
2
Any amount Govt. Others
X X X X X X X X
32
1. 2. 3. 4. 5. 6. 7.
1. 2. 3.
33
W hi l e i nvoi c i ng e a c h c us t omer , t he c l e r k ha s t o w or k out t he d i sc ount a l l ow ab le o n e ac h or d er . A ny or d er a b ov e R s . 20 , 0 00 a tt ra ct s a b ul k d i s c ount o f 8% . A c us t ome r w i t hi n t he t r ad e i s a l l owe d 1 0 % . T her e i s a l s o a s pe c ia l d i sc ount o f 5% a l l owe d f or a ny c us t ome r w ho ha s b e e n or d er i ng r e g ul ar l y f or o ve r 5 ye ar s . D i sc ount P r oce ss ing 1 2 3 4 5 6 7 8 Co ndit io ns Or d er va l ue -more t ha n R s . 20, 000 Y Y Y Y N N N N C us t omer w i t hi n t he t r ad e Y Y N N Y Y N N C us t omer or d e ri ng r e g ula rl y f or ov e r 5 Y N Y N Y N Y N y e ar A ct io ns: D i sc ount N IL X D i sc ount 5% X D i sc ount 8% X D i sc ount 10% X D i sc ount - 13% X D i sc ount 15% X D i sc ount -18% X D i sc ount -23% X
2.
34
b e c onv e r te d
2 N Y -
3 N N Y X
4 N N N X
35
5.
A f i r m k e ep s d e t ai ls of t he b i l l s r a i se d on c us t omer s i n a c omp ute r f i l e . T he r e c or d ha s f ol l ow i ng d a ta f i e l d s : C us t ome r na me , T yp e (D e a l er / Ot he r) , B i l l numb e r , B i l l d a ta , Amount , D a te o f P a yme nt . I f a C us tome r p a ys t he b i l l w i t hi n o ne mont h, he i s a l l ow ed 10 % d i sc ount . I f he p a ys w i t hi n 1 t o 2 mont hs , n o d i sc ount i s a l l ow ed . If he p a ys a f t er 2 mont hs , p e na l i nt e re st 10% a s c ha rg ed f r om hi m. I f t he c us t ome r i s a d e a le r , t he n t he c or re sp ond i ng d i sc ount & i nt e re st r a te s a r e 1 5% , 0 , 1 0 % r e s pe ct ivel y. D i sc ount /i nte re st p r oc es si ng Co ndit io ns C us t omer i s a d e a le r P a ys t he b i l l w i t hi n one mont h P a ys b i l l i n 1- 2 mont hs Act io ns: D i sc ount - Ni l D i sc ount -10% D i sc ount -15% P e na l Int e r es t -10% 1 Y Y 2 N N 3 N Y X X X 4 N Y X
6.
A C omp a ny p r ovi d es h ome d e l i ve ry f or i t s p r od uct s a nd b i l l s d e l i v e ry c ha r ge s a cc ord i ng t o t he d i s ta nc e a nd t he a mount of t he b i l l . I f t he d i s t ance of c us t ome r a nd c omp a ny s o f f i c e i s l e s s t ha n 5 K M , n o d e l i v er y c ha r ge s a r e l e vi e d . I f t he d i st a nc e i s more t ha n 5K M b ut l e s s t ha n 1 5K M , t he d e l i ve ry c har ge s a re 2 % of t he b i l l a mount . H owe ve r , i f t he b i l l a mount i s more t ha n R s . 100 0 t he n a c onc e ss iona l r a te of 1% i s l e v i e d . If t he d i s t ance i s more t ha n 1 5K M , t he d e l i v er y c ha r ge s a r e 5% b ut i f t he b i l l a mount i s mor e t ha n R s . 10 00 / - t he n 2 % d e l i v e ry c har ge s a r e l e v i e d . D e l i ve ry C har ge s p r oc es si ng 1 2 3 4 5 Co ndit io ns: D i st ance -Le ss t ha n 5KM Y N N N N D i st ance -M ore t ha n 5KM b ut l e ss t ha n 1 5K M Y Y N N B i l l Amount -U p t o R s . 1000 Y N Y N Act io ns: D e l i ve ry C har ge s -N IL X D e l i ve ry C har ge s -1% X D e l i ve ry C har ge s -2% X X D e l i ve ry C har ge s -5% X -
36
37
38
Funct io ns o f DB MS A DB MS p e rf o rm s t he f o l lo w ing se rv ice s :1. T ra nsa ct io n p ro ce ssing: A t ra nsa ct ion i s a s e q ue nce o f d at ab as e op e r at ions t hat r e p re se nt s a l og i ca l un i t of w or k . In ot he r w or d s, i t r e p re se nt s a c ce ss i ng a d a t ab as e r e c ord a nd up d a ti on, mod i f i ca ti on, d e l e t ion e t c . t he r e of . Co ncurre nt Ma na ge r: A D BM S a ct s a s a c onc urr e nt ma na ge r w hos e f unc t i on i s t o c o -or d i na te t he a c t i ons o f d a t ab ase ma ni p ula ti on p r oce ss es op e r at i ng c onc ur r e nt l y w hi l e ma i nt ai ni ng t he c ons i st e nc y o f t he s ha r ed d a t a a t t he s a me t i me . Re co ve ry : T he r e c ove ry mec ha nis ms b ui l t i nt o D BM S e ns ure t ha t t he d a t ab ase i s r e t ur ned t o a c ons is te nt s ta te a f t er a t ra nsa ct ion ha s f a i l e d or ha s b e e n a b ort ed . Se curit y : Se c ur it y r e f er s t o p r ot ec ti on of d a t ab ase f r om a cc es s b y u na ut hor iz ed us e rs . T he s e c ur i t y l e v e l s c a n b e v a r y i ng f or d i f f e r e nt us e rs p r ovi d i ng d i f f e re nt a cc es s p r i v i l eg es s o t ha t t he op e ra ti ons p e r f ormed a r e moni t ore d a nd c ont r ol le d b y t he D B M S a cc ord i ng ly . La nguage I nt e rf a ce : T he D BM S p r ov i d es a n i nt e rf ac e w he r eb y t he us e r s o f d a ta ba se c r e at e a w or k i ng e nv i r onme nt w i t hout w or ry i ng a b out t he p hys i c al i mp l ementa ti on. T hi s i s ma de p os s ib le b y t he d a ta d e f i ni t i on l a ng ua ge a nd d a ta ma ni p ula ti on c omp one nt s o f t he D BM S. Da t a Ca ta lo g: D at a D i c t ionar y or Sc he ma c ont a i ns d e s cr ip ti ons a b out d a t a, r e la ti ons hip s a nd c ons t ra i nt s w hi c h c a n b e e nq ui r e d i nt o t o g e t i nf or ma ti on a b out t he s tr uct ure o f t he d at ab as e. St o ra ge Ma na ge r: D B MS p r ov i d e a mec ha nis m f or t he ma nag ement of p e r ma ne nt s t or ag e o f d at a . T he i nt e r na l s c hema d e f i ne s how t he d a t a s houl d b e s t or ed b y t he s t ora ge ma nag er w hi c h i nt er f ac es w i t h t he op e r at i ng s ys te m t o a cc es s t he p hy s i c al s t ora ge .
2.
3.
4.
5.
6.
7.
39
Co mp onents o f DB MS A D B M S he l p s a p r og ra mmer t o c onc e ntr at e o n t he p r ogr am l og i c w i t hout w or r yi ng a b out t he or g a ni za ti on o f d a t a or l oc at i on of d at a . Al l t he d a ta ne e d ed b y a n a pp l i ca ti on p r og ra m c a n b e a cc es se d r e ga rd le ss of t he a c ce ss met hod , r e c ord l oc a ti on or r e c ord c ont e nt . M os t of t he D B M S us e a us e r -f r i e nd l y q ue r y l a ng uag e a nd a l s o a r e a b le t o i nt e r ac t w i t h c ommonl y us e d h i g h l e ve l l a ng uag es .T he p r i nc ip al c omp one nts of a D BM S p e r f or m d i f f e r e nt f unc t i ons a s f ol l ow s , a nd f orm a s y st em c ol l ec t i ve l y : 1. Da t a De scrip t io n Mo dule : T he l i nk b e tw ee n t he l og i ca l v i e w a nd t he p hy s ic al r e c ord i s c a l l ed a s D a ta D e f i ni ti on a nd t he l a ng uag e i s c a l l ed a s D a ta D e f i ni t i on La ng ua ge . A d a t a d e f i ni t i on l a ng uag e ( D D L) i s us e d t o d e f i ne t he d a ta ba se c onc e pt ual s c he ma . I t d e f i ne s w ha t t y p e o f d a ta i s i n t he d at ab as e a nd h ow i t i s s t r uct ure d. In mos t D BM S, t he D D L a l s o d e f i ne s us e r v i e w s a nd , s omet imes , s t or ag e s t r uct ure s. T he d a ta d e f i ni t i on o f d a t ab as e or t he l og i c al s tr uct ure i n w hi c h a n a p p l ic at ion p r og ra m vi e ws a d a t a i s c a l le d a s Sc he ma . Sc he ma a l s o i nc l ud es a n i nd i ca ti on o f t he l og i ca l r e la t ions hip s b e t we en v a r i ous c omp one nts of t he d a ta ba se . Si nc e t he re c a n b e ma ny us e r s a nd a p p l ic at ion p r og ra ms us i ng t he s ame d a ta ba se , ma ny d i f f er e nt ` us er v i e ws c a n e xi st . T he s p e ci f i c s e t of d a t a r e q uir ed b y e a c h us e r or e a c h a p p l ic at ion i s c a l l ed a s Sub -s c hema. Al l t he Sc he ma a nd Sub -s c hema a re ma i nt ai ned & d oc ume nt ed i n a D a ta D i c t i ona ry. Al l t he d a t a r e q uir ements a nd t he d at a d e f i ni t i ons of a pp l i ca ti on p r og ra ms a re r e f er re d t o D a ta D e sc ri pt i on M od ule , w hi c h a na l y se s t he r e q ues ts a nd a cc ord i ng l y t r a nsf er s c ont r ol t o D at a M a nip ul at ion M od ul e . 2. Da t a Manip ula t io n Mo dule : T hi s mod ule i s us e d w i t h h i g h l e v e l l a ng uag es t o q ue r y t he c ont e nts of t he d a ta ba se , s t or e or up d a te i nf or mat ion i n t he d a ta ba se a nd d e v el op d a t ab ase a p p l ic at ions . A D at a M a nip ul at i on La ng uag e ( D M L) i s us e d f or s pe c i fy i ng d at ab as e r e t r ie va ls a nd up d at es . DML can be h i g h-l e v e l (s e t -or i e nt ed , n onp r oce d ur al ) or l ow -l e ve l ( r e c or d -or i e nt ed , p r oce d ur al ) . A h i g h-l e ve l D M L c a n b e e mb ed de d i n a h os t p r og ra mmi ng l a ng ua ge , or i t c a n b e us e d a s a s t a nd -a l one q ue r y l a ng ua ge . T he ut i l i t i e s a v a i la bl e t hr oug h t he D M L f or d a ta p r oce ss ing s uc h a s r e tr i ev al , s or t i ng , d i s p l ay , d e l e t ion o f d a ta /re cord a r e c ont a i ne d i n t hi s mod ule . I t c a n b e f ur t he r c l a ss if i ed a s f ol l ow s : a. Ap p l icat io n de ve lo pm ent ut i li t i e s: Se t of p r ogr ams d e si g ne d t o he l p d e ve l opment of a p pl i ca ti on p r og ra ms us i ng t he d a t ab ase . T he a p p l ic at ion g e ne ra tors a ut oma ti ca ll y p r od uc e d a t a e nt r y s cr ee ns , r e p ort s a nd a me nus s ys te m f or e nd us e r s t o us e .
40
b.
c. d. e.
Ho st La ngua ge I nt e rf ace : T hi s p a r t i s r e sp onsi b le f or c ommuni ca ti on w i t h a p p l ic at ion p r ogr ams a nd i nt e rp re ts t he i ns t r uc ti ons r e ga rd i ng d a t a r e q ui re me nt s r e c e ived f r om H i g h Le v e l La ng uag e a pp l i ca ti on p r og ra ms s o t ha t n e c es sa ry d a ta c a n b e r e tr i ev ed . B a ckup , Arch iv e & Re cov e ry ut il it ie s : T ool s t o ma ke c op i e s , r e tr i ev e , r e s ta rt , a nd r e c over t he d a ta ba se c ont e nts . Re p o rt Writ ing ut il it ie s: A us e r -f r i e nd l y i nt er f ac e a l l ow i ng us e rs t o c r e at e c us t omi ze d r e p or ts w i t hout w r i t i ng a n a p p l ic at ion p r ogr am. Na t ura l La nguage I nt e rf ace o r Que ry La nguage I nt e rf a ce : U se rs c a n c r e at e, vi e w , mod i f y, a c ce ss d a ta f r om t he d a ta ba se a nd a l s o a s k s pe c ia l q ue s t i ons r e la ti ng t o t he d at ab as e, t he a nsw er s of w hi c h a r e n ot a va i la bl e i n t he f or ma tt ed r e p ort s, us i ng a s i mp l e Eng l i s h-l i k e Que r y La ng ua ge . Application Program Data Description Module Data Manipulation Module
Data Base
Output
1.
2.
3.
4.
Re a sons f o r us ing DB MS D B M S a r e e xp e ns i ve t o c r ea te i n t e r ms of s of tw ar e, ha r dw ar e, a nd t i me i nve st ed . A q ue s t i on i s o f t e n a s ke d t ha t w hy D B M S i ns te ad of d a ta i n f l at f i l es ( w hi c h can be e d i te d /mod i f ie d us i ng w or d p r oc es sors or s p r ea ds he et s) . T he re a so ns w hy DB MS a re p re f e rre d o v e r t he f la t f il e s a re a s f o llo w s: Mu lt ip le u se rs- M ul t i p le us e rs of d a t a a ct ua ll y i mp l i es mul t i p l e d a ta up d a te rs . A D BM S p e r mi ts mul t i p l e , c onc ur re nt up d at es a nd / or i ns er ti ons , a nd w i l l g uar a nt ee t ha t e a c h t r a ns ac ti on c ommi ts w he re as t hi s f a c i l i ty i s n ot a va i la bl e i n f l a t f i l e s yst em. Re duce d Re dunda ncy & I nco nsist e ncy One c op y of d a ta r e d uce s r e d und a nc y a nd i nc ons i st ency . A D BM S c a n ma nag e c ons is te ncy b e t te r a nd c a n e nf or ce a dd i t iona l c ons tr ai nts . I n a f l a t f i l e , i t w oul d b e up t o t he d i s c ip l i ne of t he us e r s t o e ns ur e t ha t t he i r e d i t s d i d not v i ol at e t he c ons i st e nc y of t he d a t ab ase . Co nf ide nt ia lit y , p r iv a cy , a nd se curit y In or d e r t o p r e se rv e t he c onf i d e nt ia l it y a nd p r i va c y o f i nd i v i d ua ls , a cc es s t o d at a i s of t e n r e s tr ic te d. I n t he f l a t f i l e mode l , w e c a n us e f i l e -l e v e l s ec ur it y t o p r e ve nt a c ce ss t o c e rt ai n f i l e s . A D B M S h ow e ve r, ha s f i ne r l e v e l s e c ur i ty a nd c a n p e r mi t or r e s tr ic t a cc es s t o v e r y f i ne -g r a i ne d c hu nk s of d a ta . St a ndards ca n b e e nf o rce d A D B MS c a n ma ke s ur e t ha t c omp le te i nf or ma ti on i s e nt er ed a b out a p ar t ic ula r f a ct a nd c a n e nf or ce l i mi te d
41
Re a sons f o r no t usi ng DB MS T he r e a r e b as ic al l y t w o s i t ua t i ons w he n t he us a ge of D a ta ba se M a nag ement Sys t ems b e c omes a n op t i on. T he f i r s t i s t he c ost f a ct or . M a i n c os ts of us i ng a D BM S i nc l ud e hi g h i ni t i a l s e t up c ost , p os s ib l y c ost o f e xt ra ha r d wa re , c os t of e nt e r i ng d a ta , c ost o f t ra i ni ng p e op le t o us e D B M S a nd c ost o f ma i nt ai ni ng D BM S. T he s e c ond s i t uat i ons w he n a D BM S ma y b e u nne c e ss ar y i s i f a c ce ss t o d a ta b y mul t i pl e us e rs i s n ot r e q ui re d a nd d at a s e t i s s mal l or i f d at ab as e a nd a p p l i ca ti on a re s i mp l e , w e l l d e f i ne d , a nd n ot e xp ec te d t o c ha ng e . B e nef it s & L im it at io ns o f DB MS T he a dva nt ages o f a DB MS o ve r t he co nv ent iona l f il i ng sy st e ms a re a s f o llo w s:D a ta i nt e gr at ion a nd s har i ng r es ul ts i n r e d uc ed d at a d up l i c at ion a nd d a ta r e d und a nc y s i nc e e a c h l og i c al d at a i t em i s s t or ed i n one p l ac e . T he D B A us e s s e c ur i ty s ubs y st em p r ov i d ed b y D BM S t o s p ec i fy a cc ount r e s tr ic ti ons f or p r e ve nt i ng una ut hor i ze d a cc es s. T he D B M S p r ovid es p e rs is te nt s t or ag e f or p r ogr am ob j e ct s a nd d a t a s t r uct ure s w he re by ob j e ct s s ur v i v e t he t e r mi nat ion o f p r ogr am e x e c ut i on a nd c a n l a t er b e r e t ri e ve d . D B M S p e r mi ts i nf e r e nc i ng a nd a c ti ons us i ng R ul e s . It ha s t he c a pa bi l i ty f or d e f i ni ng d e d uc ti ve r ul e s f or i nf e re nc i ng ne w i nf or mat ion f r om t he s t ore d d a ta ba se f a ct s . M ul t i p l e U se r I nt e r f ac es a r e p r ov i d ed t o s at is f y us e r s w i t h v a r y i ng l e v e l s o f t e c hni ca l k now l e dg e . T he us e r -f r i e nd l y f e a t ur es o f a D BM S mak e i t p os s ib l e f or a n or d i nar y p e r son w i t h mi ni ma l k now l ed ge o f c omp ut er s & p r og ra mming l a ng ua ge s t o us e t he d a ta ba se. D B M S ha s t he c a pa bi l i ty t o r e tr i ev e a nd up d at e r e l at ed d a ta e a s i ly a nd e f f i c i e nt l y b y r e pr es ent i ng c omp l ex r e l a ti ons hip s a mong d a t a. D B M S mak es e nf or c i ng d a ta i nt e g ri t y c ons tr ai nts p oss i b le b y s pe c i fy i ng a d a t a t yp e f or e ac h d a ta i t e m. A D BM S mus t p r ovi d e f a c i l i ti es f or b ac k up a nd r e c ov er i ng f r om ha r d wa re or s of tw ar e f a i l ur es . T he c ha nce s of e r r or i n d at a p r oce ss ing a nd up d at i ng a r e mi ni mi ze d . T he i nd e pe nde nce of p r og ra ms a nd d a ta r e s ul ts i n l e s se r r e q ui re me nt f or a p p l ic at ion p r ogr ams. T he no n-r e c urr i ng a nd a d -h oc i nf or mat ion r e q uir ements a r e met b y t he us e o f q ue r y l a ng uag e f e at ure o f t he D BM S T he D BM S a dd s t o t he f l e xi b i l it y i n d e s i g ni ng a nd c re at i on of us e r -s p ec i f ic r e p ort s. T he i ns ta l la ti on of D BM S i mp l ie s s a v i ng i n s t ora ge s p ac e & op e r at ion c os ts .
1. 2. 3. 4. 5.
6. 7. 8. 9. 10. 1 1. 12. 1 3.
42
1.
2. 3. 4. 5.
43
44