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

INDEX

DataWarehousingInterviewQuestionsandAnswers

DataWarehousing InterviewQandAnswers.2

Notice:
Allrightsreservedworldwide.Nopartofthisbookmaybereproducedor
copiedortranslatedinanyformbyanyelectronicormechanicalmeans
(includingphotocopying,recording,orinformationstorageandretrieval)
withoutpermissioninwritingfromthepublisher,exceptforreadingand
browsingviatheWorldWideWeb.Usersarenotpermittedtomountthis
fileonanynetworkservers.

Formoreinformationsendemailto:pinal@sqlauthority.com

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

DataWarehousing InterviewQuestions&Answers
WhatisDataWarehousing?
A data warehouse is the main repository of an organization's historical data, its
corporatememory.Itcontainstherawmaterialformanagement'sdecisionsupport
system. The critical factor leading to the use of a data warehouse is that a data
analyst can perform complex queries and analysis, such as data mining, on the
information without slowing down the operational systems (Ref:Wikipedia). Data
warehousing collection of data designed to support management decision making.
Datawarehousescontainawidevarietyofdatathatpresentacoherentpictureof
business conditions at a single point in time. It is a repository of integrated
information,availableforqueriesandanalysis.
WhatisBusinessIntelligence(BI)?
BusinessIntelligence(BI)referstotechnologies,applicationsandpracticesforthe
collection,integration,analysis,andpresentationofbusinessinformationand
sometimestotheinformationitself.Thepurposeofbusinessintelligenceisto
supportbetterbusinessdecisionmaking.Thus,BIisalsodescribedasadecision
supportsystem(DSS).
BIsystemsprovidehistorical,current,andpredictiveviewsofbusinessoperations,
mostoftenusingdatathathasbeengatheredintoadatawarehouseoradata
martandoccasionallyworkingfromoperationaldata.
WhatisDimensiontable?
Dimensionaltablecontainstextualattributesofmeasurementsstoredinthefacts
tables.Dimensionaltableisacollectionofhierarchies,categoriesandlogicwhich
canbeusedforusertotraverseinhierarchynodes.

WhatisDimensionalModeling?
Dimensionaldatamodelconceptinvolvestwotypesoftablesanditisdifferentfrom
the 3rd normal form. This concept uses Facts table which contains the
measurements of the business and Dimension table which contains the context
(dimensionofcalculation)ofthemeasurements.

WhatisFacttable?
Fact table contains measurements of business process. Fact table contains the
foreignkeysforthedimensiontables.Example,ifyouarebusinessprocessis"paper
production","averageproductionofpaperbyonemachine"or"weeklyproduction
ofpaper"willbeconsideredasmeasurementofbusinessprocess.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

WhatarefundamentalstagesofDataWarehousing?
TherearefourdifferentfundamentalstagesofDataWarehousing.

OfflineOperationalDatabases:
Datawarehousesinthisinitialstagearedevelopedbysimplycopyingthedatabase
ofanoperationalsystemtoanofflineserverwheretheprocessingloadofreporting
doesnotimpactontheoperationalsystem'sperformance.

OfflineDataWarehouse:
Datawarehousesinthisstageofevolutionareupdatedonaregulartimecycle
(usuallydaily,weeklyormonthly)fromtheoperationalsystemsandthedatais
storedinanintegratedreportingorienteddatastructure

RealTimeDataWarehouse:
Datawarehousesatthisstageareupdatedonatransactionoreventbasis,every
timeanoperationalsystemperformsatransaction(e.g.anorderoradeliveryora
bookingetc.)

IntegratedDataWarehouse:
Datawarehousesatthisstageareusedtogenerateactivityortransactionsthatare
passedbackintotheoperationalsystemsforuseinthedailyactivityofthe
organization.
(Reference:Wikipedia)

WhataretheDifferentmethodsofloadingDimensiontables?
Therearetwodifferentwaystoloaddataindimensiontables.

