Вы находитесь на странице: 1из 17

Informatics Practices (065) Sample Question Paper 1 Note 1. 2. 3. .

This question paper is divided into sections Section A consists 30 marks. Section B and Section C are of 20 marks each Ans!er the questions after carefu""# readin$ the te%t.

Section A & 1. Ans!er the fo""o!in$ questions 'a( )%p"ain the fo""o!in$ terms*

i. ii.
'-( 'c( &2

Share!are +,+

&3

.rite the essentia" components of S/0C usin$ a samp"e case stud#. )%p"ain the term /ata 1ode"in$. .hat does 210 mean3 4ive the name of t!o commercia""# avai"a-"e packa$es supportin$ 5-6ect 1ode"in$ Technique. Ans!er the fo""o!in$ questions 'a( .rite names of an# t!o popu"ar 7e"ationa" /ata-ase 1ana$ement S#stems. '-( /efine S&0. )%p"ain S&0 su-cate$ories $ivin$ at "east one e%amp"e command in each cate$or#. 'c( /ifferentiate -et!een /ecision Contro" and 0oopin$ Contro" Structure in conte%t !ith +08S&0 Ans!er the fo""o!in$ questions 'a( .hat is an )vent3 Name an )vent /riven pro$rammin$ "an$ua$e. '-( /ifferentiate usin$ a suita-"e e%amp"e9 -et!een 1s$Bo% '( and :nputBo% '( functions in ;isua" Basic 'c( /ifferentiate -et!een a A/5/B pro6ect reference and A/5 /C in a form usin$ suita-"e )%amp"e

Section B & 7ead the fo""o!in$ case stud# and ans!er the questions that fo""o!s 1r Nath of &uick So"ution Soft!are Corporation has $ot requirement of a Soft!are +ro6ect from a Customer in Tours and Trave" Business. ,e performed the pre"iminar# ana"#sis and found that soft!are App"ication shou"d -e -ased on C"ient8Server techno"o$#. ,e opted for ;isua" Basic 0an$ua$e to deve"op the front end. 4iven -e"o! is one of the forms to enquire a-out rai"!a# reservation. Carefu""# o-serve the fo""o!in$ picture.

Object !pe $orm %abel

e&t Bo&

Object "ame frm)nquir#<orm "-"5ri$inatin$Station "-"/estinationStation "-"/ate5f=ourne# 0-"// 0-"11 "-">>>> t%t5ri$inatin$Station t%t/estinationStation T%t// t%t11

#escription The 1ain <orm 5-6ect

t%t>>>> cmdCheckStatus cmdC"ose1e The 0ist for the a-ove form is as fo""o!s* 'omman( Button 'a( '-( 'c( 'd(

To enter a strin$ t#pe va"ue To enter a strin$ t#pe va"ue To enter a /ate To enter a numeric va"ue of month To enter a numeric va"ue of >ear To check Status of Ticket Avai"a-i"it# To c"ose the form frm)nquir#<orm

.rite the va"ue for the Caption propert# of the 5-6ect cmdCheckStatus. .rite the code snippet for cmdC"ose1e Command Button if it is required to c"ose the form on its C"ick event. .rite a code snippet to a""o! the user to restrict a"pha-ets in the // fie"d. .rite a procedure to check for the va"idit# of the entered date va"ue. C"ear the te%t -o%es for inva"id date va"ue and set the focus on t%t//.

1 1

&? 'a(

<ind the output of the fo""o!in$ !hen the command -utton !ith caption command1 is c"icked* DIM X as integer PRIVATE SUB command1_click( PRI!T "#ello$ %A&& 'irst(() PRI!T "B*e$ E!D SUB PRIVATE SUB 'irst(!+m as Integer X , 1PRI!T X PRI!T !+m.X End s+/

'-(

7e!rite the fo""o!in$ code usin$ S)0)CT.. CAS) !ithout effectin$ the output of the code*

DIM Total as I!TE0ER Total , VA&(te1t12te1t I' Total 3, 4) T#E! 0rade , "A$ E&ESEI' Total 3,)- T#E! 0rade , "B$ E&SEI' Total 3, 55 T#E! 0rade , "%$ Else 0rade , "D$ End i6
'c( 7e!rite the corrected code after removin$ s#nta% errors from the fo""o!in$ ;B Code* DIME!SI7! Total AS I!T Total,5-2D7 8#I&E Total3,9Total,Total:) End Do PRI!T Total Rewrite the following code using FOR..NEXT without effecting the output: 2

