SlideShare a Scribd company logo
1 of 103
Download to read offline
hirist 
.com 
www.hirist.com 
SQL 
TOP 100 
INTERVIEW QUESTIONS & ANSWERS
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisDBMS? 
2 
QUESTION 
ADatabaseManagementSystem(DBMS)isaprogramthatcontrolscreation,maintenanceanduseofadatabase. DBMScanbetermedasFileManagerthatmanagesdatainadatabaseratherthansavingitinfilesystems. 
ANSWER 
QUESTION 1
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisRDBMS? 
3 
QUESTION 
RDBMSstandsforRelationalDatabaseManagementSystem.RDBMSstorethedataintothecollectionoftables, whichisrelatedbycommonfieldsbetweenthecolumnsofthetable.Italsoprovidesrelationaloperatorstomanipulatethedatastoredintothetables. 
Example:SQLServer. 
ANSWER 
QUESTION 2
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisSQL? 
4 
QUESTION 
SQLstandsforStructuredQueryLanguage,anditisusedtocommunicatewiththeDatabase.Thisisastandardlanguageusedtoperformtaskssuchasretrieval,updation,insertionanddeletionofdatafromadatabase. 
StandardSQLCommandsareSelect. 
ANSWER 
QUESTION 3
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaDatabase? 
5 
QUESTION 
Databaseisnothingbutanorganizedformofdataforeasyaccess,storing,retrievalandmanagingofdata.Thisisalsoknownasstructuredformofdatawhichcanbeaccessedinmanyways. 
Example:SchoolManagementDatabase,BankManagementDatabase. 
ANSWER 
QUESTION 4
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhataretablesandFields? 
6 
QUESTION 
AtableisasetofdatathatareorganizedinamodelwithColumnsandRows.Columnscanbecategorizedasvertical,andRowsarehorizontal.Atablehasspecifiednumberofcolumncalledfieldsbutcanhaveanynumberofrowswhichiscalledrecord. 
Example:. 
Table:Employee. 
Field:EmpID,EmpName,DateofBirth. 
Data:201456,David,11/15/1960. 
ANSWER 
QUESTION 5
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaprimarykey? 
7 
QUESTION 
Aprimarykeyisacombinationoffieldswhichuniquelyspecifyarow.Thisisaspecialkindofuniquekey,andithasimplicitNOTNULLconstraint.Itmeans,PrimarykeyvaluescannotbeNULL. 
ANSWER 
QUESTION 6
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisauniquekey? 
8 
QUESTION 
AUniquekeyconstraintuniquelyidentifiedeachrecordinthedatabase.Thisprovidesuniquenessforthecolumnorsetofcolumns. 
APrimarykeyconstrainthasautomaticuniqueconstraintdefinedonit.Butnot,inthecaseofUniqueKey. 
Therecanbemanyuniqueconstraintdefinedpertable,butonlyonePrimarykeyconstraintdefinedpertable. 
ANSWER 
QUESTION 7
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaforeignkey? 
9 
QUESTION 
Aforeignkeyisonetablewhichcanberelatedtotheprimarykeyofanothertable.Relationshipneedstobecreatedbetweentwotablesbyreferencingforeignkeywiththeprimarykeyofanothertable. 
ANSWER 
QUESTION 8
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatarethetypesofjoinandexplaineach? 
10 
QUESTION 
Therearevarioustypesofjoinwhichcanbeusedtoretrievedataanditdependsontherelationshipbetweentables. 
InnerJoin:Innerjoinreturnrowswhenthereisatleastonematchofrowsbetweenthetables. 
RightJoin:RightjoinreturnrowswhicharecommonbetweenthetablesandallrowsofRighthandsidetable. Simply,itreturnsalltherowsfromtherighthandsidetableeventhoughtherearenomatchesinthelefthandsidetable. 
LeftJoin:LeftjoinreturnrowswhicharecommonbetweenthetablesandallrowsofLefthandsidetable.Simply,itreturnsalltherowsfromLefthandsidetableeventhoughtherearenomatchesintheRighthandsidetable. 
FullJoin:Fulljoinreturnrowswhentherearematchingrowsinanyoneofthetables.Thismeans,itreturnsalltherowsfromthelefthandsidetableandalltherowsfromtherighthandsidetable. 
ANSWER 
QUESTION 9
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Explainanouterjoin? 
11 
QUESTION 
Anouterjoinincludesrowsfromtableswhentherearenomatchingvaluesinthetables. 
ANSWER 
QUESTION 10
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisnormalization? 
12 
QUESTION 
Normalizationistheprocessofminimizingredundancyanddependencybyorganizingfieldsandtableofadatabase.ThemainaimofNormalizationistoadd,deleteormodifyfieldthatcanbemadeinasingletable. 
ANSWER 
QUESTION 11
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisDenormalization? 
13 
QUESTION 
DeNormalizationisatechniqueusedtoaccessthedatafromhighertolowernormalformsofdatabase.Itisalsoprocessofintroducingredundancyintoatablebyincorporatingdatafromtherelatedtables. 
ANSWER 
QUESTION 12
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatareallthedifferentnormalizations? 
14 
QUESTION 
Thenormalformscanbedividedinto4forms,andtheyareexplainedbelow-. 
FirstNormalForm(1NF):Thisshouldremovealltheduplicatecolumnsfromthetable.Creationoftablesfortherelateddataandidentificationofuniquecolumns. 
SecondNormalForm(2NF):Meetingallrequirementsofthefirstnormalform.PlacingthesubsetsofdatainseparatetablesandCreationofrelationshipsbetweenthetablesusingprimarykeys. 
ThirdNormalForm(3NF):Thisshouldmeetallrequirementsof2NF.Removingthecolumnswhicharenotdependentonprimarykeyconstraints. 
FourthNormalForm(4NF):Meetingalltherequirementsofthirdnormalformanditshouldnothavemulti- valueddependencies. 
ANSWER 
QUESTION 13
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisanIndex?Whatareallthedifferenttypesofindexes? 
15 
QUESTION 
Anindexisperformancetuningmethodofallowingfasterretrievalofrecordsfromthetable.Anindexcreatesanentryforeachvalueanditwillbefastertoretrievedata. 
Thisindexingdoesnotallowthefieldtohaveduplicatevaluesifthecolumnisuniqueindexed.Uniqueindexcanbeappliedautomaticallywhenprimarykeyisdefined. 
ClusteredIndex:Thistypeofindexreordersthephysicalorderofthetableandsearchbasedonthekeyvalues. Eachtablecanhaveonlyoneclusteredindex. 
NonClusteredIndex:NonClusteredIndexdoesnotalterthephysicalorderofthetableandmaintainslogicalorderofdata.Eachtablecanhave999nonclusteredindexes. 
ANSWER 
QUESTION 14
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisarelationshipandwhatarethey? 
16 
QUESTION 
DatabaseRelationshipisdefinedastheconnectionbetweenthetablesinadatabase.Therearevariousdatabasingrelationships,andtheyareasfollows:. OnetoOneRelationship. OnetoManyRelationship. ManytoOneRelationship. Self-ReferencingRelationship. 
ANSWER 
QUESTION 15
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaquery? 
17 
QUESTION 
ADBqueryisacodewritteninordertogettheinformationbackfromthedatabase.Querycanbedesignedinsuchawaythatitmatchedwithourexpectationoftheresultset.Simply,aquestiontotheDatabase. 
ANSWER 
QUESTION 16
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatissubquery?Whatarethetypesofsubquery? 
18 
QUESTION 
Asubqueryisaquerywithinanotherquery.Theouterqueryiscalledasmainquery,andinnerqueryiscalledsubquery.SubQueryisalwaysexecutedfirst,andtheresultofsubqueryispassedontothemainquery. 
Therearetwotypesofsubquery–CorrelatedandNon-Correlated. 
Acorrelatedsubquerycannotbeconsideredasindependentquery,butitcanreferthecolumninatablelistedintheFROMthelistofthemainquery. 
ANon-Correlatedsubquerycanbeconsideredasindependentqueryandtheoutputofsubqueryaresubstitutedinthemainquery. 
ANSWER 
QUESTION 17
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisatrigger? 
19 
QUESTION 
ADBtriggerisacodeorprogramsthatautomaticallyexecutewithresponsetosomeeventonatableorviewinadatabase.Mainly,triggerhelpstomaintaintheintegrityofthedatabase. 
Example:Whenanewstudentisaddedtothestudentdatabase,newrecordsshouldbecreatedintherelatedtableslikeExam,ScoreandAttendancetables. 
ANSWER 
QUESTION 18
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatarethetypesofTriggers? 
20 
QUESTION 
Therearefourtypesoftriggersandtheyare: 
•Insert 
•Delete 
•Update 
•Insteadof 
ANSWER 
QUESTION 19
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferencebetweenDELETETRUNCATEandDROPcommands? 
21 
QUESTION 
DELETEcommandisusedtoremoverowsfromthetable,andWHEREclausecanbeusedforconditionalsetofparameters.CommitandRollbackcanbeperformedafterdeletestatement. 
TRUNCATEremovesallrowsfromthetable.Truncateoperationcannotberolledback. 
Dropcommandisusedtodropthetableorkeyslikeprimary,foreignfromatable. 
ANSWER 
QUESTION 20
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisdataIntegrity? 
22 
QUESTION 
DataIntegritydefinestheaccuracyandconsistencyofdatastoredinadatabase.Itcanalsodefineintegrityconstraintstoenforcebusinessrulesonthedatawhenitisenteredintotheapplicationordatabase. 
ANSWER 
QUESTION 21
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatiscollation? 
23 
QUESTION 
Collationisdefinedassetofrulesthatdeterminehowcharacterdatacanbesortedandcompared.ThiscanbeusedtocompareAand,otherlanguagecharactersandalsodependsonthewidthofthecharacters. 
ASCIIvaluecanbeusedtocomparethesecharacterdata. 
ANSWER 
QUESTION 22
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
AdvantagesandDisadvantagesofStoredProcedure? 
24 
QUESTION 
Storedprocedurecanbeusedasamodularprogramming–meanscreateonce,storeandcallforseveraltimeswheneverrequired.Thissupportsfasterexecutioninsteadofexecutingmultiplequeries.Thisreducesnetworktrafficandprovidesbettersecuritytothedata. 
DisadvantageisthatitcanbeexecutedonlyintheDatabaseandutilizesmorememoryinthedatabaseserver. 
ANSWER 
QUESTION 23
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisSQLInjection? 
25 
QUESTION 
SQLInjectionisoneofthetechniquesusesbyhackerstohackawebsitebyinjectingSQLcommandsindatafields. 
ANSWER 
QUESTION 24
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferencebetweenaHAVINGCLAUSEandaWHERECLAUSE? 
26 
QUESTION 
Theyspecifyasearchconditionforagrouporanaggregate.ButthedifferenceisthatHAVINGcanbeusedonlywiththeSELECTstatement.HAVINGistypicallyusedinaGROUPBYclause.WhenGROUPBYisnotused, HAVINGbehaveslikeaWHEREclause.HavingClauseisbasicallyusedonlywiththeGROUPBYfunctioninaquerywhereasWHEREClauseisappliedtoeachrowbeforetheyarepartoftheGROUPBYfunctioninaquery. 
ANSWER 
QUESTION 25
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Howwouldapplydaterangefilter? 
27 
QUESTION 
a.Youcanusesimplecondition>=and<=orsimilarorusebetween/andbutthetrickistoknowyourexactdatatype. 
b.Sometimesdatefieldscontaintimeandthatiswherethequerycangowrongsoitisrecommendedtousesomedaterelatedfunctionstoremovethetimeissue.InSQLServercommonfunctiontodothatisdatedifffunction. 
c.Youalsohavetobeawareofdifferenttimezonesandservertimezone. 
d.Toincreasequeryperformanceyoumaystillwanttousebetweenhoweveryoushouldbeawareofproperformatyoushoulduseifnotitmightmisbehaveduringfiltering. 
ANSWER 
QUESTION 26
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferencebetweenJOINandUNION? 
28 
QUESTION 
SQLJOINallowsusto―lookup‖recordsonothertablebasedonthegivenconditionsbetweentwotables.Forexample,ifwehavethedepartmentIDofeachemployee,thenwecanusethisdepartmentIDoftheemployeetabletojoinwiththedepartmentIDofdepartmenttabletolookupdepartmentnames. 
UNIONoperationallowsustoadd2similardatasetstocreateresultingdatasetthatcontainsallthedatafromthesourcedatasets.Uniondoesnotrequireanyconditionforjoining.Forexample,ifyouhave2employeetableswithsamestructure,youcanUNIONthemtocreateoneresultsetthatwillcontainalltheemployeesfrombothofthetables. 
SELECT*FROMEMP1 
UNION 
SELECT*FROMEMP2; 
ANSWER 
QUESTION 27
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferenceamongUNION,MINUSandINTERSECT? 
29 
QUESTION 
UNIONcombinestheresultsfrom2tablesandeliminatesduplicaterecordsfromtheresultset. 
MINUSoperatorwhenusedbetween2tables,givesusalltherowsfromthefirsttableexcepttherowswhicharepresentinthesecondtable. 
INTERSECToperatorreturnsusonlythematchingorcommonrowsbetween2resultsets. 
ANSWER 
QUESTION 28
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisSelfJoinandwhyisitrequired? 
30 
QUESTION 
SelfJoinistheactofjoiningonetablewithitself.SelfJoinisoftenveryusefultoconvertahierarchicalstructureintoaflatstructure 
ANSWER 
QUESTION 29
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
HowcanwetransposeatableusingSQL(changingrowstocolumnorvice-versa)? 
31 
QUESTION 
TheusualwaytodoitinSQListouseCASEstatementorDECODEstatement. 
ANSWER 
QUESTION 30
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatarethedifferencesamongROWNUM,RANKandDENSE_RANK? 
32 
QUESTION 
ROW_NUMBERassignscontiguous,uniquenumbersfrom1..Ntoaresultset. 
RANKdoesnotassignuniquenumbers—nordoesitassigncontiguousnumbers.Iftworecordstieforsecondplace,norecordwillbeassignedthe3rdrankasnoonecameinthird,accordingtoRANK. 
DENSE_RANK,likeRANK,doesnotassignuniquenumbers,butitdoesassigncontiguousnumbers.Eventhoughtworecordstiedforsecondplace,thereisathird-placerecord. 
ANSWER 
QUESTION 31
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisadatabasetransaction? 
33 
QUESTION 
Databasetransactiontakedatabasefromoneconsistentstatetoanother.Attheendofthetransactionthesystemmustbeinthepriorstateiftransactionfailsorthestatusofthesystemshouldreflectthesuccessfulcompletionifthetransactiongoesthrough. 
ANSWER 
QUESTION 32
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatarepropertiesofatransaction? 
34 
QUESTION 
PropertiesofthetransactioncanbesummarizedasACIDProperties. 
1.Atomicity:Atransactionconsistsofmanysteps.Whenallthestepsinatransactiongetscompleted,itwillgetreflectedinDBorifanystepfails,allthetransactionsarerolledback. 
2.Consistency:Thedatabasewillmovefromoneconsistentstatetoanother,ifthetransactionsucceedsandremainintheoriginalstate,ifthetransactionfails. 
3.Isolation:Everytransactionshouldoperateasifitistheonlytransactioninthesystem 
4.Durability:Onceatransactionhascompletedsuccessfully,theupdatedrows/recordsmustbeavailableforallothertransactionsonapermanentbasis 
ANSWER 
QUESTION 33
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaDatabaseLock?Whatarethetypeoflocks? 
35 
QUESTION 
Databaselocktellatransaction,ifthedataiteminquestionsiscurrentlybeingusedbyothertransactions. 
1.SharedLock:Whenasharedlockisappliedondataitem,othertransactionscanonlyreadtheitem,butcan'twriteintoit. 
2.ExclusiveLock:Whenaexclusivelockisappliedondataitem,othertransactionscan'treadorwriteintothedataitem. 
ANSWER 
QUESTION 34
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaCompositeKey? 
36 
QUESTION 
ACompositeprimarykeyisatypeofcandidatekey,whichrepresentsasetofcolumnswhosevaluesuniquelyidentifyeveryrowinatable. 
Forexample-if"Employee_ID"and"EmployeeName"inatableiscombinedtouniquelyidentifiesarowitscalledaCompositeKey. 
ANSWER 
QUESTION 35
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaCompositePrimaryKey? 
37 
QUESTION 
ACompositeprimarykeyisasetofcolumnswhosevaluesuniquelyidentifyeveryrowinatable.Whatitmeansisthat,tablewhichcontainscompositeprimarykeywillbeindexedbasedoncolumnsspecifiedintheprimarykey. ThiskeywillbereferredinForeignKeytables. 
Forexample-ifcombinedeffectofcolumns,"Employee_ID"and"EmployeeName"inatableisrequiredtouniquelyidentifiesarow,itscalledaCompositePrimaryKey.Inthiscase,boththecolumnswillberepresentedasprimarykey. 
ANSWER 
QUESTION 36
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
DefineSQLInsertStatement? 
38 
QUESTION 
SQLINSERTstatementisusedtoaddrowstoatable.Forafullrowinsert,SQLQueryshouldstartwith―insertinto―statementfollowedbytablenameandvaluescommand,followedbythevaluesthatneedtobeinsertedintothetable.Insertcanbeusedinseveralways: 
1.Toinsertasinglecompleterow 
2.Toinsertasinglepartialrow 
ANSWER 
QUESTION 37
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
DefineSQLUpdateStatement? 
39 
QUESTION 
SQLUpdateisusedtoupdatedatainaroworsetofrowsspecifiedinthefiltercondition. 
ThebasicformatofanSQLUPDATEstatementis,UpdatecommandfollowedbytabletobeupdatedandSETcommandfollowedbycolumnnamesandtheirnewvaluesfollowedbyfilterconditionthatdetermineswhichrowsshouldbeupdated. 
ANSWER 
QUESTION 38
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatarewildcardsusedindatabaseforPatternMatching? 
40 
QUESTION 
SQLLikeoperatorisuserforpatternmatching.SQL'Like'commandtakesmoretimetoprocess.Sobeforeusinglikeoperator,considersuggestionsgivenbelowonwhenandwheretousewildcardsearch. 
1)Don'toverusewildcards.Ifanothersearchoperatorwilldo,useitinstead. 
2)Whenyoudousewildcards,trynottousethematthebeginningofthesearchpattern,unlessabsolutelynecessary.Searchpatternsthatbeginwithwildcardsaretheslowesttoprocess. 
3)Paycarefulattentiontotheplacementofthewildcardsymbols.Iftheyaremisplaced,youmightnotreturnthedatayouintended 
ANSWER 
QUESTION 39
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisCrossJoin? 
41 
QUESTION 
CrossJoinwillreturnallrecordswhereeachrowfromthefirsttableiscombinedwitheachrowfromthesecondtable. 
ANSWER 
QUESTION 40
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaview? 
42 
QUESTION 
Viewsarevirtualtables.Unliketablesthatcontaindata,viewssimplycontainqueriesthatdynamicallyretrievedatawhenused. 
ANSWER 
QUESTION 41
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisamaterializedview? 
43 
QUESTION 
Materializedviewsisalsoaviewbutarediskbased.Materializedviewsgetupdatedonspecificduration,baseupontheintervalspecifiedinthequerydefinition.Wecanindexmaterializedview. 
ANSWER 
QUESTION 42
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whataretheadvantagesanddisadvantagesofviewsinadatabase? 
44 
QUESTION 
Advantages: 
1.Viewsdoesn'tstoredatainaphysicallocation. 
2.Viewcanbeusetohidesomeofthecolumnsfromthetable 
3.ViewscanprovideAccessRestriction,sincedatainsertion,updateanddeletionisnotpossibleontheview. 
Disadvantages: 
1.Whenatableisdropped,associatedviewbecomeirrelevant. 
2.Sinceviewarecreatedwhenaqueryrequestingdatafromviewistriggered,itsbitslow 
3.Whenviewsarecreatedforlargetables,itoccupymorememory. 
ANSWER 
QUESTION 43
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhendoyouuseUPDATE_STATISTICScommand? 
45 
QUESTION 
Thiscommandisusedwhenalargeprocessingofdatahasoccurred.Ifanylargeamountofdeletions,anymodifications,orBulkCopyintothetableshasoccurred,ithastoupdatetheindexestotakethesechangesintoaccount.UPDATE_STATISTICSupdatestheindexesonthesetablesaccordingly. 
ANSWER 
QUESTION 44
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisanIDENTITYcolumnininsertstatements? 
46 
QUESTION 
IDENTITYcolumnisusedintablecolumnstomakethatcolumnasAutoincrementalnumberorasurrogatekey. 
ANSWER 
QUESTION 45
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
HowwillIretrieveallrecordsofemployment1thoseshouldnotbepresentnemployment2? 
47 
QUESTION 
(Select*fromemployment2)-(Select*fromemployment1). 
ANSWER 
QUESTION 46
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhichTCP/IPportdoesSQLServerrunon?Howcanitbechanged? 
48 
QUESTION 
SQLServerrunsonport1433.ItcanbechangedfromtheNetworkUtilityTCP/IPproperties. 
ANSWER 
QUESTION 47
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisSQLServerAgent? 
49 
QUESTION 
SQLServeragentplaysanimportantroleintheday-to-daytasksofadatabaseadministrator(DBA).ItspurposeistoeasetheimplementationoftasksfortheDBA,withitsfull-functionschedulingengine,whichallowsyoutoscheduleyourownjobsandscripts. 
ANSWER 
QUESTION 48
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhichcommandusingQueryAnalyzerwillgiveyoutheversionofSQLserverandoperatingsystem? 
50 
QUESTION 
SELECTSERVERPROPERTY('productversion'),SERVERPROPERTY('productlevel')andSERVERPROPERTY('edition') 
ANSWER 
QUESTION 49
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
HowtocreaterecursivequeryinSQLServer? 
51 
QUESTION 
RecursivequerycanbecreateinSQLusingstoredprocedurebutyoucanalsouseCTE(Commontableexpression).ItmightbealsoworthaskingaboutperformanceasCTEisnotalwaysveryfast. 
ANSWER 
QUESTION 51
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisaconstraint? 
52 
QUESTION 
Constraintcanbeusedtospecifythelimitonthedatatypeoftable.Constraintcanbespecifiedwhilecreatingoralteringthetablestatement.Sampleofconstraintare. 
•NOTNULL. 
•CHECK. 
•DEFAULT. 
•UNIQUE. 
•PRIMARYKEY. 
•FOREIGNKEY. 
ANSWER 
QUESTION 51
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisAutoIncrement? 
53 
QUESTION 
Autoincrementkeywordallowstheusertocreateauniquenumbertobegeneratedwhenanewrecordisinsertedintothetable.AUTOINCREMENTkeywordcanbeusedinOracleandIDENTITYkeywordcanbeusedinSQLSERVER. 
MostlythiskeywordcanbeusedwheneverPRIMARYKEYisused. 
ANSWER 
QUESTION 52
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisDatawarehouse? 
54 
QUESTION 
Datawarehouseisacentralrepositoryofdatafrommultiplesourcesofinformation.Thosedataareconsolidated, transformedandmadeavailablefortheminingandonlineprocessing.WarehousedatahaveasubsetofdatacalledDataMarts. 
ANSWER 
QUESTION 53
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisuserdefinedfunctions? 
55 
QUESTION 
Userdefinedfunctionsarethefunctionswrittentousethatlogicwheneverrequired.Itisnotnecessarytowritethesamelogicseveraltimes.Instead,functioncanbecalledorexecutedwheneverneeded. 
ANSWER 
QUESTION 54
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatarealltypesofuserdefinedfunctions? 
56 
QUESTION 
Threetypesofuserdefinedfunctionsare. 
a.ScalarFunctions. 
b.InlineTablevaluedfunctions. 
c.Multistatementvaluedfunctions. 
ANSWER 
QUESTION 55
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatarealldifferenttypesofcollationsensitivity? 
57 
QUESTION 
Followingaredifferenttypesofcollationsensitivity-. 
•CaseSensitivity–AandaandBandb. 
•AccentSensitivity. 
•KanaSensitivity–JapaneseKanacharacters. 
•WidthSensitivity–Singlebytecharacteranddoublebytecharacter. 
ANSWER 
QUESTION 56
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisOnlineTransactionProcessing(OLTP)? 
58 
QUESTION 
OnlineTransactionProcessingorOLTPmanagestransactionbasedapplicationswhichcanbeusedfordataentryandeasyretrievalprocessingofdata.Thisprocessingmakeslikeeasieronsimplicityandefficiency.Itisfaster, moreaccurateresultsandexpenseswithrespecttoOTLP. 
Example–BankTransactionsonadailybasis. 
ANSWER 
QUESTION 57
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisanALIAScommand? 
59 
QUESTION 
ALIASnamecanbegiventoatableorcolumn.ThisaliasnamecanbereferredinWHEREclausetoidentifythetableorcolumn. 
Example-. 
Selectst.StudentID,Ex.Resultfromstudentst,ExamasExwherest.studentID=Ex.StudentID 
Here,streferstoaliasnameforstudenttableandExreferstoaliasnameforexamtable. 
ANSWER 
QUESTION 58
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatareaggregateandscalarfunctions? 
60 
QUESTION 
Aggregatefunctionsareusedtoevaluatemathematicalcalculationandreturnsinglevalues.Thiscanbecalculatedfromthecolumnsinatable.Scalarfunctionsreturnasinglevaluebasedontheinputvalue. 
Example-. 
Aggregate–max(),count–Calculatedwithrespecttonumeric. 
Scalar–UCASE(),NOW()–Calculatedwithrespecttostrings. 
ANSWER 
QUESTION 59
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Howcanyoucreateanemptytablefromanexistingtable? 
61 
QUESTION 
Select*intostudentcopyfromstudentwhere1=2 
Here,wearecopyingstudenttabletoanothertablewiththesamestructurewithnorowscopied. 
ANSWER 
QUESTION 60
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Howtofetchcommonrecordsfromtwotables? 
62 
QUESTION 
Commonrecordsresultsetcanbeachievedby-. 
SelectstudentIDfromstudent.<strong>INTERSECT</strong>SelectStudentIDfromExam 
ANSWER 
QUESTION 61
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Howtoselectuniquerecordsfromatable? 
63 
QUESTION 
SelectuniquerecordsfromatablebyusingDISTINCTkeyword. 
SelectDISTINCTStudentID,StudentNamefromStudent. 
ANSWER 
QUESTION 62
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatarethedifferentindexconfigurationsatablecanhave? 
64 
QUESTION 
Atablecanhaveoneofthefollowingindexconfigurations: 
1.Noindexes 
2.Aclusteredindex 
3.Aclusteredindexandmanynonclusteredindexes 
4.Anonclusteredindex 
5.Manynonclusteredindexes 
ANSWER 
QUESTION 63
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatarethepropertiesanddifferentTypesofSub-Queries? 
65 
QUESTION 
PropertiesofSub-Query 
a.Asub-querymustbeenclosedintheparenthesis. 
b.Asub-querymustbeputintherighthandofthecomparisonoperator,and 
c.Asub-querycannotcontainanORDER-BYclause. 
d.Aquerycancontainmorethanonesub-query. 
TypesofSub-Query 
e.Single-rowsub-query,wherethesub-queryreturnsonlyonerow. 
f.Multiple-rowsub-query,wherethesub-queryreturnsmultiplerows,.and 
g.Multiplecolumnsub-query,wherethesub-queryreturnsmultiplecolumns 
ANSWER 
QUESTION 64
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisSQLProfiler? 
66 
QUESTION 
SQLProfilerisagraphicaltoolthatallowssystemadministratorstomonitoreventsinaninstanceofMicrosoftSQLServer.YoucancaptureandsavedataabouteacheventtoafileorSQLServertabletoanalyzelater.Forexample,youcanmonitoraproductionenvironmenttoseewhichstoredproceduresarehamperingperformancesbyexecutingtooslowly. 
UseSQLProfilertomonitoronlytheeventsinwhichyouareinterested.Iftracesarebecomingtoolarge,youcanfilterthembasedontheinformationyouwant,sothatonlyasubsetoftheeventdataiscollected.Monitoringtoomanyeventsaddsoverheadtotheserverandthemonitoringprocessandcancausethetracefileortracetabletogrowverylarge,especiallywhenthemonitoringprocesstakesplaceoveralongperiodoftime. 
ANSWER 
QUESTION 65
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhataretheauthenticationmodesinSQLServer?Howcanitbechanged? 
67 
QUESTION 
WindowsmodeandMixedMode-SQLandWindows.TochangeauthenticationmodeinSQLServerclickStart, Programs,MicrosoftSQLServerandclickSQLEnterpriseManagertorunSQLEnterpriseManagerfromtheMicrosoftSQLServerprogramgroup.SelecttheserverthenfromtheToolsmenuselectSQLServerConfigurationProperties,andchoosetheSecuritypage. 
ANSWER 
QUESTION 66
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Canastoredprocedurecallitselforrecursivestoredprocedure?HowmuchlevelSPnestingispossible? 
68 
QUESTION 
Yes.BecauseTransact-SQLsupportsrecursion,youcanwritestoredproceduresthatcallthemselves.Recursioncanbedefinedasamethodofproblemsolvingwhereinthesolutionisarrivedatbyrepetitivelyapplyingittosubsetsoftheproblem.Acommonapplicationofrecursivelogicistoperformnumericcomputationsthatlendthemselvestorepetitiveevaluationbythesameprocessingsteps.StoredproceduresarenestedwhenonestoredprocedurecallsanotherorexecutesmanagedcodebyreferencingaCLRroutine,type,oraggregate.Youcanneststoredproceduresandmanagedcodereferencesupto32levels. 
ANSWER 
QUESTION 67
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisLogShipping? 
69 
QUESTION 
LogshippingistheprocessofautomatingthebackupofdatabaseandtransactionlogfilesonaproductionSQLserver,andthenrestoringthemontoastandbyserver.EnterpriseEditionsonlysupportslogshipping.Inlogshippingthetransactionallogfilefromoneserverisautomaticallyupdatedintothebackupdatabaseontheotherserver.Ifoneserverfails,theotherserverwillhavethesamedbandcanbeusedthisastheDisasterRecoveryplan.Thekeyfeatureoflogshippingisthatitwillautomaticallybackuptransactionlogsthroughoutthedayandautomaticallyrestorethemonthestandbyserveratdefinedinterval. 
ANSWER 
QUESTION 68
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Name3waystogetanaccuratecountofthenumberofrecordsinatable? 
70 
QUESTION 
SELECT*FROMtable1 
SELECTCOUNT(*)FROMtable1 
SELECTrowsFROMsysindexesWHEREid=OBJECT_ID(table1)ANDindid<2 
ANSWER 
QUESTION 69
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatdoesitmeantohaveQUOTED_IDENTIFIERON?WhataretheimplicationsofhavingitOFF? 
71 
QUESTION 
WhenSETQUOTED_IDENTIFIERisON,identifierscanbedelimitedbydoublequotationmarks,andliteralsmustbedelimitedbysinglequotationmarks.WhenSETQUOTED_IDENTIFIERisOFF,identifierscannotbequotedandmustfollowallTransact-SQLrulesforidentifiers. 
ANSWER 
QUESTION 70
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferencebetweenaLocalandaGlobaltemporarytable? 
72 
QUESTION 
1.Alocaltemporarytableexistsonlyforthedurationofaconnectionor,ifdefinedinsideacompoundstatement,forthedurationofthecompoundstatement. 
2.Aglobaltemporarytableremainsinthedatabasepermanently,buttherowsexistonlywithinagivenconnection. Whenconnectionisclosed,thedataintheglobaltemporarytabledisappears.However,thetabledefinitionremainswiththedatabaseforaccesswhendatabaseisopenednexttime. 
ANSWER 
QUESTION 71
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
HowGlobaltemporarytablesarerepresentedanditsscope? 
73 
QUESTION 
Globaltemporarytablesarerepresentedwith##beforethetablename.Scopewillbetheoutsidethesessionwhereaslocaltemporarytablesareinsidethesession.SessionIDcanbefoundusing@@SPID. 
ANSWER 
QUESTION 72
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatistheSTUFFfunctionandhowdoesitdifferfromtheREPLACEfunction? 
74 
QUESTION 
STUFFfunctionisusedtooverwriteexistingcharacters.Usingthissyntax,STUFF(string_expression,start,length, replacement_characters),string_expressionisthestringthatwillhavecharacterssubstituted,startisthestartingposition,lengthisthenumberofcharactersinthestringthataresubstituted,andreplacement_charactersarethenewcharactersinterjectedintothestring.REPLACEfunctiontoreplaceexistingcharactersofalloccurrences. UsingthesyntaxREPLACE(string_expression,search_string,replacement_string),whereeveryincidenceofsearch_stringfoundinthestring_expressionwillbereplacedwithreplacement_string. 
ANSWER 
QUESTION 73
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisCHECKConstraint? 
75 
QUESTION 
ACHECKconstraintisusedtolimitthevaluesthatcanbeplacedinacolumn.Thecheckconstraintsareusedtoenforcedomainintegrity. 
ANSWER 
QUESTION 74
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthedifferencebetweenUNIONandUNIONALL? 
76 
QUESTION 
UNIONstatementismainlyusedtocombinethetablesincludingtheduplicaterowsandUNIONALLcombinebutdoesnotlookforduplicaterows.Withthis,UNIONALLwillbeveryfasterthanUNIONstatements. 
ANSWER 
QUESTION 75
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisNOTNULLConstraint? 
77 
QUESTION 
ANOTNULLconstraintenforcesthatthecolumnwillnotacceptnullvalues.Thenotnullconstraintsareusedtoenforcedomainintegrity,asthecheckconstraints. 
ANSWER 
QUESTION 76
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Howtoget@@ERRORand@@ROWCOUNTatthesametime? 
78 
QUESTION 
If@@RowcountischeckedafterErrorcheckingstatementthenitwillhave0asthevalueof@@Recordcountasitwouldhavebeenreset.Andif@@Recordcountischeckedbeforetheerror-checkingstatementthen@@Errorwouldgetreset.Toget@@errorand@@rowcountatthesametimedobothinsamestatementandstoretheminlocalvariable. 
SELECT@RC=@@ROWCOUNT,@ER=@@ERROR 
ANSWER 
QUESTION 77
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaScheduledJobsorWhatisaScheduledTasks? 
79 
QUESTION 
Scheduledtasksletuserautomateprocessesthatrunonregularorpredictablecycles.Usercanscheduleadministrativetasks,suchascubeprocessing,torunduringtimesofslowbusinessactivity.UsercanalsodeterminetheorderinwhichtasksrunbycreatingjobstepswithinaSQLServerAgentjob.E.g.backupdatabase,UpdateStatsofTables.Jobstepsgiveusercontroloverflowofexecution.Ifonejobfails,usercanconfigureSQLServerAgenttocontinuetoruntheremainingtasksortostopexecution. 
ANSWER 
QUESTION 78
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisatablecalled,ifithasneitherClusternorNon-clusterIndex?Whatisitusedfor? 
80 
QUESTION 
UnindexedtableorHeap.MicrosoftPressBooksandBookonLine(BOL)refersitasHeap.Aheapisatablethatdoesnothaveaclusteredindexand,therefore,thepagesarenotlinkedbypointers.TheIAMpagesaretheonlystructuresthatlinkthepagesinatabletogether.Unindexedtablesaregoodforfaststoringofdata.Manytimesitisbettertodropallindexesfromtableandthendobulkofinsertsandtorestorethoseindexesafterthat. 
ANSWER 
QUESTION 79
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
CanSQLServerslinkedtootherserverslikeOracle? 
81 
QUESTION 
SQLServercanbelinkedtoanyserverprovidedithasOLE-DBproviderfromMicrosofttoallowalink.E.g.OraclehasanOLE-DBproviderfororaclethatMicrosoftprovidestoadditaslinkedservertoSQLServergroup. 
ANSWER 
QUESTION 80
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisBCP?Whendoesitused? 
82 
QUESTION 
BulkCopyisatoolusedtocopyhugeamountofdatafromtablesandviews.BCPdoesnotcopythestructuressameassourcetodestination.BULKINSERTcommandhelpstoimportadatafileintoadatabasetableorviewinauser-specifiedformat. 
ANSWER 
QUESTION 81
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Howtoimplementone-to-one,one-to-manyandmany-to-manyrelationshipswhiledesigningtables? 
83 
QUESTION 
One-to-Onerelationshipcanbeimplementedasasingletableandrarelyastwotableswithprimaryandforeignkeyrelationships.One-to-Manyrelationshipsareimplementedbysplittingthedataintotwotableswithprimarykeyandforeignkeyrelationships.Many-to-Manyrelationshipsareimplementedusingajunctiontablewiththekeysfromboththetablesformingthecompositeprimarykeyofthejunctiontable. 
ANSWER 
QUESTION 82
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisanexecutionplan?Whenwouldyouuseit?Howwouldyouviewtheexecutionplan? 
84 
QUESTION 
AnexecutionplanisbasicallyaroadmapthatgraphicallyortextuallyshowsthedataretrievalmethodschosenbytheSQLServerqueryoptimizerforastoredprocedureorad-hocqueryandisaveryusefultoolforadevelopertounderstandtheperformancecharacteristicsofaqueryorstoredproceduresincetheplanistheonethatSQLServerwillplaceinitscacheandusetoexecutethestoredprocedureorquery.FromwithinQueryAnalyzerisanoptioncalled"ShowExecutionPlan"(locatedontheQuerydrop-downmenu).Ifthisoptionisturnedonitwilldisplayqueryexecutionplaninseparatewindowwhenqueryisranagain. 
ANSWER 
QUESTION 83
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatarethetwoauthenticationmodesinSQLServer? 
85 
QUESTION 
Therearetwoauthenticationmodes– 
•WindowsMode 
•MixedMode 
ModescanbechangedbyselectingthetoolsmenuofSQLServerconfigurationpropertiesandchoosesecuritypage. 
ANSWER 
QUESTION 84
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisCOALESCEinSQLServer? 
86 
QUESTION 
COALESCEisusedtoreturnfirstnon-nullexpressionwithinthearguments.Thisfunctionisusedtoreturnanon- nullfrommorethanonecolumninthearguments. 
Example– 
SelectCOALESCE(empno,empname,salary)fromemployee; 
ANSWER 
QUESTION 85
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
HowexceptionscanbehandledinSQLServerProgramming? 
87 
QUESTION 
ExceptionsarehandledusingTRY—-CATCHconstructsanditishandlesbywritingscriptsinsidetheTRYblockanderrorhandlingintheCATCHblock. 
ANSWER 
QUESTION 86
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisthepurposeofFLOORfunction? 
88 
QUESTION 
FLOORfunctionisusedtoroundupanon-integervaluetothepreviousleastinteger.ExampleisgivenFLOOR(6.7) 
Returns6. 
ANSWER 
QUESTION 87
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Canwechecklocksindatabase?Ifso,howcanwedothislockcheck? 
89 
QUESTION 
Yes,wecanchecklocksinthedatabase.Itcanbeachievedbyusingin-builtstoredprocedurecalledsp_lock. 
ANSWER 
QUESTION 88
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatistheuseofSIGNfunction? 
90 
QUESTION 
SIGNfunctionisusedtodeterminewhetherthenumberspecifiedisPositive,NegativeandZero.Thiswillreturn+1,-1or0. 
Example:SIGN(-35)returns-1 
ANSWER 
QUESTION 89
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
HowistheSUBSTRkeywordusedinSQL? 
91 
QUESTION 
SUBSTRisusedforstringmanipulationwithcolumnname,firstpositionandstringlengthusedasarguments.E.g. 
SUBSTR(NAME,13)referstothefirstthreecharactersinthecolumnNAME. 
ANSWER 
QUESTION 90
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaNULLvalue?WhataretheprosandconsofusingNULLS? 
92 
QUESTION 
ANULLvaluetakesuponebyteofstorageandindicatesthatavalueisnotpresentasopposedtoaspaceorzerovalue.It'stheDB2equivalentofTBDonanorganizationalchartandoftencorrectlyportraysabusinesssituation. Unfortunately,itrequiresextracodingforanapplicationprogramtohandlethissituation. 
ANSWER 
QUESTION 91
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisasynonym?Howisitused? 
93 
QUESTION 
Asynonymisusedtoreferenceatableorviewbyanothername.Theothernamecanthenbewrittenintheapplicationcodepointingtotesttablesinthedevelopmentstageandtoproductionentitieswhenthecodeismigrated.ThesynonymislinkedtotheAUTHIDthatcreatedit. 
ANSWER 
QUESTION 92
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaCartesianproduct? 
94 
QUESTION 
ACartesianproductresultsfromafaultyquery.Itisarowintheresultsforeverycombinationinthejointables. 
ANSWER 
QUESTION 93
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisatuple? 
95 
QUESTION 
StaticSQLiscompiledandoptimizedpriortoitsexecution;dynamiciscompiledandoptimizedduringexecution. 
ANSWER 
QUESTION 94
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Whatisreferentialintegrity? 
96 
QUESTION 
Referentialintegrityreferstotheconsistencythatmustbemaintainedbetweenprimaryandforeignkeys,i.e.everyforeignkeyvaluemusthaveacorrespondingprimarykeyvalue. 
ANSWER 
QUESTION 95
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
What’sthemaximumsizeofarow? 
97 
QUESTION 
8060bytes. 
ANSWER 
QUESTION 96
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
HowtochangeDatabasenameinSQLserver? 
98 
QUESTION 
Usethefollowingcode: 
SupportedinSQLserver2000and2005 
Execsp_renamedb―test‖,―test1‖ 
SupportedinSQLServer2005andlaterversion 
ALTERDatabase―test1‖ModifyName=―test‖ 
ANSWER 
QUESTION 97
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisaCursor? 
99 
QUESTION 
AdatabaseCursorisacontrolwhichenablestraversalovertherowsorrecordsinthetable.Thiscanbeviewedasapointertoonerowinasetofrows.Cursorisverymuchusefulfortraversingsuchasretrieval,additionandremovalofdatabaserecords. 
ANSWER 
QUESTION 98
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatareMagicTablesinSQLServer? 
100 
QUESTION 
InsertandDeletetablesarecreatedwhenthetriggerisfiredforanyDMLcommand.ThosetablesarecalledMagicTablesinSQLServer.Thesemagictablesareusedinsidethetriggersfordatatransaction. 
ANSWER 
QUESTION 99
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
WhatisISNULL()operator? 
101 
QUESTION 
ISNULLfunctionisusedtocheckwhethervaluegivenisNULLornotNULLinsqlserver.ThisfunctionalsoprovidestoreplaceavaluewiththeNULL. 
ANSWER 
QUESTION 100
For the hottest SQL jobs, please visit www.hirist.com 
hirist 
.com 
Resources 
102 
http://www.itechaleart.com/2013/05/top-50-sql-question-answers_11.html 
https://www.katieandemil.com/sql-interview-questions-and- answers?tab=article#Question 4 
http://www.dwbiconcepts.com/tutorial/24-interview-questions/190-top-20-sql- interview-questions-with-answers.html 
http://a4academics.com/interview-questions/53-database-and-sql/411-sql- interview-questions-and-answers-database 
http://narendra86.blogspot.com/2013/10/top-80-sql-query-interview- questions.html 
http://crackaninterview.com/sql-queries-interview-questions-answers/ 
http://career.guru99.com/top-50-sql-question-answers/ 
http://www.indiabix.com/technical/sql-server-common-questions/ 
http://career.guru99.com/top-50-sql-server-questions-answers/ 
http://www.ittestpapers.com/sql-interview-questions(25-50).html 
http://www.dotnetfunda.com/interviews/cat/8/sql-server 
http://www.careerride.com/SQLServer-Interview-Questions.aspx
www.hirist.com 
SQL 
TOP 100 
INTERVIEW QUESTIONS & ANSWERS

