SQL Interview Questions and Answers - Software Testing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

Home

SoftwareTestingJobs

SeleniumOnlineTraining

SoftwareTestingWalkins

SoftwareTesting
AblogaboutSoftwareTesting,JavaProgramming,andSQL.
ManualTesting,Selenium,UFT,Java,andDatabaseTechnologies.

ManualTesting

YouTube

SeleniumTutorials

13K

Follow

Like 3.2K

Replay

UFT/QTPVideos

SQL

Java

TestingResumes

Videos

SoftwareTestingGuide

SQLInterviewQuestionsandAnswers
1:01AM

2.4k

Share

SeleniumVideos

GCREDDY

14COMMENTS

SQLInterviewQuestionsandAnswers

WalkinJobs

Search
TestingWalkinJobs
SeleniumOnlineTraining

Q.WhatisSQL?

SoftwareTestingJobs

SoftwareTestingJobsin
Hyderabad

StructuredQueryLanguage,anANSI(AmericanNationalStandardsInstitute)
standardlanguageforaccessingdatabases.
UsingSQLwecanAccessOracle,Sybase,DB2,SQLServer,MySQL,DB/400
andotherDatabaseManagementSystems

Q.WhenSQLwasappeared?
StructuredQueryLanguagewasfirstappearedbyIBMin1974anditisFree

ManualTestingTutorials
SeleniumVideos
JavaforSelenium
SeleniumWebDriver
SeleniumQuickGuide

Software(anybodycanusewithfreeofcost).

UFT/QTPTutorials

Q.WhoshouldlearnSQL?

VBScriptforUFT/QTP
SQLTutorials

DatabaseDevelopers
DatabaseTesters

DomainKnowledgefor
Testers
SoftwareTestingFAQ

NODEPOSIT
PlayFOR
NODEPOSIT
REQUIRED
REQUIRED
FREE
Offervalidfor48hours

PLAY
FREE
RUMMY
RUMMY
NOW

DatabaseAdministrators

Q.WhataretheUsagesofSQL?
Creatingnewdatabases
Creatingnewtablesinadatabase

SoftwareTesting
Resumes
TestingLiveProject
BankingSoftware
Projects

Insertingrecordsinadatabase
Updatingrecordsinadatabase

POPULARPOSTS

Deletingrecordsfromadatabase
Retrievingdatafromadatabase

SeleniumTesterResume

Executingqueriesagainstadatabase

SeleniumStepbyStep
Videos

SeleniumOnlineTraining

Creatingstoredproceduresinadatabase

SoftwareTestLifeCycle

Creatingviewsinadatabase
Settingpermissionsontables,procedures,andviews

SoftwareTestingWalkin
Jobs

SoftwareTestingTutorial
forBeginners

Etc

SoftwareTestingAsA
Career

Q.WhatisSQLProcess?

ManualTesting

SoftwareTestingBasics

WhenweareexecutinganSQLcommandforanyRDBMS,thesystem

SQLInterviewQuestions
andAnswers

determinesthebestwaytocarryoutourrequestandSQLenginefiguresout

SoftwareTestingResume

DomainKnowledge

howtointerpretthetask.

TestingDocuments

Therearevariouscomponentsincludedintheprocess.Thesecomponentsare

SoftwareTestingFAQ

engineetc.ClassicqueryenginehandlesallnonSQLqueriesbutSQLquery

SeleniumFAQ
SQLFAQ
DatabaseTestingFAQ
SoftwareQAFAQ
WebTestingFAQ
UFT/QTPFAQ

QueryDispatcher,Optimizationengines,ClassicQueryEngineandSQLquery
enginewon'thandlelogicalfiles.

Q.IsSQLsupportsProgramming?

ManualTestingInterview
Questions

SoftwareTestingFresher
CV
SoftwareTesterJob
Responsibilities
ManualTestingInterview
Questions2

No,SQLdoesnthaveConditionalandLoopstatements,usingSQLCommands
wecanaccessdatabases.

Q.WhatarethesubsetsofSQL?

http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

1/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

DataManipulationLanguage

POPULARPOSTS
LAST7DAYS
SoftwareTestingWalkin
Jobs
SQLInterviewQuestions
andAnswers
SeleniumTesterResume
InterviewsExperienceofa
SoftwareTesting
Professional
SoftwareTestingInterview
QuestionsandAnswers
JavaStepbyStepVideos
SoftwareTesterJob
Responsibilities
SoftwareTestingRealTime
InterviewQuestions
SeleniumStepbyStep
Videos