'd(

Dim !+m As Integer !+m , 1 D7 8#I&E !+m ;, ) !+m , !+m < 1 PRI!T n+m = &77P
'e( .rite the output that the fo""o!in$ code se$ment 2

Msg , >Tec?nolog*> PRI!T MID(&TRIM(Msg @1@( < > and > <> Aids> PRI!T (5 3 B . 9 A!D (5 C 9 ; 1PRI!T VA&(>1-- 8a*s> < &E!(Msg PRI!T I!STR(Msg@>log>

Section ' @ Ans!er the questions '!ith respect to S&0 and +08S&0( 'a( .rite a S&0 '//0( quer# to create the fo""o!in$ ta-"e )mp"o#ee
'olumn "ame )mp:/ )mpName )mpAddress )mp+hone )mpSa" #ata !pe N21B)7 ;A7C,A72 ;A7C,A72 ;A7C,A72 N21B)7 Si0e @ 20 30 10 D92 'onstraint +7:1A7> C)> N5T N200 #escriptiom

'-(

.rite +0 8 S&0 Code to increase the sa"ar# of a"" the emp"o#ees -# some percenta$e amount accepted from the user 'c( .rite pro$ram code to dec"are and use an )%p"icit Cursor to disp"a# the Sa"ar# increased -# 10A Assume that #ou are provided !ith the fo""o!in$ t!o ta-"e able) #ept #*P "O #"A+* %O' 10 ACC52NT:N4 N). >57C 20 7)S)A7C, /A00AS 30 SA0)S C,:CA45 0 5+)7AT:5NS B5ST5N able) *mp *+P"O *"A+* ,OB +-. /I.*#A * SA% 'O++ #*P "O B3@D S1:T, C0)7C BD02 1BE/ecEF0 F00 20 B DD A00)N SA0)S1AN B@DF 20E<e-EF1 1@00 300 30 B?21 .A7/ SA0)S1AN B@DF 22E<e-EF1 12?0 ?00 30 B?@@ =5N)S 1ANA4)7 BF3D 02EAprEF1 2DB? 20 B@? 1A7T:N SA0)S1AN B@DF 2FESepEF1 12?0 1 00 30 B@DF B0AC) 1ANA4)7 BF3D 01E1a#EF1 2F?0 30 BBF2 C0A7C 1ANA4)7 BF3D 0DE=unEF1 2 ?0 10 BBFF SC5TT ANA0>ST B?@@ 0DE/ecEF2 3000 20 BF3D C:N4 +7)S:/)NT 1BENovEF1 ?000 10 BF T27N)7 SA0)S1AN B@DF 0FESepEF1 1?00 0 30 BFB@ A/A1S C0)7C BBFF 12E=anEF3 1100 20 BD00 =A1)S C0)7C B@DF 03E/ecEF1 D?0 30 BD02 <57/ ANA0>ST B?@@ 03E/ecEF1 3000 20 BD3 1:00)7 C0)7C BBF2 23E=anEF2 1300 10 The ta-"e structure are able) #ept Co"um Name /ata T#pe SiGe Constraint /escription /eptNo Num-er 2 +7:1A7> C)> /name ;A7C,A72 10 N5T N200 0oc ;A7C,A72 10 able) *mp Co"um Name /ata T#pe SiGe Constraint /escription

)mpNo )name =5B 147 ,:7)/AT) SA0 C511 /)+TN5 'a( '-( 'c(

7eferences /eptNo fie"d of /ept Ta-"e Create a ;ie! on the a-ove ta-"es to sho! )name9 /name9 =o- and Sa" of an emp"o#ee !hose department num-er is either 10 or 20. .rite a S&0 <unction to return Bonus9 !hich is ca"cu"ated as 20A of the amount passed. A"so $ive an e%amp"e of its use on co"umn Sa" of )mp ta-"e. .rite the +08S&0 code to create a stored procedure 7aiseHSa"ar# to increase sa"ar# of an emp"o#ee !hose )1+N5 and Sa"H+ercenta$e is passed as :N mode ar$ument and !i"" a"so disp"a# the chan$ed va"ue.

Num-er ;A7C,A72 ;A7C,A72 N21B)7 /AT) N21B)7 N21B)7 N21B)7