More Related Content

What's hot

İleri Seviye T-SQL Programlama - Chapter 02
İleri Seviye T-SQL Programlama - Chapter 02İleri Seviye T-SQL Programlama - Chapter 02
İleri Seviye T-SQL Programlama - Chapter 02Cihan Özhan
 
İleri Seviye T-SQL Programlama - Chapter 10
İleri Seviye T-SQL Programlama - Chapter 10İleri Seviye T-SQL Programlama - Chapter 10
İleri Seviye T-SQL Programlama - Chapter 10Cihan Özhan
 
SQL Joins With Examples | Edureka
SQL Joins With Examples | EdurekaSQL Joins With Examples | Edureka
SQL Joins With Examples | EdurekaEdureka!
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands1keydata
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexingMahabubur Rahaman
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answerssheibansari
 

What's hot (20)

İleri Seviye T-SQL Programlama - Chapter 02
İleri Seviye T-SQL Programlama - Chapter 02İleri Seviye T-SQL Programlama - Chapter 02
İleri Seviye T-SQL Programlama - Chapter 02
 
İleri Seviye T-SQL Programlama - Chapter 10
İleri Seviye T-SQL Programlama - Chapter 10İleri Seviye T-SQL Programlama - Chapter 10
İleri Seviye T-SQL Programlama - Chapter 10
 