Conventional(Slow):
Alltheconstraintsandkeysarevalidatedagainstthedatabefore,itisloaded,this
waydataintegrityismaintained.

Direct(Fast):
Alltheconstraintsandkeysaredisabledbeforethedataisloaded.Oncedatais
loaded,itisvalidatedagainstalltheconstraintsandkeys.Ifdataisfoundinvalidor
dirtyitisnotincludedinindexandallfutureprocessesareskippedonthisdata.

Describestheforeignkeycolumnsinfacttableanddimensiontable?
Foreignkeysofdimensiontablesareprimarykeysofentitytables.
ForeignkeysoffactstablesareprimarykeysofDimensiontables.

WhatisDataMining?
DataMiningistheprocessofanalyzingdatafromdifferentperspectivesand
summarizingitintousefulinformation.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

Whatisthedifferencebetweenviewandmaterializedview?
Aviewtakestheoutputofaqueryandmakesitappearlikeavirtualtableanditcan
beusedinplaceoftables.
Amaterializedviewprovidesindirectaccesstotabledatabystoringtheresultsofa
queryinaseparateschemaobject.

WhatisOLTP?
OLTPisabbreviationofOnLineTransactionProcessing.Thissystemisanapplication
that modifies data the instance it receives and has a large number of concurrent
users.

WhatisOLAP?
OLAPisabbreviationofOnlineAnalyticalProcessing.Thissystemisanapplication
thatcollects,manages,processesandpresentsmultidimensionaldataforanalysis
andmanagementpurposes.

WhatisthedifferencebetweenOLTPandOLAP?

DataSource
OLTP:
Operationaldataisfromoriginaldatasourceofthedata
OLAP:
Consolidationdataisfromvarioussources.

ProcessGoal
OLTP:
Snapshotofbusinessprocesseswhichdoesfundamentalbusinesstasks
OLAP:
Multidimensionalviewsofbusinessactivitiesofplanninganddecision
making

QueriesandProcessScripts
OLTP:
Simplequickrunningqueriesranbyusers.
OLAP:
Complexlongrunningqueriesbysystemtoupdatetheaggregateddata.

DatabaseDesign
OLTP:
Normalized small database. Speed will be not an issue due to smaller
database and normalization will not degrade performance. This adopts
entity relationship(ER) model and an applicationoriented database
design.
OLAP:
Denormalizedlargedatabase.Speedisissueduetolargerdatabaseand
denormalizingwillimproveperformanceastherewillbelessertablesto
scan while performing tasks. This adopts star, snowflake or fact
constellationmodeofsubjectorienteddatabasedesign.

BackupandSystemAdministration
OLTP:RegularDatabasebackupandsystemadministrationcandothejob.
OLAP:ReloadingtheOLTPdataisgoodconsideredasgoodbackupoption.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

Whatarenormalizationforms?
Therearedifferenttypesofnormalizationformslike,

1NF:EliminateRepeatingGroups
Makeaseparatetableforeachsetofrelatedattributes,andgiveeachtablea
primarykey.Eachfieldcontainsatmostonevaluefromitsattributedomain.
2NF:EliminateRedundantData
Ifanattributedependsononlypartofamultivaluedkey,removeittoaseparate
table.
3NF:EliminateColumnsNotDependentOnKey
Ifattributesdonotcontributetoadescriptionofthekey,removethemtoa
separatetable.Allattributesmustbedirectlydependentontheprimarykey
BCNF:BoyceCoddNormalForm
Iftherearenontrivialdependenciesbetweencandidatekeyattributes,separate
themoutintodistincttables.
4NF:IsolateIndependentMultipleRelationships
Notablemaycontaintwoormore1:norn:mrelationshipsthatarenotdirectly
related.
5NF:IsolateSemanticallyRelatedMultipleRelationships
Theremaybepracticalconstrainsoninformationthatjustifyseparatinglogically
relatedmanytomanyrelationships.
ONF:OptimalNormalForm
Amodellimitedtoonlysimple(elemental)facts,asexpressedinObjectRoleModel
notation.
DKNF:DomainKeyNormalForm
Amodelfreefromallmodificationanomalies.
Remember,thesenormalizationguidelinesarecumulative.Foradatabasetobein
3NF,itmustfirstfulfillallthecriteriaofa2NFand1NFdatabase.
WhatisODS?
ODSisabbreviationofOperationalDataStore.Adatabasestructurethatisa
repositoryfornearrealtimeoperationaldataratherthanlongtermtrenddata.The
ODSmayfurtherbecometheenterprisesharedoperationaldatabase,allowing
operationalsystemsthatarebeingreengineeredtousetheODSasthereoperation
databases.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