DataDefinitionLanguage
DataControlLanguage

Q.WhatisDataManipulationLanguage?

DMLisalanguagewhichenablesuserstoaccessandmanipulatedata.
DataManipulationLanguageisusedtoPerformbelowOperations:
Insertionofdataintothedatabase
Retrievalofdatafromthedatabase
Updatingdatainthedatabase
Deletionofdatainthedatabase

Q.WhatisDataDefinitionLanguage?

DataDefinitionLanguage(DDL)allowsustocreate,alter,anddeletedatabase
objectssuchasschemas,tables,views,sequences,catalogs,indexes,and
aliases.

SeleniumInterview
QuestionsandAnswers

ABOUTME

G C RE DDY
Follow

BLOGARCHIVE

2.4k

2016(136)

V I E W M Y COM P LE T E
P ROF I LE

ANALYTICS
..

2015(220)

Q.WhatisDataControlLanguage?

DataControlLanguage(DCL)allowsustocontrolaccesstothedatabase.
'DCL'commandsinclude
'GRANT'toallowspecificuserstoperformspecifiedtasks
'REVOKE'tocancelpreviouslydeniedorgrantedpermissions

2014(292)
2013(730)
December(89)
November(105)
October(60)

Q.WhatisMSAccess?

MSAccesswaslaunchedin1992byMicrosoftCorporationaspartofMS

September(30)
June(15)

Office.
MicrosoftAccessisentryleveldatabasemanagementsoftware.Itisnotonly
aninexpensivebutalsopowerfuldatabaseforsmallscaleprojects.
MSAccessusestheJetdatabaseenginewhichutilizesaspecificSQLlanguage
dialect(sometimesreferredtoasJetSQL).

May(164)
April(78)
March(68)

MSAccesscomeswiththeprofessionaleditionofMSOfficepackage.MS
Accessisuserfriendlydatabasemanagementsystem.

Q.WhatisOracle?
Oracleisarelationaldatabasemanagementsystemdevelopedby'Oracle
Corporationandlaunchedin1977.
OraclesupportsallmajorOperatingsystemsincludes,MSWindows.NetWare,
UnixWare,OS/2andmostUNIXflavors.

Q.WhatisMSSQLServer?

MSSQLServerisaRelationalDatabaseManagementSystemdevelopedby

February(43)
January(78)
QTP11.5
MySQLInterview
Questions2
MySQLInterview
Questions1
JavaInterview
Questions22

MicrosoftInc.ItsprimaryquerylanguagesareTSQLandANSISQL.

JavaInterview
Questions21

Q.WhatisSybase?

TestDocumentation
Templates

Sybaseisacomputersoftwarecompany,theirprimaryproductisSybase

JavaInterview
Questions20

DBMS,whichisarelationaldatabasemanagementsystembasedupon
structuredquerylanguage.

Q.WhatisMySQL?

http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

JavaInterview
Questions19
2/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

Q.WhatisMySQL?

MySQLisopensourceDatabaseManagementSystem,developedbySwedish
companyMySQLAB.

JavaInterview
Questions18
OracleInterview
Questions45

MySQLSupportsmanydifferentplatformsincludingMicrosoftWindows,the
majorLinuxdistributions,UNIX,andMacOSX.
MySQLhasfreeandpaidversions,dependingonitsusage(non
commercial/commercial)andfeatures.MySQLcomeswithaveryfast,multi

OracleInterview
Questions44

threaded,multiuser,androbustSQLdatabaseserver.

OracleInterview
Questions43

Q.WhatisDB2?

JavaInterview
Questions17

DB2istheshortnameusedforDATABASE2.Itisrelationaldatabaseproduct

JavaInterview
Questions16

developedbyIBM.in1983

Q.WhatisDB/400?
ItisoneoftheflavorsofIBMDB2

Q.WhatarethecategoriesofoperatorsavailableinSQL?

Arithmeticoperators
Comparisonoperators
Logicaloperators

Q.WhatareArithmeticoperatorsinSQL?

Operator

Description

+(Addition)

Addsvalues

(Subtraction)

SubtractsRightsidevaluefromLeftsidevalue

*(Multiplication)

Multipliesvaluesoneithersideoftheoperator

/(Division)

Divideslefthandoperandbyrighthandoperand

%(Modulus)

Divideslefthandoperandbyrighthandoperand