Database Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal GulatiDatabase Normalization by Dr. Kamal Gulati
Database Normalization by Dr. Kamal Gulati
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
Good sql server interview_questions
Good sql server interview_questionsGood sql server interview_questions
Good sql server interview_questions
 
SQL Joins With Examples | Edureka
SQL Joins With Examples | EdurekaSQL Joins With Examples | Edureka
SQL Joins With Examples | Edureka
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
Sql commands
Sql commandsSql commands
Sql commands
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL Differences SQL Interview Questions
SQL Differences  SQL Interview QuestionsSQL Differences  SQL Interview Questions
SQL Differences SQL Interview Questions
 
Sql syllabus
Sql syllabusSql syllabus
Sql syllabus
 
Sql ppt
Sql pptSql ppt
Sql ppt
 
Mysql
MysqlMysql
Mysql
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
 
SQL
SQLSQL
SQL
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answers
 
Advanced sql
Advanced sqlAdvanced sql
Advanced sql
 
Basic SQL and History
 Basic SQL and History Basic SQL and History
Basic SQL and History
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 

Similar to Top 100 SQL Interview Questions and Answers

Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTung Nguyen Thanh
 
Diagnose RIDPool Failures
Diagnose RIDPool FailuresDiagnose RIDPool Failures
Diagnose RIDPool FailuresCuneyt Goksu
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsjcltutorial
 