10 10 'B92( 'B92( 2

+7:1A7> C)> N5T N200

<57):4N C)>

Informatics Practices (065) Ans1erin2 Sc3eme 4 Sample Question Paper 1 Note ?. This question paper is divided into sections @. Section A consists of 30 marks. B. Section B and Section C are of 20 marks each F. Ans!er the questions after carefu""# readin$ the te%t. S*' IO" A & 1. Ans!er the fo""o!in$ questions 'a( )%p"ain the fo""o!in$ terms*

iii. iv.
Ans!er i. ii.

Share!are +,+
S3are1are) A method of marketin$ soft!are !here a pro$ram is distri-uted free"#9 and users ma# tr# it -efore pa#in$ for it. P/P) ,#perte%t +reprocessor 'or +ersona" ,ome +a$e( is an open source server side pro$rammin$ "an$ua$e used to create d#namic .e- content.

(1 mark for each correct explanation) '-( Ans!er .rite the essentia" components of S/0C usin$ a samp"e case stud#. S/0C is an a--reviation for Soft!are /eve"opment 0ife C#c"e. The essentia" components of S/0C are Ana"#sis9 /esi$n9 /eve"op9 Test and :mp"ement. Samp"e Case Stud#* A 7estaurant o!ner approached a soft!are compan# for the automation of his dai"# operations and account keepin$. The soft!are Compan# performs the requirement Anal!sis and prepares an initia" #esi2n document for the proposed so"ution. After approva" of the restaurant o!ner the Soft!are compan# proceeds to!ards #e5elopment of the app"ication. After comp"etion of the #e5elopment processes the soft!are compan# performs testin2 !ith dumm# data and a"so !ith C"ientIs ori$ina" data. 5n the comp"etion of testin$ process the soft!are is Implemente( at the c"ient end 'C"ient end is the 7estaurant 5!ner. ( mark each for naming any 4 components correctly) (2 marks for the sample case study) 'c( Ans!er )%p"ain the term /ata 1ode"in$. .hat does 210 mean3 4ive the name of t!o commercia""# avai"a-"e packa$es supportin$ 5-6ect 1ode"in$ Technique. /ata 1ode"in$ is the technique to mode" or desi$n the c"ient concept 'The person !ho !ants the soft!are to -e made( -# app"#in$ forma" data mode" descriptions usin$ data mode""in$ techniques. :t is a $raphica" method9 !hich faci"itates eas# conversion of c"ient vie! or user vie! of the data into ta-"es in the data-ase. 210 means 2nified 1ode"in$ 0an$ua$e. The t!o commercia""# avai"a-"e packa$es are 7ationa" 7ose and ;isio (2 marks for correct explanation of the term Data Modeling) (1 mark for the correct meaning of UML) ( mark each for correctly naming any t o packages) &2 Ans!er the fo""o!in$ questions 'a( .rite names of an# t!o popu"ar 7e"ationa" /ata-ase 1ana$ement S#stems. Ans!er 57AC0) 2

1icrosoft S&0 or 1#S&0 1icrosoft Access <ire-ird /B2 S#-ase (1mark each for naming any t o correct !D"M#) '-( Ans!er /efine S&0. )%p"ain S&0 su-cate$ories $ivin$ at "east one e%amp"e command in each cate$or#. S&0 is the Structured &uer# 0an$ua$e used to interact !ith the 7/B1S. The S&0 Su-cate$ories are* /10 ':NS)7T9 2+/AT)9 /)0)T)( //0 'C7)AT) TAB0)9 /75+ TAB0)9 A0T)7 TAB0)( /C0 '47ANT9 7);5C)( TC0 'C511:T9 7500BACC( (1mark for the correct definition of #$L) ( mark each for correctly naming any % su&categories) ( mark each for the correct command in each category ('nly one command in each category)) 'c( Ans!er /ecision Contro" 0oopin$ Contro" 1. /ecision contro" structures are used to 1. 0oopin$ means iterations or repetition of imp"ement decisions -ased on conditions. .e some set of code. The same set of code can check the condition and a""o! to e%ecute code -e e%ecuted more than once on enterin$ into if the condition is found true e"se some other the 0oopin$ Construct. set of code is e%ecuted. This can -e achieved usin$ :f then )"se )nd if command in +08S&0. .e can a"so nest mu"tip"e :<s to$ether. 2. The s#nta% is* 2. 0oopin$ Contro" in +08S&0 are :f JConditionK Then -asic 055+ J)%ecuta-"e StatementsK <57 0oop )"se .,:0) 0oop J)%ecuta-"e StatementsK )nd :f 3. :n decision contro"9 statement's( is8are e%ecuted ma%imum one time on"# !hereas in "oops statement's( is8are e%ecuted more than one time (2 marks for any t o correct differences) &3 Ans!er the fo""o!in$ questions 'a( Ans!er .hat is an )vent3 Name an )vent /riven pro$rammin$ "an$ua$e. An event represents the state of the ke#-oard ke#s9 the "ocation of the mouse9 and the state of the mouse -uttons9 !hich occurs as the resu"t of user interaction !ith an e"ement. <or e%amp"e9 !hen a user c"icks a -utton9 an event is $enerated. ;isua" Basic is one e%amp"e of an event driven pro$rammin$ "an$ua$e. (1 mark for the correct definition) (1 mark for naming the language) 2 /ifferentiate -et!een /ecision Contro" and 0oopin$ Contro" Structure in conte%t !ith +08S&0

'-( Ans!er

/ifferentiate usin$ a suita-"e e%amp"e9 -et!een 1s$Bo% '( and :nputBo% '( functions in ;isua" Basic 1s$Bo% '( 1. As the name e%p"ains itIs a mechanism to sho! a sma"" dia"o$ -o%9 !hich pops up over the e%istin$ app"ication for disp"a#in$ custom messa$es. 2. 1essa$e Bo% can a"so -e used to $ather user responses -ut the# are "imited to the user actions such as !hether the user has C"icked 5C -utton9 or Cance" Button or >es -utton or No -utton etc. )%amp"e 1s$Bo% L,e""o 2serM :nputBo% '( 1. The :nputBo% is for disp"a#in$ a messa$e a"on$ !ith co""ectin$ 2ser :nputs. 2. The :nput Bo% $athers user data in strin$ form.

)%amp"e /im A$e A$eN:nputBo% 'L)nter A$eM(

(2 marks for any t o correct differences) (1 mark for each example ) 'c( Ans!er A#O#B :t is an o-6ect "i-rar# avai"a-"e in visua" -asic and a reference can -e added -# $oin$ to the menu +ro6ect K 7eferences. A/5/C is c"ass "i-rar#. )%* +ro$rammer Contro""ed Navi$ation of /ata from ta-"e (2 marks for any t o correct differences) (1 mark for each example) A#O #' :t is a data contro" "ike other contro"s avai"a-"e in the too"-o%. This contro" can -e added -# $oin$ to the 1enu +ro6ect K Components. A/5/C is 6ust a data contro"9 )%*This contro" does preEdefined navi$ations 1ove<irst91ove0ast91oveNe%t9 1ove+revious /ifferentiate -et!een a A/5/B pro6ect reference and A/5 /C in a form usin$ suita-"e )%amp"e