OracleInterview
Questions42
OracleFAQ41
OracleQuestions40
JavaInterview
Questions15
OracleInterview
Questions39
JavaInterview
Questions14
JavaInterview
Questions13
CoreJavaInterview
Questions12
CoreJavaInterview
Questions11

andreturnsremainder
VBScriptVariables
Video

Q.WhatareComparisonoperatorsinSQL?
Forexamplex=1,y=2
OperatorExample
=(x=y)isFalse
!=(x!=y)isTrue.
<>(x<>y)istrue.
>(x>y)isFalse
<(x<y)isTrue
>=(x>=y)isFalse
<=(x<=y)isTrue

CoreJavaInterview
Questions10
SoftwareTesterJob
Responsibilities
OracleInterview
Questions38
OracleInterview
Questions37
OracleInterview
Questions36

!>(x!>y)isTrue.

SQLInterview
Questionsand
Answers

Note:ComparisonOperatorsreturnLogicalResults

KurugondaVillage

!<(x!<y)isFalse

Q.WhatareLogicaloperatorsinSQL?
OperatorDescription

NOTReturnsTRUEifthefollowingconditionisFALSE.ReturnsFALSE
ifitisTRUE.
ANDReturnsTRUEifbothcomponentconditionsareTRUE.Returns
FALSEifeitherisFALSE
ORReturnsTRUEifeithercomponentconditionisTRUE.Returns
FALSEifbothareFALSE.

Q.WhatisaDataRelationshipandWhatarethey?
DatabaseRelationshipistheconnectionbetweenthetablesinadatabase.
Thereare4typesofrelationships,andtheyare:
OnetoOneRelationship

OracleQuestions35
CoreJavaInterview
Questions9
OracleInterview
Questions
qtp11crack
CoreJavaInterview
Questions8
OracleInterview
Questions33
MobileTesting
Interview
Questions
CoreJavaInterview
Questions7

OnetoManyRelationship
http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

3/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

ManytoOneRelationship
ManytoManyRelationship

Q.WhatareImportantDataTypesinSQL?
DataType

Syntax

character

char(x)

integer

integer

numeric

numeric(p,s)

decimal

decimal(p,s)

float

float(p)

date

date

time

time

charactervarying

varchar2(x)

bit

bit(x)

real

real

smallint

smallint

CoreJavaInterview
Questions6
LiveProjectTesting
Blackboxtest
DesignTechniques
OracleInterview
Questions32
OracleInterview
Questions31
BugzillaInterview
Questions
JavaInterview
Questions
CoreJavaInterview
Questions5

Q.HowtoCreateaDatabase?

CoreJavaInterview
Questions4

TheSQLCREATEDATABASEstatementisusedtocreatenewSQLdatabase.

.NETTraining
Institutesin
Hyderabad

Syntax:
CREATEDATABASEDatabaseName
Example:
SQL>CREATEDATABASETestData

Q.HowtodeleteaDatabase?
UsingDROPDATABASEstatementwecandeleteanyexistingDatabase
Syntax:

SeleniumTraining
Institutesin
Hyderabad
LoadRunnerTraining
Institutesin
Hyderabad
JavaTraining
Institutesin
Hyderabad
OracleInterview
Questions30
OracleInterview
Questions29

DROPDATABASEDatabaseName
Example:

OracleInterview
Questions28

SQL>DROPDATABASETestData

OracleInterview
Questions27

Q.HowtoSelectaDatabase?

OracleInterview
Questions26

USEstatementisusedtoselectanyexistingdatabaseinSQL

OracleInterview
Questions25

Syntax:

OracleInterview
Questions24

USEDatabaseName

OracleInterview
Questions23

Example:
SQL>USETestData

CoreJavaInterview
Questions3

Q.HowtoviewallexistingDatabaseslist?

OracleInterview
Questions22

SQL>SHOWDATABASES

OracleInterview
Questions21

Q.HowtocreateaTable?

OracleInterview
Questions20

CREATETABLEtable_name(

OracleInterview
Questions19

column1datatype,
column2datatype,
column3datatype,

CoreJavaInterview
Questions2

.....
columnNdatatype,
PRIMARYKEY(oneormorecolumns)
)

CoreJavaInterview
Questions
QAInterview
Questions

Q.HowtodeleteaTable?
http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

4/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

UsingDropTablewecandeleteaTable

OracleInterview
Questions18

Syntax:

OracleInterview
Questions17

DROPTABLEtable_name

OracleInterview
Questions16

Q.HowtoaddnewrecordintoaTable?

OracleInterview
Questions15