What Your Database Query is Really Doing
What Your Database Query is Really DoingWhat Your Database Query is Really Doing
What Your Database Query is Really DoingDave Stokes
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaEdureka!
 
Salesforce developer fa qs
Salesforce developer fa qsSalesforce developer fa qs
Salesforce developer fa qsRakesh Joshi
 
Salesforce developer fa qs
Salesforce developer fa qsSalesforce developer fa qs
Salesforce developer fa qsRakesh Joshi
 
Fai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docx
Fai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docxFai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docx
Fai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docxssuser454af01
 
Semantic Web Standards and the Variety “V” of Big Data
Semantic Web Standards and  the Variety “V” of Big DataSemantic Web Standards and  the Variety “V” of Big Data
Semantic Web Standards and the Variety “V” of Big Databobdc
 
Sybase job interview_preparation_guide
Sybase job interview_preparation_guideSybase job interview_preparation_guide
Sybase job interview_preparation_guideNV Suresh Kumar
 
Optimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero TechnologiesOptimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero TechnologiesEmbarcadero Technologies
 
Optimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero TechnologiesOptimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero TechnologiesMichael Findling
 
Financial, Retail And Shopping Domains
Financial, Retail And Shopping DomainsFinancial, Retail And Shopping Domains
Financial, Retail And Shopping DomainsSonia Sanchez
 
Smu mba sem 3 mis winter 2014 assignments
Smu mba sem 3 mis winter 2014 assignmentsSmu mba sem 3 mis winter 2014 assignments
Smu mba sem 3 mis winter 2014 assignmentssolved_assignments
 
Erp cloud white paper final
Erp cloud white paper finalErp cloud white paper final
Erp cloud white paper finalraisinli
 
SQL For Programmers -- Boston Big Data Techcon April 27th
SQL For Programmers -- Boston Big Data Techcon April 27thSQL For Programmers -- Boston Big Data Techcon April 27th
SQL For Programmers -- Boston Big Data Techcon April 27thDave Stokes
 

