Sunteți pe pagina 1din 3

(1)How will you enable sql 2005 physically store the computed values in the table and update

the values when any other columns are updated? (a)Use computed expression and provide the expression. (b)Use PERSISTED option during the table creation. (c ) reate a clustered index on the computed column. (d) reate a de!ault constraint in the computed expression. (2)Which one of the below query is useful to find out the duplicate employees havin same first!name and salary in the employee table" (a)Select count(!irst"name)#!irst"name#salar$ !rom emplo$ee group b$ !irst"name#salar$ %here count(!irst"name)&' (b) Select count(!irst"name)#!irst"name#salar$ !rom emplo$ee group b$ !irst"name#salar$ having count(!irst"name)(' (c) Select count(!irst"name)#!irst"name#salar$ !rom emplo$ee group b$ !irst"name#salar$ having count(!irst"name)&' (d) Select !irst"name#salar$ !rom emplo$ee group b$ !irst"name#salar$ having count(!irst"name)&' (#)Which of the iven statements is related to the followin created view? $%&'(& )*&W &mp!dept!outer+oin1 ', ,&-&( &mpno.&name.e"/eptno./name.-oc 0%12 &mp!tab e./ept!tab d WH&%& e"/eptno3d"/eptno(4)5 )iew created successfull (a))ie%s that involve outer *oins are not modi!iable. (b) olumns in the base emp"tab table o! emp"dept"outer*oin' are modi!iable through the vie% (c) olumns in the dept"tab table o! emp"dept"outer*oin' are modi!iable through the vie% (d)columns in the base emp"tab table o! emp"dept"outer*oin' are not modi!iable through the vie%

(6)What is the minimum permission required to e7ecute the drop database command? (a) D+ ,dmin (b) D+ -%ner (c) ontrol (d) User

(5),uppose there are 2 tables.employee and +obs" 8obid is a 09 in employees table referrin the +obs table" What is the suitable option to find the rows in employee that violate forei n :ey constraints? (a)SE.E T emplo$ee.emp"id#emplo$ee.*ob"id /R-0 emplo$ee .E/T -UTER 1-I2 *obs -2 emplo$ee.*ob"id3&*obs.*ob"id (b) SE.E T emplo$ee.emp"id#emplo$ee.*ob"id /R-0 emplo$ee .E/T -UTER 1-I2 *obs -2 emplo$ee.*ob"id(*obs.*ob"id (c ) SE.E T emplo$ee.emp"id#emplo$ee.*ob"id /R-0 emplo$ee .E/T -UTER 1-I2 *obs -2 emplo$ee.*ob"id(*obs.*ob"id 45ERE (*obs.*ob"id IS 2U..) (d)SE.E T emplo$ee.emp"id#emplo$ee.*ob"id /R-0 emplo$ee I22ER 1-I2 *obs -2 emplo$ee.*ob"id(*obs.*ob"id 45ERE (*obs.*ob"id IS 2U..) (;)(here are # servers and customers data is stored as a partitioned table" (he servers are ,erver1.,erver2 and ,erver#" 1ne of the /<' had modified the collation settin fir the customers table on server2" =ou are tryin to create a partitioned view as defined below> $%&'(& )*&W $ustomers ', ,&-&$(?0%12 $ompany/ata"dbo"$ustomers@## AB*1B '-,&-&$(?0%12 ,erver2"$ompany/ata"dbo"$ustomers@;; AB*1B '-,&-&$(?0%12 ,erver#$ompany/ata"dbo"$ustomers@CC (he )iew is failin " What could be the reson? (a)The partition vie% is on a partitioned table that is not allo%ed (b))ie%s spanning di!!erent servers are not allo%ed. (c )The collations are di!!erent. (d) The column names need to be mentioned rather than using 6

(D)=ou have table' and (able$ as 2 tables and col1 E col2 respectively in the tables" (he values in the columns are> 1.Bull. 6 in table'($ol1) and Bull. 6 in table$(col2)" What will be the result of the followin query? ,&-&$(?0%12 table' t1 81*B table$ t2 1B t1"a3t2"c 1%/&% <= t1"a (a)-nl$ one ro% %ill be returned !or the matching value o! 7. (b)T%o ro%s %ill be returned !or matching value o! 7 8 null (c ) ,ll the ro%s %ill be returned !rom tablea (d) It %ill return 96: number o! ro%s

(F)=ou have a table -an ua es!Ased" *n this"one of the column is -an ua e!Botation"What is the suitable query to chec: the value in the -an ua e!Botation and then accordin ly return the values" (=ou want the value to be displayed from /esc!en .if the value3& else display value from /esc column) (a)select Decode (.anguage"2otation#;<;#Desc#desc"eng) !rom .anguage"Used (b) select Decode (.anguage"2otation#;<;#Desc"eng#Desc) !rom .anguage"Used (c ) select Decode (;<;#Desc"eng#Desc# .anguage"2otation#) !rom .anguage"Used (d) select Decode (.anguage"2otation#;<;#Desc"eng) !rom .anguage"Used

(C)=ou are tryin to create a Aser /efined function as follows> $reate 0unction ApdateAser(bl 's <e in *f(select count(?) from Aser(able)G0 <e in Apdate Aser(able set -astApdate/ate3 etdate() &nd &nd However it throws an error"What could be the issue? (a)-nl$ s$stem tables can be updated !rom !unctions. (b)UPD,TE statements are allo%ed in the bod$ o! user"de!ined !unctions i! the table modi!ied is a table variable. (c)the option update"!unction has to be set to true be!ore the !unction is created. (d) onditional update is not allo%ed in the !unctions.