UsingINSERTINTOstatement,wecaninsertnewrows

OracleInterview
Questions14

Syntax:
OracleInterview
Questions13

INSERTINTOTABLE_NAME(column1,column2,column3,...columnN)
VALUES(value1,value2,value3,...valueN)

InterviewQuestions
onDescriptive
programming

Q.HowtofetchdatafromaDatabaseTable?

UsingSELECTStatement,wecanfetchdatafromaDatabaseTable

QTPInterview
Questions

Syntax:

vbscriptdatatypes
interviewquestions
InterviewQuestions
onVBScript
Introduction

SELECTcolumn1,column2,columnNFROMtable_name
Or
SELECT*FROMtable_name

2012(139)

Q.ExplainaboutINOperator?

2011(53)

TheINoperatorimplementscomparisontoalistofvalues,thatis,ittests
whetheravaluematchesanyvalueinalistofvalues.INcomparisonshave
thefollowinggeneralformat:

2010(138)

....

value1[NOT]IN(value2[,value3]...)
Thiscomparisontestsifvalue1matchesvalue2ormatchesvalue3,andso
on.Itisequivalenttothefollowinglogicalpredicate:
value1=value2[ORvalue1=value3]...
Q.ExplainaboutFROMClauseinSQL?
TheFROMclausealwaysfollowstheSELECTclause.Itliststhetables
accessedbythequery.Forexample,
SELECT*FROMs
WhentheFromListcontainsmultipletables,commasseparatethetable
names.Forexample,
SELECTsp.*,city
FROMsp,s
WHEREsp.sno=s.sno
WhentheFromListhasmultipletables,theymustbejoinedtogether.
Q.WhatistheparametersubstitutionsymbolusedwithINSERTINTO
command?
TheparametersubstitutionsymbolusedwithINSERTINTOcommandis&.

Q.Whatarethevarioususesofdatabasetriggers?
Databasetriggerscanbeusedtoenforcebusinessrules,tomaintainderived
valuesandperformvaluebasedauditing.
Q.Whatisaeventhandlerinsql?
Aneventhandlerisaroutinethatiswrittentorespondtoaparticularevent.
Q.WhataretwomethodsofretrievingSQL?
ThetwomethodsofretrievingSQLare
1select
2usingcursor.

http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

5/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

Q.Whatisasynonym?Howisitused?
Asynonymisusedtoreferenceatableorviewbyanothername.Theother
namecanthenbewrittenintheapplicationcodepointingtotesttablesinthe
developmentstageandtoproductionentitieswhenthecodeismigrated.The
synonymislinkedtotheAUTHIDthatcreatedit.
Q.Whatisreferentialintegrity?

Referentialintegrityreferstotheconsistencythatmustbemaintained
betweenprimaryandforeignkeys,i.e.everyforeignkeyvaluemusthavea
correspondingprimarykeyvalue.
Q.ExplaintheEXPLAINstatement?

Theexplainstatementprovidesinformationabouttheoptimizer'schoiceof
accesspathoftheSQL.
Q.HowistheSUBSTRkeywordusedinSQL?

SUBSTRisusedforstringmanipulationwithcolumnname,firstpositionand
stringlengthusedasarguments.E.g.SUBSTR(NAME,13)referstothefirst
threecharactersinthecolumnNAME.
Q.Whatisthedifferencebetweengroupbyandorderby?

Groupbycontrolsthepresentationoftherows,orderbycontrolsthe
presentationofthecolumnsfortheresultsoftheSELECTstatement.
Q.Whatisasubselect?Isitdifferentfromanestedselect?

Asubselectisaselectwhichworksinconjunctionwithanotherselect.A
nestedselectisakindofsubselectwheretheinnerselectpassestothewhere
criteriafortheouterselect.
Q.WhatistheuseofCASCADECONSTRAINTS?

WhenthisclauseisusedwiththeDROPcommand,aparenttablecanbe
droppedevenwhenachildtableexists.
Q.Howdoyoupreventoutputfromcomingtothescreen?

TheSEToptionTERMOUTcontrolsoutputtothescreen.SettingTERMOUTOFF
turnsoffscreenoutput.ThisoptioncanbeshortenedtoTERM.

Q.CanPrimarykeyisaForeignKeyonthesametable?
Yes,PrimarykeyisaForeignKeyonthesametable.
Q.Howdoyouexecuteahostoperatingsystemcommandfromwithin
SQL?

Byuseoftheexclamationpoint!(inUNIXandsomeotherOS)ortheHOST
(HO)command.
Q.WhatisaCartesianproduct?