WhatisERDiagram?
EntityRelationshipDiagramsareamajordatamodelingtoolandwillhelporganize
the data in your project into entities and define the relationships between the
entities.Thisprocesshasprovedtoenabletheanalysttoproduceagooddatabase
structuresothatthedatacanbestoredandretrievedinamostefficientmanner.

An entityrelationship (ER) diagram is a specialized graphic that illustrates the


interrelationships between entities in a database. A type of diagram used in data
modelingforrelationaldatabases.Thesediagramsshowthestructureofeachtable
andthelinksbetweentables.

WhatisETL?
ETL is abbreviation of extract, transform, and load. ETL is software that enables
businessestoconsolidatetheirdisparatedatawhilemovingitfromplacetoplace,
anditdoesn'treallymatterthatthatdataisindifferentformsorformats.Thedata
cancomefromanysource.ETLispowerfulenoughtohandlesuchdatadisparities.
First,theextractfunctionreadsdatafromaspecifiedsourcedatabaseandextractsa
desiredsubsetofdata.Next,thetransformfunctionworkswiththeacquireddata
usingrulesorlookuptables,orcreatingcombinationswithotherdatatoconvertit
tothedesiredstate.Finally,theloadfunctionisusedtowritetheresultingdatatoa
targetdatabase.

WhatisVLDB?
VLDB is abbreviation of Very Large Database. A one terabyte database would
normallybeconsideredtobeaVLDB.Typically,thesearedecisionsupportsystems
ortransactionprocessingapplicationsservinglargenumbersofusers.

IsOLTPdatabaseisdesignoptimalforDataWarehouse?
No.OLTPdatabasetablesarenormalizedanditwilladdadditionaltimetoqueriesto
returnresults.AdditionallyOLTPdatabaseissmalleranditdoesnotcontainlonger
period(manyyears)data,whichneedstobeanalyzed.AOLTPsystemisbasicallyER
model and not Dimensional Model. If a complex query is executed on a OLTP
system, it may cause a heavy overhead on the OLTP server that will affect the
normalbusinessprocesses.

Ifdenormalizedisimprovesdatawarehouseprocesses,whyfacttableisinnormal
form?
ForeignkeysoffactstablesareprimarykeysofDimensiontables.Itisclearthatfact
tablecontainscolumnswhichareprimarykeytoothertablethatitselfmakenormal
formtable.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

Whatarelookuptables?
Alookuptableisthetableplacedonthetargettablebasedupontheprimarykeyof
the target, it just updates the table by allowing only modified (new or updated)
recordsbasedonthelookupcondition.

WhatareAggregatetables?
Aggregatetablecontainsthesummaryofexistingwarehousedatawhichisgrouped
to certain levels of dimensions. It is always easy to retrieve data from aggregated
tablesthanvisitingoriginaltablewhichhasmillionrecords.Aggregatetablesreduce
theloadinthedatabaseserverandincreasetheperformanceofthequeryandcan
retrievetheresultquickly.

Whatisrealtimedatawarehousing?
Data warehousing captures business activity data. Realtime data warehousing
captures business activity data as it occurs. As soon as the business activity is
completeandthereisdataaboutit,thecompletedactivitydataflowsintothedata
warehouseandbecomesavailableinstantly.