Section B & 7ead the fo""o!in$ case stud# and ans!er the questions that fo""o!s*

1r Nath of &uick So"ution Soft!are Corporation has $ot requirement of a Soft!are +ro6ect from a Customer in Tours and Trave" Business. ,e performed the pre"iminar# ana"#sis and found that soft!are App"ication shou"d -e -ased on C"ient8Server techno"o$#. ,e opted for ;isua" Basic 0an$ua$e to deve"op the front end. 4iven -e"o! is one of the forms to enquire a-out rai"!a# reservation. Carefu""# o-serve the fo""o!in$ picture.

Object !pe $orm %abel

e&t Bo&

Object "ame frm)nquir#<orm "-"5ri$inatin$Station "-"/estinationStation "-"/ate5f=ourne# 0-"// 0-"11 "-">>>> t%t5ri$inatin$Station t%t/estinationStation t%t// t%t11

#escription The 1ain <orm 5-6ect

t%t>>>> cmdCheckStatus cmdC"ose1e The 0ist for the a-ove form is as fo""o!s* 'omman( Button

To enter a strin$ t#pe va"ue To enter a strin$ t#pe va"ue To enter a /ate To enter a numeric va"ue of month To enter a numeric va"ue of >ear To check Status of Ticket Avai"a-i"it# To c"ose the form frm)nquir#<orm