Similar to Top 100 SQL Interview Questions and Answers (20)

Top 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and AnswersTop 100 .NET Interview Questions and Answers
Top 100 .NET Interview Questions and Answers
 
Diagnose RIDPool Failures
Diagnose RIDPool FailuresDiagnose RIDPool Failures
Diagnose RIDPool Failures
 
Dit yvol3iss4
Dit yvol3iss4Dit yvol3iss4
Dit yvol3iss4
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tips
 
Integration in The Cloud
Integration in The CloudIntegration in The Cloud
Integration in The Cloud
 
What Your Database Query is Really Doing
What Your Database Query is Really DoingWhat Your Database Query is Really Doing
What Your Database Query is Really Doing
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
 
Salesforce developer fa qs
Salesforce developer fa qsSalesforce developer fa qs
Salesforce developer fa qs
 
Salesforce developer fa qs
Salesforce developer fa qsSalesforce developer fa qs
Salesforce developer fa qs
 
Fai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docx
Fai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docxFai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docx
Fai[ Away with Dynamo, Bigtabte, and Cassandra194 cHArlrEF.docx
 
Semantic Web Standards and the Variety “V” of Big Data
Semantic Web Standards and  the Variety “V” of Big DataSemantic Web Standards and  the Variety “V” of Big Data
Semantic Web Standards and the Variety “V” of Big Data
 
Sybase job interview_preparation_guide
Sybase job interview_preparation_guideSybase job interview_preparation_guide
Sybase job interview_preparation_guide
 
Optimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero TechnologiesOptimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero Technologies
 
Optimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero TechnologiesOptimizing Your Database Performance | Embarcadero Technologies
Optimizing Your Database Performance | Embarcadero Technologies
 
Financial, Retail And Shopping Domains
Financial, Retail And Shopping DomainsFinancial, Retail And Shopping Domains
Financial, Retail And Shopping Domains
 
10 sql tips
10 sql tips10 sql tips
10 sql tips
 
Web 2.0 Development with IBM DB2
Web 2.0 Development with IBM DB2Web 2.0 Development with IBM DB2
Web 2.0 Development with IBM DB2
 
Smu mba sem 3 mis winter 2014 assignments
Smu mba sem 3 mis winter 2014 assignmentsSmu mba sem 3 mis winter 2014 assignments
Smu mba sem 3 mis winter 2014 assignments
 
Erp cloud white paper final
Erp cloud white paper finalErp cloud white paper final
Erp cloud white paper final
 
SQL For Programmers -- Boston Big Data Techcon April 27th
SQL For Programmers -- Boston Big Data Techcon April 27thSQL For Programmers -- Boston Big Data Techcon April 27th
SQL For Programmers -- Boston Big Data Techcon April 27th
 

Recently uploaded

Joshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxJoshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxsportsworldproductio
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...ssifa0344
 
Personal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando NegronPersonal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando Negronnegronf24
 
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Rearing technique of lac insect and their management
Rearing technique of lac insect and their managementRearing technique of lac insect and their management
Rearing technique of lac insect and their managementSaurabhTiwari264113
 
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceSanjay Bokadia
 
一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证
一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证
一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证epodumf6
 
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...amitlee9823
 
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...Pooja Nehwal
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...ZurliaSoop
 
Presentation for the country presentation
Presentation for the country presentationPresentation for the country presentation
Presentation for the country presentationjalal879
 
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...amitlee9823
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Standkumarajju5765
 

Recently uploaded (20)

Joshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxJoshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptx
 
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Hosur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
 
Personal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando NegronPersonal Brand Exploration - Fernando Negron
Personal Brand Exploration - Fernando Negron
 
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Rearing technique of lac insect and their management
Rearing technique of lac insect and their managementRearing technique of lac insect and their management
Rearing technique of lac insect and their management
 
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector Experience
 
一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证
一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证
一比一原版(毕业证书)意大利米兰理工大学毕业证学位证可查学历认证
 
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
 
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
Dombivli Call Girls, 9892124323, Kharghar Call Girls, chembur Call Girls, Vas...
 
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
Jual obat aborsi Jakarta ( 085657271886 )Cytote pil telat bulan penggugur kan...
 
Presentation for the country presentation
Presentation for the country presentationPresentation for the country presentation
Presentation for the country presentation
 
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hosur Road Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Chikkabanavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
 

Top 100 SQL Interview Questions and Answers

  • 1. hirist .com www.hirist.com SQL TOP 100 INTERVIEW QUESTIONS & ANSWERS
  • 2. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisDBMS? 2 QUESTION ADatabaseManagementSystem(DBMS)isaprogramthatcontrolscreation,maintenanceanduseofadatabase. DBMScanbetermedasFileManagerthatmanagesdatainadatabaseratherthansavingitinfilesystems. ANSWER QUESTION 1
  • 3. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisRDBMS? 3 QUESTION RDBMSstandsforRelationalDatabaseManagementSystem.RDBMSstorethedataintothecollectionoftables, whichisrelatedbycommonfieldsbetweenthecolumnsofthetable.Italsoprovidesrelationaloperatorstomanipulatethedatastoredintothetables. Example:SQLServer. ANSWER QUESTION 2
  • 4. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisSQL? 4 QUESTION SQLstandsforStructuredQueryLanguage,anditisusedtocommunicatewiththeDatabase.Thisisastandardlanguageusedtoperformtaskssuchasretrieval,updation,insertionanddeletionofdatafromadatabase. StandardSQLCommandsareSelect. ANSWER QUESTION 3
  • 5. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaDatabase? 5 QUESTION Databaseisnothingbutanorganizedformofdataforeasyaccess,storing,retrievalandmanagingofdata.Thisisalsoknownasstructuredformofdatawhichcanbeaccessedinmanyways. Example:SchoolManagementDatabase,BankManagementDatabase. ANSWER QUESTION 4
  • 6. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhataretablesandFields? 6 QUESTION AtableisasetofdatathatareorganizedinamodelwithColumnsandRows.Columnscanbecategorizedasvertical,andRowsarehorizontal.Atablehasspecifiednumberofcolumncalledfieldsbutcanhaveanynumberofrowswhichiscalledrecord. Example:. Table:Employee. Field:EmpID,EmpName,DateofBirth. Data:201456,David,11/15/1960. ANSWER QUESTION 5
  • 7. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisaprimarykey? 7 QUESTION Aprimarykeyisacombinationoffieldswhichuniquelyspecifyarow.Thisisaspecialkindofuniquekey,andithasimplicitNOTNULLconstraint.Itmeans,PrimarykeyvaluescannotbeNULL. ANSWER QUESTION 6
  • 8. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisauniquekey? 8 QUESTION AUniquekeyconstraintuniquelyidentifiedeachrecordinthedatabase.Thisprovidesuniquenessforthecolumnorsetofcolumns. APrimarykeyconstrainthasautomaticuniqueconstraintdefinedonit.Butnot,inthecaseofUniqueKey. Therecanbemanyuniqueconstraintdefinedpertable,butonlyonePrimarykeyconstraintdefinedpertable. ANSWER QUESTION 7
  • 9. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisaforeignkey? 9 QUESTION Aforeignkeyisonetablewhichcanberelatedtotheprimarykeyofanothertable.Relationshipneedstobecreatedbetweentwotablesbyreferencingforeignkeywiththeprimarykeyofanothertable. ANSWER QUESTION 8
  • 10. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatarethetypesofjoinandexplaineach? 10 QUESTION Therearevarioustypesofjoinwhichcanbeusedtoretrievedataanditdependsontherelationshipbetweentables. InnerJoin:Innerjoinreturnrowswhenthereisatleastonematchofrowsbetweenthetables. RightJoin:RightjoinreturnrowswhicharecommonbetweenthetablesandallrowsofRighthandsidetable. Simply,itreturnsalltherowsfromtherighthandsidetableeventhoughtherearenomatchesinthelefthandsidetable. LeftJoin:LeftjoinreturnrowswhicharecommonbetweenthetablesandallrowsofLefthandsidetable.Simply,itreturnsalltherowsfromLefthandsidetableeventhoughtherearenomatchesintheRighthandsidetable. FullJoin:Fulljoinreturnrowswhentherearematchingrowsinanyoneofthetables.Thismeans,itreturnsalltherowsfromthelefthandsidetableandalltherowsfromtherighthandsidetable. ANSWER QUESTION 9
  • 11. For the hottest SQL jobs, please visit www.hirist.com hirist .com Explainanouterjoin? 11 QUESTION Anouterjoinincludesrowsfromtableswhentherearenomatchingvaluesinthetables. ANSWER QUESTION 10
  • 12. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisnormalization? 12 QUESTION Normalizationistheprocessofminimizingredundancyanddependencybyorganizingfieldsandtableofadatabase.ThemainaimofNormalizationistoadd,deleteormodifyfieldthatcanbemadeinasingletable. ANSWER QUESTION 11
  • 13. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisDenormalization? 13 QUESTION DeNormalizationisatechniqueusedtoaccessthedatafromhighertolowernormalformsofdatabase.Itisalsoprocessofintroducingredundancyintoatablebyincorporatingdatafromtherelatedtables. ANSWER QUESTION 12
  • 14. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatareallthedifferentnormalizations? 14 QUESTION Thenormalformscanbedividedinto4forms,andtheyareexplainedbelow-. FirstNormalForm(1NF):Thisshouldremovealltheduplicatecolumnsfromthetable.Creationoftablesfortherelateddataandidentificationofuniquecolumns. SecondNormalForm(2NF):Meetingallrequirementsofthefirstnormalform.PlacingthesubsetsofdatainseparatetablesandCreationofrelationshipsbetweenthetablesusingprimarykeys. ThirdNormalForm(3NF):Thisshouldmeetallrequirementsof2NF.Removingthecolumnswhicharenotdependentonprimarykeyconstraints. FourthNormalForm(4NF):Meetingalltherequirementsofthirdnormalformanditshouldnothavemulti- valueddependencies. ANSWER QUESTION 13
  • 15. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisanIndex?Whatareallthedifferenttypesofindexes? 15 QUESTION Anindexisperformancetuningmethodofallowingfasterretrievalofrecordsfromthetable.Anindexcreatesanentryforeachvalueanditwillbefastertoretrievedata. Thisindexingdoesnotallowthefieldtohaveduplicatevaluesifthecolumnisuniqueindexed.Uniqueindexcanbeappliedautomaticallywhenprimarykeyisdefined. ClusteredIndex:Thistypeofindexreordersthephysicalorderofthetableandsearchbasedonthekeyvalues. Eachtablecanhaveonlyoneclusteredindex. NonClusteredIndex:NonClusteredIndexdoesnotalterthephysicalorderofthetableandmaintainslogicalorderofdata.Eachtablecanhave999nonclusteredindexes. ANSWER QUESTION 14
  • 16. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisarelationshipandwhatarethey? 16 QUESTION DatabaseRelationshipisdefinedastheconnectionbetweenthetablesinadatabase.Therearevariousdatabasingrelationships,andtheyareasfollows:. OnetoOneRelationship. OnetoManyRelationship. ManytoOneRelationship. Self-ReferencingRelationship. ANSWER QUESTION 15
  • 17. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisaquery? 17 QUESTION ADBqueryisacodewritteninordertogettheinformationbackfromthedatabase.Querycanbedesignedinsuchawaythatitmatchedwithourexpectationoftheresultset.Simply,aquestiontotheDatabase. ANSWER QUESTION 16
  • 18. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatissubquery?Whatarethetypesofsubquery? 18 QUESTION Asubqueryisaquerywithinanotherquery.Theouterqueryiscalledasmainquery,andinnerqueryiscalledsubquery.SubQueryisalwaysexecutedfirst,andtheresultofsubqueryispassedontothemainquery. Therearetwotypesofsubquery–CorrelatedandNon-Correlated. Acorrelatedsubquerycannotbeconsideredasindependentquery,butitcanreferthecolumninatablelistedintheFROMthelistofthemainquery. ANon-Correlatedsubquerycanbeconsideredasindependentqueryandtheoutputofsubqueryaresubstitutedinthemainquery. ANSWER QUESTION 17
  • 19. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisatrigger? 19 QUESTION ADBtriggerisacodeorprogramsthatautomaticallyexecutewithresponsetosomeeventonatableorviewinadatabase.Mainly,triggerhelpstomaintaintheintegrityofthedatabase. Example:Whenanewstudentisaddedtothestudentdatabase,newrecordsshouldbecreatedintherelatedtableslikeExam,ScoreandAttendancetables. ANSWER QUESTION 18
  • 20. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatarethetypesofTriggers? 20 QUESTION Therearefourtypesoftriggersandtheyare: •Insert •Delete •Update •Insteadof ANSWER QUESTION 19
  • 21. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisthedifferencebetweenDELETETRUNCATEandDROPcommands? 21 QUESTION DELETEcommandisusedtoremoverowsfromthetable,andWHEREclausecanbeusedforconditionalsetofparameters.CommitandRollbackcanbeperformedafterdeletestatement. TRUNCATEremovesallrowsfromthetable.Truncateoperationcannotberolledback. Dropcommandisusedtodropthetableorkeyslikeprimary,foreignfromatable. ANSWER QUESTION 20
  • 22. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisdataIntegrity? 22 QUESTION DataIntegritydefinestheaccuracyandconsistencyofdatastoredinadatabase.Itcanalsodefineintegrityconstraintstoenforcebusinessrulesonthedatawhenitisenteredintotheapplicationordatabase. ANSWER QUESTION 21
  • 23. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatiscollation? 23 QUESTION Collationisdefinedassetofrulesthatdeterminehowcharacterdatacanbesortedandcompared.ThiscanbeusedtocompareAand,otherlanguagecharactersandalsodependsonthewidthofthecharacters. ASCIIvaluecanbeusedtocomparethesecharacterdata. ANSWER QUESTION 22
  • 24. For the hottest SQL jobs, please visit www.hirist.com hirist .com AdvantagesandDisadvantagesofStoredProcedure? 24 QUESTION Storedprocedurecanbeusedasamodularprogramming–meanscreateonce,storeandcallforseveraltimeswheneverrequired.Thissupportsfasterexecutioninsteadofexecutingmultiplequeries.Thisreducesnetworktrafficandprovidesbettersecuritytothedata. DisadvantageisthatitcanbeexecutedonlyintheDatabaseandutilizesmorememoryinthedatabaseserver. ANSWER QUESTION 23
  • 25. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisSQLInjection? 25 QUESTION SQLInjectionisoneofthetechniquesusesbyhackerstohackawebsitebyinjectingSQLcommandsindatafields. ANSWER QUESTION 24
  • 26. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisthedifferencebetweenaHAVINGCLAUSEandaWHERECLAUSE? 26 QUESTION Theyspecifyasearchconditionforagrouporanaggregate.ButthedifferenceisthatHAVINGcanbeusedonlywiththeSELECTstatement.HAVINGistypicallyusedinaGROUPBYclause.WhenGROUPBYisnotused, HAVINGbehaveslikeaWHEREclause.HavingClauseisbasicallyusedonlywiththeGROUPBYfunctioninaquerywhereasWHEREClauseisappliedtoeachrowbeforetheyarepartoftheGROUPBYfunctioninaquery. ANSWER QUESTION 25
  • 27. For the hottest SQL jobs, please visit www.hirist.com hirist .com Howwouldapplydaterangefilter? 27 QUESTION a.Youcanusesimplecondition>=and<=orsimilarorusebetween/andbutthetrickistoknowyourexactdatatype. b.Sometimesdatefieldscontaintimeandthatiswherethequerycangowrongsoitisrecommendedtousesomedaterelatedfunctionstoremovethetimeissue.InSQLServercommonfunctiontodothatisdatedifffunction. c.Youalsohavetobeawareofdifferenttimezonesandservertimezone. d.Toincreasequeryperformanceyoumaystillwanttousebetweenhoweveryoushouldbeawareofproperformatyoushoulduseifnotitmightmisbehaveduringfiltering. ANSWER QUESTION 26
  • 28. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisthedifferencebetweenJOINandUNION? 28 QUESTION SQLJOINallowsusto―lookup‖recordsonothertablebasedonthegivenconditionsbetweentwotables.Forexample,ifwehavethedepartmentIDofeachemployee,thenwecanusethisdepartmentIDoftheemployeetabletojoinwiththedepartmentIDofdepartmenttabletolookupdepartmentnames. UNIONoperationallowsustoadd2similardatasetstocreateresultingdatasetthatcontainsallthedatafromthesourcedatasets.Uniondoesnotrequireanyconditionforjoining.Forexample,ifyouhave2employeetableswithsamestructure,youcanUNIONthemtocreateoneresultsetthatwillcontainalltheemployeesfrombothofthetables. SELECT*FROMEMP1 UNION SELECT*FROMEMP2; ANSWER QUESTION 27
  • 29. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisthedifferenceamongUNION,MINUSandINTERSECT? 29 QUESTION UNIONcombinestheresultsfrom2tablesandeliminatesduplicaterecordsfromtheresultset. MINUSoperatorwhenusedbetween2tables,givesusalltherowsfromthefirsttableexcepttherowswhicharepresentinthesecondtable. INTERSECToperatorreturnsusonlythematchingorcommonrowsbetween2resultsets. ANSWER QUESTION 28
  • 30. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisSelfJoinandwhyisitrequired? 30 QUESTION SelfJoinistheactofjoiningonetablewithitself.SelfJoinisoftenveryusefultoconvertahierarchicalstructureintoaflatstructure ANSWER QUESTION 29
  • 31. For the hottest SQL jobs, please visit www.hirist.com hirist .com HowcanwetransposeatableusingSQL(changingrowstocolumnorvice-versa)? 31 QUESTION TheusualwaytodoitinSQListouseCASEstatementorDECODEstatement. ANSWER QUESTION 30
  • 32. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatarethedifferencesamongROWNUM,RANKandDENSE_RANK? 32 QUESTION ROW_NUMBERassignscontiguous,uniquenumbersfrom1..Ntoaresultset. RANKdoesnotassignuniquenumbers—nordoesitassigncontiguousnumbers.Iftworecordstieforsecondplace,norecordwillbeassignedthe3rdrankasnoonecameinthird,accordingtoRANK. DENSE_RANK,likeRANK,doesnotassignuniquenumbers,butitdoesassigncontiguousnumbers.Eventhoughtworecordstiedforsecondplace,thereisathird-placerecord. ANSWER QUESTION 31
  • 33. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisadatabasetransaction? 33 QUESTION Databasetransactiontakedatabasefromoneconsistentstatetoanother.Attheendofthetransactionthesystemmustbeinthepriorstateiftransactionfailsorthestatusofthesystemshouldreflectthesuccessfulcompletionifthetransactiongoesthrough. ANSWER QUESTION 32
  • 34. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatarepropertiesofatransaction? 34 QUESTION PropertiesofthetransactioncanbesummarizedasACIDProperties. 1.Atomicity:Atransactionconsistsofmanysteps.Whenallthestepsinatransactiongetscompleted,itwillgetreflectedinDBorifanystepfails,allthetransactionsarerolledback. 2.Consistency:Thedatabasewillmovefromoneconsistentstatetoanother,ifthetransactionsucceedsandremainintheoriginalstate,ifthetransactionfails. 3.Isolation:Everytransactionshouldoperateasifitistheonlytransactioninthesystem 4.Durability:Onceatransactionhascompletedsuccessfully,theupdatedrows/recordsmustbeavailableforallothertransactionsonapermanentbasis ANSWER QUESTION 33
  • 35. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaDatabaseLock?Whatarethetypeoflocks? 35 QUESTION Databaselocktellatransaction,ifthedataiteminquestionsiscurrentlybeingusedbyothertransactions. 1.SharedLock:Whenasharedlockisappliedondataitem,othertransactionscanonlyreadtheitem,butcan'twriteintoit. 2.ExclusiveLock:Whenaexclusivelockisappliedondataitem,othertransactionscan'treadorwriteintothedataitem. ANSWER QUESTION 34
  • 36. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaCompositeKey? 36 QUESTION ACompositeprimarykeyisatypeofcandidatekey,whichrepresentsasetofcolumnswhosevaluesuniquelyidentifyeveryrowinatable. Forexample-if"Employee_ID"and"EmployeeName"inatableiscombinedtouniquelyidentifiesarowitscalledaCompositeKey. ANSWER QUESTION 35
  • 37. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaCompositePrimaryKey? 37 QUESTION ACompositeprimarykeyisasetofcolumnswhosevaluesuniquelyidentifyeveryrowinatable.Whatitmeansisthat,tablewhichcontainscompositeprimarykeywillbeindexedbasedoncolumnsspecifiedintheprimarykey. ThiskeywillbereferredinForeignKeytables. Forexample-ifcombinedeffectofcolumns,"Employee_ID"and"EmployeeName"inatableisrequiredtouniquelyidentifiesarow,itscalledaCompositePrimaryKey.Inthiscase,boththecolumnswillberepresentedasprimarykey. ANSWER QUESTION 36
  • 38. For the hottest SQL jobs, please visit www.hirist.com hirist .com DefineSQLInsertStatement? 38 QUESTION SQLINSERTstatementisusedtoaddrowstoatable.Forafullrowinsert,SQLQueryshouldstartwith―insertinto―statementfollowedbytablenameandvaluescommand,followedbythevaluesthatneedtobeinsertedintothetable.Insertcanbeusedinseveralways: 1.Toinsertasinglecompleterow 2.Toinsertasinglepartialrow ANSWER QUESTION 37
  • 39. For the hottest SQL jobs, please visit www.hirist.com hirist .com DefineSQLUpdateStatement? 39 QUESTION SQLUpdateisusedtoupdatedatainaroworsetofrowsspecifiedinthefiltercondition. ThebasicformatofanSQLUPDATEstatementis,UpdatecommandfollowedbytabletobeupdatedandSETcommandfollowedbycolumnnamesandtheirnewvaluesfollowedbyfilterconditionthatdetermineswhichrowsshouldbeupdated. ANSWER QUESTION 38
  • 40. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatarewildcardsusedindatabaseforPatternMatching? 40 QUESTION SQLLikeoperatorisuserforpatternmatching.SQL'Like'commandtakesmoretimetoprocess.Sobeforeusinglikeoperator,considersuggestionsgivenbelowonwhenandwheretousewildcardsearch. 1)Don'toverusewildcards.Ifanothersearchoperatorwilldo,useitinstead. 2)Whenyoudousewildcards,trynottousethematthebeginningofthesearchpattern,unlessabsolutelynecessary.Searchpatternsthatbeginwithwildcardsaretheslowesttoprocess. 3)Paycarefulattentiontotheplacementofthewildcardsymbols.Iftheyaremisplaced,youmightnotreturnthedatayouintended ANSWER QUESTION 39
  • 41. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisCrossJoin? 41 QUESTION CrossJoinwillreturnallrecordswhereeachrowfromthefirsttableiscombinedwitheachrowfromthesecondtable. ANSWER QUESTION 40
  • 42. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisaview? 42 QUESTION Viewsarevirtualtables.Unliketablesthatcontaindata,viewssimplycontainqueriesthatdynamicallyretrievedatawhenused. ANSWER QUESTION 41
  • 43. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisamaterializedview? 43 QUESTION Materializedviewsisalsoaviewbutarediskbased.Materializedviewsgetupdatedonspecificduration,baseupontheintervalspecifiedinthequerydefinition.Wecanindexmaterializedview. ANSWER QUESTION 42
  • 44. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whataretheadvantagesanddisadvantagesofviewsinadatabase? 44 QUESTION Advantages: 1.Viewsdoesn'tstoredatainaphysicallocation. 2.Viewcanbeusetohidesomeofthecolumnsfromthetable 3.ViewscanprovideAccessRestriction,sincedatainsertion,updateanddeletionisnotpossibleontheview. Disadvantages: 1.Whenatableisdropped,associatedviewbecomeirrelevant. 2.Sinceviewarecreatedwhenaqueryrequestingdatafromviewistriggered,itsbitslow 3.Whenviewsarecreatedforlargetables,itoccupymorememory. ANSWER QUESTION 43
  • 45. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhendoyouuseUPDATE_STATISTICScommand? 45 QUESTION Thiscommandisusedwhenalargeprocessingofdatahasoccurred.Ifanylargeamountofdeletions,anymodifications,orBulkCopyintothetableshasoccurred,ithastoupdatetheindexestotakethesechangesintoaccount.UPDATE_STATISTICSupdatestheindexesonthesetablesaccordingly. ANSWER QUESTION 44
  • 46. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisanIDENTITYcolumnininsertstatements? 46 QUESTION IDENTITYcolumnisusedintablecolumnstomakethatcolumnasAutoincrementalnumberorasurrogatekey. ANSWER QUESTION 45
  • 47. For the hottest SQL jobs, please visit www.hirist.com hirist .com HowwillIretrieveallrecordsofemployment1thoseshouldnotbepresentnemployment2? 47 QUESTION (Select*fromemployment2)-(Select*fromemployment1). ANSWER QUESTION 46
  • 48. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhichTCP/IPportdoesSQLServerrunon?Howcanitbechanged? 48 QUESTION SQLServerrunsonport1433.ItcanbechangedfromtheNetworkUtilityTCP/IPproperties. ANSWER QUESTION 47
  • 49. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisSQLServerAgent? 49 QUESTION SQLServeragentplaysanimportantroleintheday-to-daytasksofadatabaseadministrator(DBA).ItspurposeistoeasetheimplementationoftasksfortheDBA,withitsfull-functionschedulingengine,whichallowsyoutoscheduleyourownjobsandscripts. ANSWER QUESTION 48
  • 50. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhichcommandusingQueryAnalyzerwillgiveyoutheversionofSQLserverandoperatingsystem? 50 QUESTION SELECTSERVERPROPERTY('productversion'),SERVERPROPERTY('productlevel')andSERVERPROPERTY('edition') ANSWER QUESTION 49
  • 51. For the hottest SQL jobs, please visit www.hirist.com hirist .com HowtocreaterecursivequeryinSQLServer? 51 QUESTION RecursivequerycanbecreateinSQLusingstoredprocedurebutyoucanalsouseCTE(Commontableexpression).ItmightbealsoworthaskingaboutperformanceasCTEisnotalwaysveryfast. ANSWER QUESTION 51
  • 52. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisaconstraint? 52 QUESTION Constraintcanbeusedtospecifythelimitonthedatatypeoftable.Constraintcanbespecifiedwhilecreatingoralteringthetablestatement.Sampleofconstraintare. •NOTNULL. •CHECK. •DEFAULT. •UNIQUE. •PRIMARYKEY. •FOREIGNKEY. ANSWER QUESTION 51
  • 53. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisAutoIncrement? 53 QUESTION Autoincrementkeywordallowstheusertocreateauniquenumbertobegeneratedwhenanewrecordisinsertedintothetable.AUTOINCREMENTkeywordcanbeusedinOracleandIDENTITYkeywordcanbeusedinSQLSERVER. MostlythiskeywordcanbeusedwheneverPRIMARYKEYisused. ANSWER QUESTION 52
  • 54. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisDatawarehouse? 54 QUESTION Datawarehouseisacentralrepositoryofdatafrommultiplesourcesofinformation.Thosedataareconsolidated, transformedandmadeavailablefortheminingandonlineprocessing.WarehousedatahaveasubsetofdatacalledDataMarts. ANSWER QUESTION 53
  • 55. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisuserdefinedfunctions? 55 QUESTION Userdefinedfunctionsarethefunctionswrittentousethatlogicwheneverrequired.Itisnotnecessarytowritethesamelogicseveraltimes.Instead,functioncanbecalledorexecutedwheneverneeded. ANSWER QUESTION 54
  • 56. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatarealltypesofuserdefinedfunctions? 56 QUESTION Threetypesofuserdefinedfunctionsare. a.ScalarFunctions. b.InlineTablevaluedfunctions. c.Multistatementvaluedfunctions. ANSWER QUESTION 55
  • 57. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatarealldifferenttypesofcollationsensitivity? 57 QUESTION Followingaredifferenttypesofcollationsensitivity-. •CaseSensitivity–AandaandBandb. •AccentSensitivity. •KanaSensitivity–JapaneseKanacharacters. •WidthSensitivity–Singlebytecharacteranddoublebytecharacter. ANSWER QUESTION 56
  • 58. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisOnlineTransactionProcessing(OLTP)? 58 QUESTION OnlineTransactionProcessingorOLTPmanagestransactionbasedapplicationswhichcanbeusedfordataentryandeasyretrievalprocessingofdata.Thisprocessingmakeslikeeasieronsimplicityandefficiency.Itisfaster, moreaccurateresultsandexpenseswithrespecttoOTLP. Example–BankTransactionsonadailybasis. ANSWER QUESTION 57
  • 59. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisanALIAScommand? 59 QUESTION ALIASnamecanbegiventoatableorcolumn.ThisaliasnamecanbereferredinWHEREclausetoidentifythetableorcolumn. Example-. Selectst.StudentID,Ex.Resultfromstudentst,ExamasExwherest.studentID=Ex.StudentID Here,streferstoaliasnameforstudenttableandExreferstoaliasnameforexamtable. ANSWER QUESTION 58
  • 60. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatareaggregateandscalarfunctions? 60 QUESTION Aggregatefunctionsareusedtoevaluatemathematicalcalculationandreturnsinglevalues.Thiscanbecalculatedfromthecolumnsinatable.Scalarfunctionsreturnasinglevaluebasedontheinputvalue. Example-. Aggregate–max(),count–Calculatedwithrespecttonumeric. Scalar–UCASE(),NOW()–Calculatedwithrespecttostrings. ANSWER QUESTION 59
  • 61. For the hottest SQL jobs, please visit www.hirist.com hirist .com Howcanyoucreateanemptytablefromanexistingtable? 61 QUESTION Select*intostudentcopyfromstudentwhere1=2 Here,wearecopyingstudenttabletoanothertablewiththesamestructurewithnorowscopied. ANSWER QUESTION 60
  • 62. For the hottest SQL jobs, please visit www.hirist.com hirist .com Howtofetchcommonrecordsfromtwotables? 62 QUESTION Commonrecordsresultsetcanbeachievedby-. SelectstudentIDfromstudent.<strong>INTERSECT</strong>SelectStudentIDfromExam ANSWER QUESTION 61
  • 63. For the hottest SQL jobs, please visit www.hirist.com hirist .com Howtoselectuniquerecordsfromatable? 63 QUESTION SelectuniquerecordsfromatablebyusingDISTINCTkeyword. SelectDISTINCTStudentID,StudentNamefromStudent. ANSWER QUESTION 62
  • 64. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatarethedifferentindexconfigurationsatablecanhave? 64 QUESTION Atablecanhaveoneofthefollowingindexconfigurations: 1.Noindexes 2.Aclusteredindex 3.Aclusteredindexandmanynonclusteredindexes 4.Anonclusteredindex 5.Manynonclusteredindexes ANSWER QUESTION 63
  • 65. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatarethepropertiesanddifferentTypesofSub-Queries? 65 QUESTION PropertiesofSub-Query a.Asub-querymustbeenclosedintheparenthesis. b.Asub-querymustbeputintherighthandofthecomparisonoperator,and c.Asub-querycannotcontainanORDER-BYclause. d.Aquerycancontainmorethanonesub-query. TypesofSub-Query e.Single-rowsub-query,wherethesub-queryreturnsonlyonerow. f.Multiple-rowsub-query,wherethesub-queryreturnsmultiplerows,.and g.Multiplecolumnsub-query,wherethesub-queryreturnsmultiplecolumns ANSWER QUESTION 64
  • 66. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisSQLProfiler? 66 QUESTION SQLProfilerisagraphicaltoolthatallowssystemadministratorstomonitoreventsinaninstanceofMicrosoftSQLServer.YoucancaptureandsavedataabouteacheventtoafileorSQLServertabletoanalyzelater.Forexample,youcanmonitoraproductionenvironmenttoseewhichstoredproceduresarehamperingperformancesbyexecutingtooslowly. UseSQLProfilertomonitoronlytheeventsinwhichyouareinterested.Iftracesarebecomingtoolarge,youcanfilterthembasedontheinformationyouwant,sothatonlyasubsetoftheeventdataiscollected.Monitoringtoomanyeventsaddsoverheadtotheserverandthemonitoringprocessandcancausethetracefileortracetabletogrowverylarge,especiallywhenthemonitoringprocesstakesplaceoveralongperiodoftime. ANSWER QUESTION 65
  • 67. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhataretheauthenticationmodesinSQLServer?Howcanitbechanged? 67 QUESTION WindowsmodeandMixedMode-SQLandWindows.TochangeauthenticationmodeinSQLServerclickStart, Programs,MicrosoftSQLServerandclickSQLEnterpriseManagertorunSQLEnterpriseManagerfromtheMicrosoftSQLServerprogramgroup.SelecttheserverthenfromtheToolsmenuselectSQLServerConfigurationProperties,andchoosetheSecuritypage. ANSWER QUESTION 66
  • 68. For the hottest SQL jobs, please visit www.hirist.com hirist .com Canastoredprocedurecallitselforrecursivestoredprocedure?HowmuchlevelSPnestingispossible? 68 QUESTION Yes.BecauseTransact-SQLsupportsrecursion,youcanwritestoredproceduresthatcallthemselves.Recursioncanbedefinedasamethodofproblemsolvingwhereinthesolutionisarrivedatbyrepetitivelyapplyingittosubsetsoftheproblem.Acommonapplicationofrecursivelogicistoperformnumericcomputationsthatlendthemselvestorepetitiveevaluationbythesameprocessingsteps.StoredproceduresarenestedwhenonestoredprocedurecallsanotherorexecutesmanagedcodebyreferencingaCLRroutine,type,oraggregate.Youcanneststoredproceduresandmanagedcodereferencesupto32levels. ANSWER QUESTION 67
  • 69. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisLogShipping? 69 QUESTION LogshippingistheprocessofautomatingthebackupofdatabaseandtransactionlogfilesonaproductionSQLserver,andthenrestoringthemontoastandbyserver.EnterpriseEditionsonlysupportslogshipping.Inlogshippingthetransactionallogfilefromoneserverisautomaticallyupdatedintothebackupdatabaseontheotherserver.Ifoneserverfails,theotherserverwillhavethesamedbandcanbeusedthisastheDisasterRecoveryplan.Thekeyfeatureoflogshippingisthatitwillautomaticallybackuptransactionlogsthroughoutthedayandautomaticallyrestorethemonthestandbyserveratdefinedinterval. ANSWER QUESTION 68
  • 70. For the hottest SQL jobs, please visit www.hirist.com hirist .com Name3waystogetanaccuratecountofthenumberofrecordsinatable? 70 QUESTION SELECT*FROMtable1 SELECTCOUNT(*)FROMtable1 SELECTrowsFROMsysindexesWHEREid=OBJECT_ID(table1)ANDindid<2 ANSWER QUESTION 69
  • 71. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatdoesitmeantohaveQUOTED_IDENTIFIERON?WhataretheimplicationsofhavingitOFF? 71 QUESTION WhenSETQUOTED_IDENTIFIERisON,identifierscanbedelimitedbydoublequotationmarks,andliteralsmustbedelimitedbysinglequotationmarks.WhenSETQUOTED_IDENTIFIERisOFF,identifierscannotbequotedandmustfollowallTransact-SQLrulesforidentifiers. ANSWER QUESTION 70
  • 72. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisthedifferencebetweenaLocalandaGlobaltemporarytable? 72 QUESTION 1.Alocaltemporarytableexistsonlyforthedurationofaconnectionor,ifdefinedinsideacompoundstatement,forthedurationofthecompoundstatement. 2.Aglobaltemporarytableremainsinthedatabasepermanently,buttherowsexistonlywithinagivenconnection. Whenconnectionisclosed,thedataintheglobaltemporarytabledisappears.However,thetabledefinitionremainswiththedatabaseforaccesswhendatabaseisopenednexttime. ANSWER QUESTION 71
  • 73. For the hottest SQL jobs, please visit www.hirist.com hirist .com HowGlobaltemporarytablesarerepresentedanditsscope? 73 QUESTION Globaltemporarytablesarerepresentedwith##beforethetablename.Scopewillbetheoutsidethesessionwhereaslocaltemporarytablesareinsidethesession.SessionIDcanbefoundusing@@SPID. ANSWER QUESTION 72
  • 74. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatistheSTUFFfunctionandhowdoesitdifferfromtheREPLACEfunction? 74 QUESTION STUFFfunctionisusedtooverwriteexistingcharacters.Usingthissyntax,STUFF(string_expression,start,length, replacement_characters),string_expressionisthestringthatwillhavecharacterssubstituted,startisthestartingposition,lengthisthenumberofcharactersinthestringthataresubstituted,andreplacement_charactersarethenewcharactersinterjectedintothestring.REPLACEfunctiontoreplaceexistingcharactersofalloccurrences. UsingthesyntaxREPLACE(string_expression,search_string,replacement_string),whereeveryincidenceofsearch_stringfoundinthestring_expressionwillbereplacedwithreplacement_string. ANSWER QUESTION 73
  • 75. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisCHECKConstraint? 75 QUESTION ACHECKconstraintisusedtolimitthevaluesthatcanbeplacedinacolumn.Thecheckconstraintsareusedtoenforcedomainintegrity. ANSWER QUESTION 74
  • 76. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisthedifferencebetweenUNIONandUNIONALL? 76 QUESTION UNIONstatementismainlyusedtocombinethetablesincludingtheduplicaterowsandUNIONALLcombinebutdoesnotlookforduplicaterows.Withthis,UNIONALLwillbeveryfasterthanUNIONstatements. ANSWER QUESTION 75
  • 77. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisNOTNULLConstraint? 77 QUESTION ANOTNULLconstraintenforcesthatthecolumnwillnotacceptnullvalues.Thenotnullconstraintsareusedtoenforcedomainintegrity,asthecheckconstraints. ANSWER QUESTION 76
  • 78. For the hottest SQL jobs, please visit www.hirist.com hirist .com Howtoget@@ERRORand@@ROWCOUNTatthesametime? 78 QUESTION If@@RowcountischeckedafterErrorcheckingstatementthenitwillhave0asthevalueof@@Recordcountasitwouldhavebeenreset.Andif@@Recordcountischeckedbeforetheerror-checkingstatementthen@@Errorwouldgetreset.Toget@@errorand@@rowcountatthesametimedobothinsamestatementandstoretheminlocalvariable. SELECT@RC=@@ROWCOUNT,@ER=@@ERROR ANSWER QUESTION 77
  • 79. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaScheduledJobsorWhatisaScheduledTasks? 79 QUESTION Scheduledtasksletuserautomateprocessesthatrunonregularorpredictablecycles.Usercanscheduleadministrativetasks,suchascubeprocessing,torunduringtimesofslowbusinessactivity.UsercanalsodeterminetheorderinwhichtasksrunbycreatingjobstepswithinaSQLServerAgentjob.E.g.backupdatabase,UpdateStatsofTables.Jobstepsgiveusercontroloverflowofexecution.Ifonejobfails,usercanconfigureSQLServerAgenttocontinuetoruntheremainingtasksortostopexecution. ANSWER QUESTION 78
  • 80. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisatablecalled,ifithasneitherClusternorNon-clusterIndex?Whatisitusedfor? 80 QUESTION UnindexedtableorHeap.MicrosoftPressBooksandBookonLine(BOL)refersitasHeap.Aheapisatablethatdoesnothaveaclusteredindexand,therefore,thepagesarenotlinkedbypointers.TheIAMpagesaretheonlystructuresthatlinkthepagesinatabletogether.Unindexedtablesaregoodforfaststoringofdata.Manytimesitisbettertodropallindexesfromtableandthendobulkofinsertsandtorestorethoseindexesafterthat. ANSWER QUESTION 79
  • 81. For the hottest SQL jobs, please visit www.hirist.com hirist .com CanSQLServerslinkedtootherserverslikeOracle? 81 QUESTION SQLServercanbelinkedtoanyserverprovidedithasOLE-DBproviderfromMicrosofttoallowalink.E.g.OraclehasanOLE-DBproviderfororaclethatMicrosoftprovidestoadditaslinkedservertoSQLServergroup. ANSWER QUESTION 80
  • 82. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisBCP?Whendoesitused? 82 QUESTION BulkCopyisatoolusedtocopyhugeamountofdatafromtablesandviews.BCPdoesnotcopythestructuressameassourcetodestination.BULKINSERTcommandhelpstoimportadatafileintoadatabasetableorviewinauser-specifiedformat. ANSWER QUESTION 81
  • 83. For the hottest SQL jobs, please visit www.hirist.com hirist .com Howtoimplementone-to-one,one-to-manyandmany-to-manyrelationshipswhiledesigningtables? 83 QUESTION One-to-Onerelationshipcanbeimplementedasasingletableandrarelyastwotableswithprimaryandforeignkeyrelationships.One-to-Manyrelationshipsareimplementedbysplittingthedataintotwotableswithprimarykeyandforeignkeyrelationships.Many-to-Manyrelationshipsareimplementedusingajunctiontablewiththekeysfromboththetablesformingthecompositeprimarykeyofthejunctiontable. ANSWER QUESTION 82
  • 84. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisanexecutionplan?Whenwouldyouuseit?Howwouldyouviewtheexecutionplan? 84 QUESTION AnexecutionplanisbasicallyaroadmapthatgraphicallyortextuallyshowsthedataretrievalmethodschosenbytheSQLServerqueryoptimizerforastoredprocedureorad-hocqueryandisaveryusefultoolforadevelopertounderstandtheperformancecharacteristicsofaqueryorstoredproceduresincetheplanistheonethatSQLServerwillplaceinitscacheandusetoexecutethestoredprocedureorquery.FromwithinQueryAnalyzerisanoptioncalled"ShowExecutionPlan"(locatedontheQuerydrop-downmenu).Ifthisoptionisturnedonitwilldisplayqueryexecutionplaninseparatewindowwhenqueryisranagain. ANSWER QUESTION 83
  • 85. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatarethetwoauthenticationmodesinSQLServer? 85 QUESTION Therearetwoauthenticationmodes– •WindowsMode •MixedMode ModescanbechangedbyselectingthetoolsmenuofSQLServerconfigurationpropertiesandchoosesecuritypage. ANSWER QUESTION 84
  • 86. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisCOALESCEinSQLServer? 86 QUESTION COALESCEisusedtoreturnfirstnon-nullexpressionwithinthearguments.Thisfunctionisusedtoreturnanon- nullfrommorethanonecolumninthearguments. Example– SelectCOALESCE(empno,empname,salary)fromemployee; ANSWER QUESTION 85
  • 87. For the hottest SQL jobs, please visit www.hirist.com hirist .com HowexceptionscanbehandledinSQLServerProgramming? 87 QUESTION ExceptionsarehandledusingTRY—-CATCHconstructsanditishandlesbywritingscriptsinsidetheTRYblockanderrorhandlingintheCATCHblock. ANSWER QUESTION 86
  • 88. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisthepurposeofFLOORfunction? 88 QUESTION FLOORfunctionisusedtoroundupanon-integervaluetothepreviousleastinteger.ExampleisgivenFLOOR(6.7) Returns6. ANSWER QUESTION 87
  • 89. For the hottest SQL jobs, please visit www.hirist.com hirist .com Canwechecklocksindatabase?Ifso,howcanwedothislockcheck? 89 QUESTION Yes,wecanchecklocksinthedatabase.Itcanbeachievedbyusingin-builtstoredprocedurecalledsp_lock. ANSWER QUESTION 88
  • 90. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatistheuseofSIGNfunction? 90 QUESTION SIGNfunctionisusedtodeterminewhetherthenumberspecifiedisPositive,NegativeandZero.Thiswillreturn+1,-1or0. Example:SIGN(-35)returns-1 ANSWER QUESTION 89
  • 91. For the hottest SQL jobs, please visit www.hirist.com hirist .com HowistheSUBSTRkeywordusedinSQL? 91 QUESTION SUBSTRisusedforstringmanipulationwithcolumnname,firstpositionandstringlengthusedasarguments.E.g. SUBSTR(NAME,13)referstothefirstthreecharactersinthecolumnNAME. ANSWER QUESTION 90
  • 92. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaNULLvalue?WhataretheprosandconsofusingNULLS? 92 QUESTION ANULLvaluetakesuponebyteofstorageandindicatesthatavalueisnotpresentasopposedtoaspaceorzerovalue.It'stheDB2equivalentofTBDonanorganizationalchartandoftencorrectlyportraysabusinesssituation. Unfortunately,itrequiresextracodingforanapplicationprogramtohandlethissituation. ANSWER QUESTION 91
  • 93. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisasynonym?Howisitused? 93 QUESTION Asynonymisusedtoreferenceatableorviewbyanothername.Theothernamecanthenbewrittenintheapplicationcodepointingtotesttablesinthedevelopmentstageandtoproductionentitieswhenthecodeismigrated.ThesynonymislinkedtotheAUTHIDthatcreatedit. ANSWER QUESTION 92
  • 94. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaCartesianproduct? 94 QUESTION ACartesianproductresultsfromafaultyquery.Itisarowintheresultsforeverycombinationinthejointables. ANSWER QUESTION 93
  • 95. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisatuple? 95 QUESTION StaticSQLiscompiledandoptimizedpriortoitsexecution;dynamiciscompiledandoptimizedduringexecution. ANSWER QUESTION 94
  • 96. For the hottest SQL jobs, please visit www.hirist.com hirist .com Whatisreferentialintegrity? 96 QUESTION Referentialintegrityreferstotheconsistencythatmustbemaintainedbetweenprimaryandforeignkeys,i.e.everyforeignkeyvaluemusthaveacorrespondingprimarykeyvalue. ANSWER QUESTION 95
  • 97. For the hottest SQL jobs, please visit www.hirist.com hirist .com What’sthemaximumsizeofarow? 97 QUESTION 8060bytes. ANSWER QUESTION 96
  • 98. For the hottest SQL jobs, please visit www.hirist.com hirist .com HowtochangeDatabasenameinSQLserver? 98 QUESTION Usethefollowingcode: SupportedinSQLserver2000and2005 Execsp_renamedb―test‖,―test1‖ SupportedinSQLServer2005andlaterversion ALTERDatabase―test1‖ModifyName=―test‖ ANSWER QUESTION 97
  • 99. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisaCursor? 99 QUESTION AdatabaseCursorisacontrolwhichenablestraversalovertherowsorrecordsinthetable.Thiscanbeviewedasapointertoonerowinasetofrows.Cursorisverymuchusefulfortraversingsuchasretrieval,additionandremovalofdatabaserecords. ANSWER QUESTION 98
  • 100. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatareMagicTablesinSQLServer? 100 QUESTION InsertandDeletetablesarecreatedwhenthetriggerisfiredforanyDMLcommand.ThosetablesarecalledMagicTablesinSQLServer.Thesemagictablesareusedinsidethetriggersfordatatransaction. ANSWER QUESTION 99
  • 101. For the hottest SQL jobs, please visit www.hirist.com hirist .com WhatisISNULL()operator? 101 QUESTION ISNULLfunctionisusedtocheckwhethervaluegivenisNULLornotNULLinsqlserver.ThisfunctionalsoprovidestoreplaceavaluewiththeNULL. ANSWER QUESTION 100
  • 102. For the hottest SQL jobs, please visit www.hirist.com hirist .com Resources 102 http://www.itechaleart.com/2013/05/top-50-sql-question-answers_11.html https://www.katieandemil.com/sql-interview-questions-and- answers?tab=article#Question 4 http://www.dwbiconcepts.com/tutorial/24-interview-questions/190-top-20-sql- interview-questions-with-answers.html http://a4academics.com/interview-questions/53-database-and-sql/411-sql- interview-questions-and-answers-database http://narendra86.blogspot.com/2013/10/top-80-sql-query-interview- questions.html http://crackaninterview.com/sql-queries-interview-questions-answers/ http://career.guru99.com/top-50-sql-question-answers/ http://www.indiabix.com/technical/sql-server-common-questions/ http://career.guru99.com/top-50-sql-server-questions-answers/ http://www.ittestpapers.com/sql-interview-questions(25-50).html http://www.dotnetfunda.com/interviews/cat/8/sql-server http://www.careerride.com/SQLServer-Interview-Questions.aspx
  • 103. www.hirist.com SQL TOP 100 INTERVIEW QUESTIONS & ANSWERS