Whatareconformeddimensions?
Conformeddimensionsmeantheexactsamethingwitheverypossiblefacttableto
whichtheyarejoined.Theyarecommontothecubes.

Whatisconformedfact?
ConformeddimensionsarethedimensionswhichcanbeusedacrossmultipleData
Martsincombinationwithmultiplefactstablesaccordingly.

Howdoyouloadthetimedimension?
Time dimensions are usually loaded by a program that loops through all possible
dates that may appear in the data. 100 years may be represented in a time
dimension,withonerowperday.

WhatisalevelofGranularityofafacttable?
Levelofgranularitymeanslevelofdetailthatyouputinto thefacttableinadata
warehouse. Level of granularity would mean what detail are you willing to put for
eachtransactionalfact.

Whatarenonadditivefacts?
Nonadditive facts are facts that cannot be summed up for any of the dimensions
presentinthefacttable.Howevertheyarenotconsideredas useless. Ifthereare
changesindimensionsthesamefactscanbeuseful.

Whatisfactlessfactstable?
Afacttablewhichdoesnotcontainnumericfactcolumnsitiscalledfactlessfacts
table.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

Whatareslowlychangingdimensions(SCD)?
SCDisabbreviationofslowlychangingdimensions.SCDappliestocaseswherethe
attributeforarecordvariesovertime. TherearethreedifferenttypesofSCD.
1) SCD1:Thenewrecordreplacestheoriginalrecord.Onlyonerecordexistin
databasecurrentdata.
2) SCD2:Anewrecordisaddedintothecustomerdimensiontable.Tworecords
existindatabasecurrentdataandprevioushistorydata.
3) SCD3:Theoriginaldataismodifiedtoincludenewdata.Onerecordexistin
databasenewinformationareattachedwitholdinformationinsamerow.
Whatishybridslowlychangingdimension?
HybridSCDsarecombinationofbothSCD1andSCD2.Itmayhappenthatinatable,
somecolumnsareimportantandweneedtotrackchangesforthemi.e.capturethe
historicaldataforthemwhereasinsomecolumnsevenifthedatachanges,wedon't
care.

WhatisBUSSchema?
BUS Schema is composed of a master suite of confirmed dimension and
standardizeddefinitioniffacts.

WhatisaStarSchema?
Star schema is a type of organizing the tables such that we can retrieve theresult
fromthedatabasequicklyinthewarehouseenvironment.

WhatSnowFlakeSchema?
SnowflakeSchema,eachdimensionhasaprimarydimensiontable,towhichoneor
moreadditionaldimensionscanjoin.Theprimarydimensiontableistheonlytable
thatcanjointothefacttable.

Differencesbetweenstarandsnowflakeschema?
Starschema:
A single fact table with N number of Dimension, all dimensions
will be linked directly with a fact table. This schema is de
normalized and results in simple join and less complex query as
wellasfasterresults.

Snowschema: Any dimensions with extended dimensions are know as


snowflake schema, dimensions maybe interlinked or may have
one to many relationship with other tables. This schema is
normalizedandresultsincomplexjoinandverycomplexqueryas
wellasslowerresults.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

WhatisDifferencebetweenERModelingandDimensionalModeling?
ER modeling is used for normalizing the OLTP database design. Dimensional
modelingisusedfordenormalizingtheROLAP/MOLAPdesign.

Whatisdegeneratedimensiontable?
If a table contains the values, which is neither dimension nor measures is called
degeneratedimensions.

WhyisDataModelingImportant?
Datamodelingisprobablythemostlaborintensiveandtimeconsumingpartofthe
developmentprocess.Thegoalofthedatamodelistomakesurethatthealldata
objects required by the database are completely and accurately represented.
Because the data model uses easily understood notations and natural language, it
canbereviewedandverifiedascorrectbytheendusers.

In computer science, data modeling is the process of creating a data model by