'a( Ans!er

.rite the va"ue for the Caption propert# of the 5-6ect cmdCheckStatus. OCheck Status ( mark for ()* sym&ol) ( mark for the text (+heck #tatus*) .rite the code snippet for cmdC"ose1e Command Button if it is required to c"ose the form on its C"ick event. 5n C"ick event of the cmdC"ose1e -utton !rite the fo""o!in$* )N/ ( mark for mentioning the e,ent or ( mark for the code) riting the e-ui,alent code for it)

'-( Ans!er

'c( Ans!er

.rite a code snippet to a""o! the user to restrict a"pha-ets in the // fie"d. 5n Ce#+ress )vent !rite the fo""o!in$ code fra$ment* :f 'Ce#Ascii KN @? And Ce#Ascii JN D0( 5r 'Ce#Ascii KN DB And Ce#Ascii JN 122( Then 1s$Bo% P+"ease )nter Numeric ;a"ues 5n"#P Ce#Ascii N 0 )nd :f ( 2 marks for the correct ,alidation using the ./ statement) ( 1 mark for displaying a message using the Msg"ox) ( mark for reinitiali0ing the ,alue) ( mark for 1nd .f)

'd( Ans!er

.rite a procedure to check for the va"idit# of the entered date va"ue. C"ear the te%t -o%es for inva"id date va"ue and set the focus on t%t//. +rocedure Codin$* /im str/ate as Strin$ str/ate N trim't%t//.Te%t( O LEL O trim 't%t11.te%t( OMELO trim't%t>>>>.te%t( :f Not :s/ate'str/ate( Then 1s$Bo% P+"ease )nter a ;a"id /ateP t%t//.Te%t N PP t%t11.Te%tNPP t%t>>>>.te%tNPP t%t//.Set<ocus )nd :f ( 1 mark for extracting the ,alue from the text&ox) ( 1 mark for the correct ,alidation using the ./ statement) ( 1 mark for displaying a message using the Msg"ox) ( 1 mark for clearing the text&oxes)

&?

7ead the fo""o!in$ case stud# and ans!er the questions that fo""o!s 'a( <ind the output of the fo""o!in$ !hen the command -utton !ith caption command1 is c"icked*

DIM X as integer PRIVATE SUB command1_click( PRI!T "#ello$ %A&& 'irst(() PRI!T "B*e$ E!D SUB PRIVATE SUB 'irst(!+m as Integer X , 1PRI!T X PRI!T !+m.X E!D SUB
Ans!er ,e""o 10 ?0 B#e

( mark for each correct line of output) 2

'-(

7e!rite the fo""o!in$ code usin$ S)0)CT.. CAS) !ithout effectin$ the output of the code*

DIM Total as I!TE/ER Total , VA&(te0t11te0t I' Total 2, 3) T#E! /rade , "A$ E&ESEI' Total 2,)- T#E! /rade , "B$ E&SEI' Total 2, 44 T#E! /rade , "%$ E&SE /rade , "D$ E!D I'
Ans!er