ACartesianproductistheresultofanunrestrictedjoinoftwoormoretables.
TheresultsetofathreetableCartesianproductwillhavex*y*znumberof
rowswherex,y,zcorrespondtothenumberofrowsineachtableinvolvedin
thejoin.
Q.HowcanvariablesbepassedtoaSQLroutine?

Byuseofthe&symbol.Forpassinginvariablesthenumbers18canbeused
(&1,&2,...,&8)topassthevaluesafterthecommandintotheSQLPLUS
session.Tobepromptedforaspecificvariable,placetheampersanded
variableinthecodeitself:select*fromdba_tableswhere
owner=&owner_name.UseofdoubleampersandstellsSQLPLUSto
resubstitutethevalueforeachsubsequentuseofthevariable,asingle
ampersandwillcausearepromptforthevalueunlessanACCEPTstatementis
usedtogetthevaluefromtheuser.
http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

6/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

Q.Whatcommandisusedtogetbacktheprivilegesofferedbythe
GRANTcommand?

RevokecommandisusedtogetbacktheprivilegesofferedbytheGRANT
command.
Q.Whataretheadvantagesofprocedures?
Advantagesofprocedures:
Loadedonceandusedmanytimes.
PerformancebettercozallSQLstatementsaresentinonegofromthe
applicationtothedatabase.
Security(noobjectprivilegesaregivendirectly).
Invoker'srightspossible.
Dataintegrity,productivity.
Q.WhatisParsing?

Parsingcheckssyntax,checksprivileges,andallocatingPrivateSQLArea.
Q.Whatisacursor?
NameorhandletoaprivateSQLareawhereOracleparsesandfetchesquery
results.

Q)IsSQLsupportsConditionalandLoopStatements?
NoBasicallySQLisaCommandbasedLanguage,notaprocedurallanguage,
butithasOperatorsandbuiltinFunctions.

RelatedPosts:

SQLInterviewQuestions2
SQLForTesters
SQLQueriesExamples
SQLGuide
Postedin:DivisionsofSQL,SQLBasics,SQLFAQ,sqlfortesters,SQLInterviewQuestions,SQLStepby
StepGuide,sqltutorial

+10 Recommend this on Google

NewerPost

Home

OlderPost

14comments:
Anonymous says:
November14,2013at1:22PM

SQLCommandsarecommonforallDatabaseManagementSystemsornot?
Reply

Anonymous says:
November14,2013at1:24PM

WhoisthevendorofSQL?
Reply

Anonymous says:
November21,2013at12:20AM

Yes,It'scommonforall
Reply

Anonymous says:
http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

7/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting
December17,2013at7:22PM

SQLispaidsoftwareorFreeware?
Reply

Anonymous says:
December17,2013at7:24PM

canwecreateourownfunctionsinSQL?
Reply

G.C.Reddy says:
January22,2014at2:04PM

SQLisFreeware.
Reply

Anonymous says:
January23,2014at5:28PM

WhatisthedifferencebetweenSQLandPLSQL?
Reply

Anonymous says:
January31,2014at8:39PM

isitmandatoryformanualtestertoknowaboutprocedures
Reply

Anonymous says:
June21,2014at1:22PM

HelloReddysir,
IamnotabletoaccessSQLqueriesexampleslink.Wouldyoupleaseprovidethe
correctlink.
Reply

Anonymous says:
July19,2014at12:34PM

hisir,
iamnotabletocopythistopicsfordownloading,howcanidownload,wouldyou
pleasehelpme.
Reply

showjam75 says:
September28,2015at6:30PM

nicequestions
Reply

Unknown says:
January23,2016at5:35PM

not...Alldatabasehavedifferdiffercmd..
Reply

Ganesh says:
August31,2016at7:31PM

HiSir,
Pleaseletmeknowwhichisbestpractice.EitherSQLSERVERORMYSQL
Reply

GCReddy says:
October19,2016at11:24AM

SQLCommandsareCommonforallDatabaseManagementSystems.
Reply

PostaComment
http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

8/9

10/20/2016

SQLInterviewQuestionsandAnswers~SoftwareTesting

Enteryourcomment...

Commentas:

Publish

RajuSai(Google)

Preview

Signout

Notifyme

Linkstothispost
CreateaLink

Copyright2011SoftwareTesting|PoweredbyBlogger

http://www.gcreddy.com/2013/01/sqlinterviewquestions.html

9/9

You might also like