applyingadatamodeltheorytocreateadatamodelinstance.Adatamodeltheory
is a formal data model description. When data modeling, we are structuring and
organizingdata.Thesedatastructuresarethentypicallyimplementedinadatabase
managementsystem.Inadditiontodefiningandorganizingthedata,datamodeling
will impose (implicitly or explicitly) constraints or limitations on the data placed
withinthestructure.

Managinglargequantitiesofstructuredandunstructureddataisaprimaryfunction
of information systems. Data models describe structured data for storage in data
management systems such as relational databases. They typically do not describe
unstructured data, such as word processing documents, email messages, pictures,
digitalaudio,andvideo.(Reference:Wikipedia)

Whatissurrogatekey?
Surrogate key is a substitution for the natural primary key. It is just a unique
identifierornumberforeachrowthatcanbeusedfortheprimarykeytothetable.
Theonlyrequirementforasurrogateprimarykeyisthatitisuniqueforeachrowin
the table.It is useful because the natural primary key can change and this makes
updatesmoredifficult.Surrogatedkeysarealwaysintegerornumeric.

Whatisjunkdimension?
A number of very small dimensions might be lumped together to form a single
dimension, a junk dimension the attributes are not closely related. Grouping of
Randomflagsandtextattributesinadimensionandmovingthemtoaseparatesub
dimensionisknownasjunkdimension.

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

WhatisDataMart?
A data mart (DM) is a specialized version of a data warehouse (DW). Like data
warehouses,datamartscontainasnapshotofoperationaldatathathelpsbusiness
people to strategize based on analyses of past trends and experiences. The key
differenceisthatthecreationofadatamartispredicatedonaspecific,predefined
need for a certain grouping and configuration of select data. A data mart
configuration emphasizes easy access to relevant information (Reference : Wiki).
Data Marts are designed to help manager make strategic decisions about their
business.

WhatisthedifferencebetweenOLAPanddatawarehouse?
DatawarehouseistheplacewherethedataisstoredforanalyzingwhereasOLAPis
theprocessofanalyzingthedata, managingaggregations,partitioninginformation
intocubesforindepthvisualization.

WhatisaCubeandLinkedCubewithreferencetodatawarehouse?
Cubes are logical representation of multidimensional data. The edge of the cube
contains dimension members and the body of the cube contains data values. The
linkingincubeensuresthatthedatainthecubesremainconsistent.

Whatissnapshotwithreferencetodatawarehouse?
Youcandisconnectthereportfromthecatalogtowhichitisattachedbysavingthe
reportwithasnapshotofthedata.

Whatisactivedatawarehousing?
Anactivedatawarehouseprovidesinformationthatenablesdecisionmakerswithin
an organization to manage customer relationships nimbly, efficiently and
proactively.

Whatisthedifferencebetweendatawarehousingandbusinessintelligence?
Data warehousing deals with all aspects of managing the development,
implementation and operation of a data warehouse or data mart including meta
data management, data acquisition, data cleansing, data transformation, storage
management, data distribution, data archiving, operational reporting, analytical
reporting, security management, backup/recovery planning, etc. Business
intelligence,ontheotherhand,isasetofsoftwaretoolsthatenableanorganization
to analyze measurable aspects of their business such as sales performance,
profitability, operational efficiency, effectiveness of marketing campaigns, market
penetrationamongcertaincustomergroups,costtrends,anomaliesandexceptions,
etc. Typically, the term business intelligence is used to encompass OLAP, data
visualization,dataminingandquery/reportingtools.(Reference:LesBarbusinski)

10

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

ExplainparadigmofBillInmonandRalphKimball.
Bill Inmon's paradigm: Data warehouse is one part of the overall business
intelligencesystem.Anenterprisehasonedatawarehouse,anddatamartssource
their information from the data warehouse. In the data warehouse, information is
storedin3rdnormalform.

Ralph Kimball's paradigm: Data warehouse is the conglomerate of all data marts
withintheenterprise.Informationisalwaysstoredinthedimensionalmodel.

11

Copyright 2000-2008 Pinal Dave. All Rights Reserved. SQLAuthority.com

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