SE&E%T %ASE Total %ASE IS2,3) /rade , 5A5 %ASE )- T6 3( /rade , 6B6 %ASE 44 T6 (7 /rade , 6%6 %ASE E&SE /rade , 6D6 E!D SE&E%T
( ( ( ( mark for #1L1+2 statement) mark for case ,alue) mark for +3#1 1L#1 statement) mark for 14D #1L1+2 statement)

'c(

7e!rite the corrected code after removin$ s#nta% errors from the fo""o!in$ ;B Code* DIME!SI6! Total AS I!T Total,4-1D6 8#I&E Total2,9Total,Total:) End Do PRI!T Total

Ans!er

Corrected code*

DIM Total AS I!TE/ER Total,4-1D6 8#I&E Total2,9Total,Total:) &66P PRI!T Total


( 1 mark for identifying the three errors) ( 1 mark for riting the corrected code) 'd( Rewrite the following code using FOR..NEXT without effecting the output: 2

Dim !+m As Integer !+m , 1 D6 8#I&E !+m ;, ) !+m , !+m < 1 PRI!T n+m = &66P
Ans!er

'6R !+m , 1 T6 ) PRI!T !+m !EXT !+m


( mark for using correct control ,aria&le) ( mark for using correct initial ,alue) ( mark for using correct final ,alue) ( mark for 4152 statement)

'e(

.rite the output of the fo""o!in$ code se$ment*

Msg , 5Tec>nolog*5 PRI!T MID(&TRIM(Msg ?1?( < 5 and 5 <5 @ids5 PRI!T (4 2 A . 9 A!D (4 B 9 ; 1PRI!T VA&(51-- 8a*s5 < &E!(Msg PRI!T I!STR(Msg?5log5
Ans!er 5utput*

Tec> and @ids 'alse 113

( mark for each correct line of output)

Section ' @ Ans!er the questions '!ith respect to S&0 and +08S&0( 'a( .rite a S&0 '//0( quer# to create the fo""o!in$ ta-"e )mp"o#ee
'olumn "ame )mp:/ )mpName )mpAddress )mp+hone )mpSa" #ata !pe N21B)7 ;A7C,A72 ;A7C,A72 ;A7C,A72 N21B)7 Si0e @ 20 30 10 D92 'onstraint +7:1A7> C)> N5T N200 #escriptiom

Ans!er

Code* C7)AT) TAB0) )mp"o#ee ' )mp:/ N21B)7 '@( )mpName ;A7C,A72 '20( )mpAddress ;A7C,A72 '30(9 )mp+hone ;A7C,A72 '10(9 )mpSa" N21B)7 'D92((Q ( mark for +!1321 23"L1 ) ( mark for fields ith data types) ( mark for 6!.M3!7 817 constraint) ( mark for 4'2 4ULL constraint)

+7:1A7> C)>9 N5T N2009

'-( Ans!er

.rite +0 8 S&0 Code to increase the sa"ar# of a"" the emp"o#ees -# some percenta$e amount accepted from the user Code* BE/I! UPDATE EMP&6CEE= SET EmDSal , EmDSal<EmDSal . ESA&_PERF1--= E!D= (1mark for U6D321 1mployee statement) (1 mark for correct #12 statement) (2 marks for using the correct expression to increase salary)

'c( Ans!er

.rite pro$ram code to dec"are and use an )%p"icit Cursor to disp"a# the Sa"ar# increased -# 10A. Code* /)C0A7) ;HSa" )1+.SA0AT>+)Q C27S57 CH)mp :S S)0)CT SA0 <751 )1+Q B)4:N 5+)N CH)mpQ 055+ <)TC, CH)mp :NT5 ;HSa"Q ;HSa" *N ;HSa" R 1.1Q )S:T .,)N CH)mpAN5T<52N/Q /B1SH52T+2T.+2TH0:N) 'T 7aised Sa"ar# is* T UU ;HSa"(Q

)N/ 055+Q C05S) CH)mpQ )N/Q (1 mark for creating the +ursor) (1 mark for the loop) (1 mark for using D"M#9'U26U2:6U29L.41) (1 mark for correct expression for increase of #alary) Assume that #ou are provided !ith the fo""o!in$ t!o ta-"es* able) #ept #*P "O #"A+* %O' 10 ACC52NT:N4 N). >57C 20 7)S)A7C, /A00AS 30 SA0)S C,:CA45 0 5+)7AT:5NS B5ST5N able) *mp *+P"O *"A+* B3@D S1:T, B DD A00)N B?21 .A7/ B?@@ =5N)S B@? 1A7T:N B@DF B0AC) BBF2 C0A7C BBFF SC5TT BF3D C:N4 BF T27N)7 BFB@ A/A1S BD00 =A1)S BD02 <57/ BD3 1:00)7

,OB +-. /I.*#A * SA% C0)7C BD02 1BE/ecEF0 SA0)S1AN B@DF 20E<e-EF1 SA0)S1AN B@DF 22E<e-EF1 1ANA4)7 BF3D 02EAprEF1 SA0)S1AN B@DF 2FESepEF1 1ANA4)7 BF3D 01E1a#EF1 1ANA4)7 BF3D 0DE=unEF1 ANA0>ST B?@@ 0DE/ecEF2 +7)S:/)NT 1BENovEF1 SA0)S1AN B@DF 0FESepEF1 C0)7C BBFF 12E=anEF3 C0)7C B@DF 03E/ecEF1 ANA0>ST B?@@ 03E/ecEF1 C0)7C BBF2 23E=anEF2

'O++ F00 1@00 12?0 2DB? 12?0 2F?0 2 ?0 3000 ?000 1?00 1100 D?0 3000 1300

#*P "O 20 300 30 ?00 30 20 1 00 30 30 10 20 10 0 30 20 30 20 10

The ta-"e structures as able) #ept Co"um Name /ata T#pe /eptNo Num-er /name ;A7C,A72 0oc ;A7C,A72 able) *mp Co"um Name )mpNo )name =5B 147 ,:7)/AT) SA0 C511 /)+TN5 /ata T#pe Num-er ;A7C,A72 ;A7C,A72 N21B)7 /AT) N21B)7 N21B)7 N21B)7

SiGe 2 10 10 SiGe 10 10 'B92( 'B92( 2

Constraint +7:1A7> C)> N5T N200

/escription

Constraint +7:1A7> C)> N5T N200

/escription

<57):4N C)>

7eferences /eptNo fie"d /ept Ta-"e

of

'a( Ans!er

Create a ;ie! on the a-ove ta-"es to sho! )name9 /name9 =o- and Sa" of an emp"o#ee !hose department num-er is either 10 or 20. Code* %REATE VIE8 VU_EMP AS SE&E%T E!ame? Dname? GoH ? Sal 'R6M EmD? DeDt 8#ERE EmD1DeDt!o , DeDt1DeDt!o A!D EmD1DeDt!o I! (1-?9- =

( Mark for +!1321 ;.1< command) ( Mark for #1L1+2 statement) (1 Mark for <=1!1 clause) '-( Ans!er .rite a S&0 <unction to return Bonus9 !hich is ca"cu"ated as 20A of the amount passed. A"so $ive an e%amp"e of its use on co"umn Sa" of )mp ta-"e. Code* %REATE 7R REP&A%E 'U!%TI7! 'indBon+s (V_Amo+nt I! !UMBER RETUR! !UMBER AS V_Bon+s !UMBER= BE0I! V_Bon+s D, V_Amo+nt . 129= RETUR! V_Bon+s= E!D= )%amp"e of use* S&0K S)0)CT )name9 <indBonus'Sa"( <751 )mpQ (1 mark for correct function header) ( mark for correct positions of "1>.4 and 14D) (1 mark for correct calculation expression) ( mark for !12U!4) (1 mark for 1xample) 'c( Ans!er .rite the +08S&0 code to create a stored procedure 7aiseHSa"ar# to increase sa"ar# of an emp"o#ee !hose )1+N5 and Sa"H+ercenta$e is passed as :N mode ar$ument and !i"" a"so disp"a# the chan$ed va"ue. Code* %REATE 7R REP&A%E PR7%EDURE RAISE_SA&ARE (V_EmF!o EMP2EMP!7GTEPE@ SA&_PER%E!TA0E !UMBER AS V_SA& !UMBER (1-@9 = BE0I! UPDATE EMP SET SA&, SA&<(SA&.(SA&_PERH1-8#ERE EMP!7 , V_EMP!7= SE&E%T SA& I!T7 V_SA& 'R7M EMP 8#ERE EMP!7 , V_EMP!7= DBMS_7UTPUT2PUT_&I!E (IT?e !eJ Salar* is D I KK V_SA& = E!D= (1 mark for correct 6rocedure header ith re-uired parameters)

(1 mark for correct U6D321 statement) (1 mark for correct #1L1+2 statement) (1 mark for displaying the changed ,alue of salary)

Вам также может понравиться