DBMS Basics

JaipalDhobale 713 views 84 slides Jan 17, 2018
Slide 1
Slide 1 of 84
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84

About This Presentation

Database Management Systems Basics


Slide Content

SESSION NO -I
DBMS
By Dr. Dhobale J V
Assistant Professor
IBS, IFHE, Hyderabad.
IBS Hyderabad 1

Objectives
DatabaseSystemApplications.
PurposeofDatabasesystems.
ViewofData.
DatabaseLanguage.
RelationalDatabase.
DatabaseDesign.
DatabaseArchitecture.
DatabaseUsersandDBA.
2IBS Hyderabad

DBMS
3IBS Hyderabad

DBMS
DBMS(DatabaseManagementSystems)?
Isacollectionofinterrelateddataandasetof
programstoaccessthosedata.
Thecollectionofdata,usuallyreferredtoas
database,containsinformationrelevanttoan
enterprise.
4IBS Hyderabad

DBMS
Databasesystemsaredesignedtomanage
largebodiesofinformation.
Managementofdatainvolvesbothdefining
structuresforstorageofinformationand
providingmechanismforthemanipulationof
information.
Ensuressafetyofinformation.
5IBS Hyderabad

Data and Information
6IBS Hyderabad

Data and Information
7IBS Hyderabad

DBMS features
1.Itiswellorganized.
2.Itisrelated.
3.Itisaccessibleindifferentorderswithout
greatdifficulty.
4.Itisstoredonlyonce.
8IBS Hyderabad

DBMS Applications
Databasesarewidelyused–
1.EnterpriseInformation–
Sales–Customer,Product&Purchaseinformation.
Accounting–Payments,Receipts,account
balances,assetsandotheraccountinginformation.
HR–Employeesinformation,salaries,payrolltaxes
&benefits.
Manufacturing–ManagementofSCM,inventories
ofitemsinwarehouses&storesandordereditems.
Onlineretailers–Onlineordertrackinggeneration,
maintenanceofonlineproductevaluation.
9IBS Hyderabad

DBMS Applications
2.BankingandFinance–
Banking–Customerinformation,account,loans,
bankingtransactions.
Creditcardtransactions–Purchasesoncredit
cardsandgenerationofmonthlystatements.
Finance–informationaboutholdings,sales,and
purchaseoffinancialinstrumentssuchasstocks
andbonds.
10IBS Hyderabad

DBMS Applications
3.Universities–Studentinformation,course
registrationsandgradesalongwithenterprise
information.
4.Airlines–Reservationsandschedule
information.
FirstlyuseDBMS capabilitiesina
geographicallydistributedmanner.
11IBS Hyderabad

DBMS Applications
5.Telecommunication–recordsofcallsmade,
Billinginformation,recordofprepaidcalling
andbalances,communicationnetwork
information.
12IBS Hyderabad

Purpose of DBMS
13IBS Hyderabad

Purpose of DBMS
DatabaseApproach–
Manyprogramsanduserscansharedatain
database.
Securesdatasothatauthorizeduserscan
accesscertaindata.
14IBS Hyderabad

Purpose of DBMS
15IBS Hyderabad

Purpose of DBMS
16IBS Hyderabad

Purpose of DBMS
17IBS Hyderabad

Views of Data -Abstraction
Weknowthatthesamething,ifviewedfrom
differentanglesproducesdifferencesights.
Likewise,thedatabasethatwehavecreated
alreadycanhavedifferentaspectstorevealif
seenfromdifferentlevelsofabstraction.
Abstractionmeanstheamountofdetailyou
wanttohide.
18IBS Hyderabad

Views of Data –Abstraction Example
Acomputerrevealstheminimumofitsinternal
details,whenseenfromoutside.
Wedonotknowwhatpartsitisbuiltwith.This
isthehighestlevelofabstraction.
Ifweopenthecomputercaseandlookinside
attheharddisc,motherboard,CDdrive,CPU
andRAM,weareinmiddlelevelof
abstraction.
19IBS Hyderabad

Views of Data –Abstraction Example
Ifwemoveontoopentheharddiscand
examineitstracks,sectorsandread-write
heads,weareatthelowestlevelof
abstraction.
Inthesamemanner,thedatabasecanalsobe
viewedfromdifferentlevelsofabstractionto
revealdifferentlevelsofdetails.whereno
detailsareinvisible.
20IBS Hyderabad

Views of Data –Abstraction Levels
21IBS Hyderabad

Views of Data –Abstraction Levels
Thewordschemameansarrangement(design)–how
wewanttoarrangethingsthatwehavetostore.
Thediagramaboveshowsthethreedifferentschemas
usedinDBMS,seenfromdifferentlevelsof
abstraction.
Thecollectionofinformationstoredinthedatabaseat
aparticularmomentiscalledaninstance.
22IBS Hyderabad

Data Models
DataModelsarenothingbutRulesand
Standardsthatdefinehowdatabaseorganizes
data.
Differentdatamodelsare–
1.RelationalModel
2.Entity-RelationshipModel
3.Object-BasedDataModel
4.SemistructuredDataModel
23IBS Hyderabad

Data Models
1.RelationalModel–Collectionoftablesto
representbothdataandtherelationship
amongthosedata.
IsRecordbasedmodel.
24IBS Hyderabad

Data Models
2.Entity-RelationshipModel:Collectionofbasic
objectscalledentities.
Itisbasedonentitiesanditsrelationship.
25IBS Hyderabad

Data Models
3.Object-BasedDataModel:Objectoriented
programminghasbecomethedominant
softwaredevelopmentmethodology.
Itleadstodevelopanobjectorienteddata
modelswhichisextendingtheE-Rmodel
withnotionsofencapsulation,methods
(functions),andobjectentity.
26IBS Hyderabad

Data Models
4.SemistructuredDataModel:Thisdata
modelpermitsthespecificationofdatawhere
individualdataitemsofthesametypemay
havedifferentsetofattributes.
TheExtensibleMarkupLanguage(XML)is
widelyusedtorepresentsemistructured
data.
27IBS Hyderabad

Database Languages
ADBMSprovidesadata-definition
languagetospecifythedatabase
schema andadata-manipulation
languagetoexpressdatabasequeries
andupdates.
Data-definitionanddata-manipulation
languagesarepartsofsingledatabase
language.
Ex.-SQL-StructuredQueryLanguage
28IBS Hyderabad

Database Languages
Data-ManipulationLanguages-which
enablesuserstoaccessormanipulate
dataasorganizedbytheappropriate
datamodel.
Accesstypes(operations)–Retrieval,
Insertion,Deletion&Modification.
TherearetwotypesofDMLs.
1.ProceduralDMLs–What&How(data).
2.Declarative(Nonprocedural)DMLs–
What.
29IBS Hyderabad

Database Languages
Data-DefinitionLanguage: Data
DefinitionLanguage(DDL)statements
areusedtoclassifythedatabase
structureorschema.
Itisatypeoflanguagethatallowsthe
DBAorusertodepictandnamethose
entities,attributes,andrelationshipsthat
arerequiredfortheapplicationalong
withanyassociatedintegrityandsecurity
constraints.
30IBS Hyderabad

Database Languages
Data-DefinitionLanguage:Herearethe
listsoftasksthatcomeunderDDL-
CREATE–usedtocreateobjectsinthedatabase.
ALTER–usedtoaltersthestructureofthedatabase.
DROP–usedtodeleteobjectsfromthedatabase.
TRUNCATE–usedtoremoveallrecordsfromatable,
includingallspacesallocatedfortherecordsare
removed.
COMMENT –usedtoaddcommentstothedata
dictionary.
RENAME–usedtorenameanobject.
31IBS Hyderabad

Relational Database
Therelationalmodelisthetheoreticalbasisof
relationaldatabaseswhichisatechniqueor
wayofstructuringdatausingrelations,which
aregrid-likemathematicalstructures
consistingofcolumnsandrows.
CoddproposedtherelationalmodelforIBM.
32IBS Hyderabad

Relational Database
Intherelationalmodel,alldataislogically
structuredwithinrelationsi.e.tables.
Eachrelationhasanameandisformedfrom
namedattributesorcolumnsofdata.
Eachtupleorrowholdsonevalueper
attribute.
Thegreateststrengthoftherelationalmodelis
thissimplelogicalstructurethatitforms. 33IBS Hyderabad

Relational Database
ObjectivesofRelationalModel:
1.Toallowahighdegreeofdataindependence.
2.Toprovideconsiderablegroundsfordealingwith
datasemantics,reliability,andredundancy
problems.
3.Toallowtheexpansionofset-orienteddata
manipulationlanguages.
34IBS Hyderabad

Relational Database
Tables:
Eachtablehasmultiplecolumnsandeach
columnhasauniquename.
35IBS Hyderabad

Relational Database
Tables:RelationalModelTerms-
Relation:Arelationisatablewithcolumnsand
rows.
Attribute:Anattributeisanamedcolumnofa
relation.
Domain:Adomainisthesetofallowablevaluesfor
oneormoreattributes.
Tuple:Atupleisarowofarelation.
36IBS Hyderabad

Relational Database
Tables:Ex.
37IBS Hyderabad

Relational Database
Data-ManipulationLanguage–TheSQLquery
languageisnonprocedural.
Aquerytakesasinputseveraltables/tableand
alwaysreturnasingletable.
SQLstatementforfindingthenamesofall
instructorsintheHistorydepartment.
38IBS Hyderabad

Relational Database
Data-ManipulationLanguage:-
Thequeryspecifiesthatthoserowsfromthe
tableinstructorwheredept_nameisHistory
mustberetrievedandnameattributeofthese
rowsmustbedisplayed.
39IBS Hyderabad

Relational Database
DMLs:.
40IBS Hyderabad

Relational Database
Data-ManipulationLanguage:-Querymay
involveinformationfrommorethanonetable.
ThisqueryfindstheinstructorsIDandofall
theinstructorsassociatedwithadepartment
namedepartmentwithbudgetgreaterthan
$95000. 41IBS Hyderabad

Relational Database
DMLs:.
42IBS Hyderabad

Relational Database
Data-DefinitionLanguage:SQLprovidesarich
DDLthatallowsonetodefinetables,integrity
constraints,assertions,etc.
FollowingSQLDDLstatementdefinesthe
departmenttable:
createtabledepartment
(dept_namechar(20),
buildingchar(15),
budget numeric(12,2));
43IBS Hyderabad

Relational Database
Database Access fromApplication
Programs:
SQLisaquerylanguagewhichdealswith
creationandmanipulationofdatabaseand
datarespectively.
SQLdoesnotsupportactionslikeinputfrom
user,outputtodisplay&network
communication.
Suchactionsandcomputationsmustbe
writtenusinggeneralpurposelanguageslike
C,C++,Javaetc.
44IBS Hyderabad

Relational Database
Database Access fromApplication
Programs:
Applicationprogramsareprogramsthatare
usedtointeractwiththedatabaseforspecific
application,likefillingoftheforms,doing
calculations,generationofreports,etc.
45IBS Hyderabad

Database Design
DBMSaredesignedtomanagelargebodies
ofinformation.
Theselargebodiesofinformationdonotexist
inisolation.
HereDBMSplaysonlysupportingroleby
providingrequiredinformationorservice.
Databasedesignmainlyinvolvesthedesignof
thedatabaseschema.
46IBS Hyderabad

Database Design
DesignProcess:
1.DatabaseConceptualFramework–data
requirements,databasestructure.
2.DataNeedsoftheprospectivedatabaseusers–
outcomeofthethisphaseisspecificationofuser
requirements.
3.Thedesignerneedstochooseadatamodeland
translatesuserrequirementsintoconceptual
schemaofthedatabase.
4.Thedesignerreviewstheschematoconfirmdata
requirementsanditsconflicts;focusisondata&
itsrelationship.
47IBS Hyderabad

Database Design
DesignProcess:
5.Afullydevelopedconceptualschemaindicates
thefunctionalrequirementsoftheenterprise;at
thisstageofconceptualdesign,thedesignercan
reviewtheschematoensureitmeetsfunctional
requirements.
6.Designtoimplementationcanbetakenintotwo
differentways–Logicaldesignphase&Physical
designphase.
48IBS Hyderabad

Database Design
DesignProcess;Example-
DatabasedesignforaUniversity:Pointstobe
considered.
TheUniversityisorganizedintodepartments
(dept_name,bulding,budget).
Eachdepartmenthasalistofcoursesitoffers
(course_id,dept_name,credit,andprerequisites).
InstructorsareidentifiedbytheiruniqueID(name,
dept_name,salary).
StudentsareidentifiedbytheiruniqueID(name,
dept_name,total_cred).
49IBS Hyderabad

Database Design
DesignProcess;Example-
DatabasedesignforaUniversity:Pointstobe
considered.
TheUniversitymaintainsalistofclassrooms
(building,room_number&room_capacity).
Theuniversitymaintainsalistofclasses
(sections)taught(course_id,sec_id,year,
semester).
Thedepartmenthasalistofteachingassignments
specifying,foreachinstructor,thesectionthe
instructoristeaching.
TheUniversityhasalistofallstudentcourse
registration.
50IBS Hyderabad

Database Design
DesignProcess-
TheEntity-RelationshipModel–Thismodel
usesacollectionofbasicobjects,called
entities,andrelationshipsamongthese
objects.
Ex.Person,bankaccount;
Entitiesaredescribedinadatabasebyaset
ofattributes.
Ex.ID,name,andsalarymaydescribe
instructorfromuniversity.
51IBS Hyderabad

Database Design
DesignProcess-
TheEntity-RelationshipModel–
TheexternalattributeIDisusedtoidentifyan
instructoruniquely.
Arelationshipisanassociationamongseveral
entities.
Ex.Amemberrelationshipassociatesan
instructorwithherdepartment.
Entityset–sametypesofentities.
Relationshipset–sametypeofrelations.
52IBS Hyderabad

Database Design
DesignProcess-
TheEntity-RelationshipModel–
Theoveralllogicalstructure(schema)ofa
databasecanbeexpressedgraphicallybyan
entity-relationship(E-R)diagram.
Severalwaystodrawthesediagramsbutmost
popularisUnifiedModelingLanguage(UML).
53IBS Hyderabad

Database Design
DesignProcess-
TheEntity-RelationshipModel–
54IBS Hyderabad

Database Design
DesignProcess-
TheEntity-RelationshipModel–
Entitysetsarerepresentedbyarectangular
boxwiththeentitysetnameintheheaderand
theattributeslistedbelowit.
Relationshipsetsarerepresentedbya
diamondconnectingapairofrelatedentity
sets.Thenameoftherelationshipisplaced
insidethediamond.
55IBS Hyderabad

Database Design
DesignProcess-
TheEntity-RelationshipModel–
Inadditiontoentitiesandrelationships,theE-
Rmodelrepresentscertainconstraintsto
whichthecontentsofdatabasemustconform.
MappingCardinalities,whichexpressesthe
numberofentitiestowhichanotherentitycan
beassociatedviaarelationshipset.
56IBS Hyderabad

Database Design
DesignProcess-
Normalization:Anothercommonlyused
methodofdesigningRelationaldatabaseis.
Itcreatesschematostoreinformationwithout
unnecessaryredundancyandalsoallowsusto
retrieveinformationeasily.
Theapproachistodesignschemasthatarein
anappropriatenormalforms.
57IBS Hyderabad

Database Design
DesignProcess-
Normalization:Todeterminewhethera
relationschemaisinoneofthedesirable
normalforms,weneedadditionalinformation
abouttherealworld.
Mostcommonlyusedapproachistouse
functionaldependencies.
58IBS Hyderabad

Database Design
DesignProcess-
Normalization:Example
baddatabasedesignconsistsof–
RepetitionofInformation.
Inabilitytorepresentcertaininformation.
Weshalldiscusstheseproblemswiththehelp
ofamodifieddatabasedesignforour
universityexample.
59IBS Hyderabad

Database Design
DesignProcess-
Normalization:Example.
60IBS Hyderabad

Database Design
DesignProcess-
Normalization:Example.
Noticethepresenttablecontainsrepetitionof
informationwithdepartments(building,
budget)–redundancyproblem.
Thisredundancyleadstoinconsistencyin
managingdatabase.
Anotherproblemis“inabilitytorepresent
certaininformation”.(addition/deletionof
departmentwithoutinstructorisnotpossible).
61IBS Hyderabad

Data Storage and Querying
Adatabasesystemispartitionedintomodules
thatdealwitheachoftheresponsibilitiesofthe
overallsystem.
FunctionalModules–
1.StorageManager.
2.QueryProcessorComponents.
62IBS Hyderabad

Data Storage and Querying
StorageManagerisimportantbecause
databasetypicallyrequirealargeamountof
storagespace.
63IBS Hyderabad

Data Storage and Querying
Mainmemoryofcomputercannotstorethis
muchinformation,theinformationisstoredon
disks.
Dataaremovedbetweendiskandmain
memoryasneeded.
Movementofdatafromdisktomainmemory
isslowrelativetospeedofCPU,therefore
databasesystemstructurethedatasoasto
minimizetheneedtomovedatabetweendisk
andmainmemory.
64IBS Hyderabad

Data Storage and Querying
Thequeryprocessorsimplifiesdatabase
accessfacility.
Itworksatviewlevelwithoutunderstanding
thephysicallevelimplementationdetails.
Databasesystemtranslatesandupdatesthe
querieswritteninnonprocedurallanguage,at
logicallevelintoanefficientsequenceof
operationsatphysicallevelwiththehelpof
queryprocessor.
65IBS Hyderabad

Data Storage and Querying
StorageManager:Itprovidesinterface
betweenthelow-leveldatastoredindatabase
andtheapplicationprogramandqueries
submittedtothesystem.
Isresponsiblefortheinteractionwiththefile
managersupportedbyoperatingsystem.
Itisalsoresponsibleforstoring,retrieving,and
updatingdatainthedatabase.
66IBS Hyderabad

Data Storage and Querying
StorageManagerComponents:
1.AuthorizationandintegrityManager.
2.TransactionManager.
3.FileManager.
4.BufferManager.
67IBS Hyderabad

Data Storage and Querying
StorageManagerdatastructures:
1.DataFiles.
2.DataDictionary.
3.Indices.
68IBS Hyderabad

Data Storage and Querying
TheQueryProcessorComponents:
1.DDLinterpreter.
2.DMLCompiler.
3.Queryevaluationengine.
69IBS Hyderabad

Transaction Management
Atransactionisacollectionofoperationsthat
performsasinglelogicalfunctionina
database.
ThetransactionManagementconsistsofthe
Concurrency-controlmanager andthe
recoverymanager.
Eachtransactionisaunitofbothatomicityand
consistency.
Itisprogrammer’sresponsibilitytodefine
properlythevarioustransactions,sothateach
preservestheconsistencyofthedatabase.
70IBS Hyderabad

Transaction Management
Recoverymanagementensuresatomicityand
durability.
Thedatabasesystemmustperformfailure
recovery,thatis,detectsystemfailuresand
restorethedatabasetothestatethatexisted
priortotheoccurrenceofthefailure.
Itistheresponsibilityoftheconcurrency-
controlmanagementtocontroltheinteraction
amongtheconcurrenttransactions,toensure
theconsistencyofthedatabase.
71IBS Hyderabad

Database Architecture
72IBS Hyderabad

Database Architecture
73IBS Hyderabad

Database Architecture
Thearchitectureofadatabasesystemis
greatlyinfluencedbytheunderlyingcomputer
systemonwhichthedatabasesystemruns.
Itcanbecentralizedorclient-servertypes.
Itcanalsobedesignedtoexploitparallel
computerarchitectures.
Distributeddatabase span multiple
geographicallyseparatedmachines.
ODBC&JDBCisusedtoprovideinterface
betweenclientandsever.
74IBS Hyderabad

Database Users and Administrators
Aprimarygoalofadatabasesystemisto
retrieveinformationfromandstorenew
informationintothedatabase.
Peoplewhoworkwithadatabasecanbe
categorizedasdatabaseusersordatabase
administrators.
75IBS Hyderabad

Database Users and Administrators
FourtypesofdatabaseUsers–basedonthe
waytheyexpecttointeractwithsystem.
1.NaïveUser:Sophisticateduserswho
interactswiththesystembyinvokingoneof
theapplicationprograms.
Ex,-Clerkaddsnewrecordtotheexisting
databaseusingprogramspecificallydesigned
toaddrecord.
AFormbaseduserinterfaceispreferredto
naiveusers.
76IBS Hyderabad

Database Users and Administrators
FourtypesofdatabaseUsers–basedonthe
waytheyexpecttointeractwithsystem.
2.ApplicationProgrammers:arecomputer
professionalswhowriteapplicationprograms.
RapidApplicationDevelopment(RAD)tools
speedsupprogrammingcapabilitieswith
minimizationofeffortstodevelopuser
interfaces.
77IBS Hyderabad

Database Users and Administrators
FourtypesofdatabaseUsers–basedonthe
waytheyexpecttointeractwithsystem.
3.SophisticatedUsers:interactswiththe
systemwithoutwritingprograms.
Instead,theyformtheirrequestseitherusinga
databasequerylanguageorbyusingtools
suchasdataanalysissoftware.
Analystswhosubmitqueriestoexploredatain
thedatabasefallinthiscategory.
78IBS Hyderabad

Database Users and Administrators
FourtypesofdatabaseUsers–basedonthe
waytheyexpecttointeractwithsystem.
4.SpecializedUsers:aresophisticatedusers
whowritespecializeddatabaseapplications
thatdonotfitintothetraditionaldata-
processingframework.
Ex.-ComputerAidedDesign,Knowledge
basedexpertsystems.
79IBS Hyderabad

Database Users and Administrators
DatabaseAdministrator:Oneofthemain
reasonforusingDBMSsistohavecentral
controlofboththedataandtheprogramsthat
accessthosedata.
Apersonwhohassuchcentralcontrolover
thesystemiscalledadatabaseAdministrator
(DBA).
80IBS Hyderabad

Database Users and Administrators
DatabaseAdministrator:Functionsofa
DBA-
1.Schemadefinition–TheDBAcreatesthe
originaldatabaseschemabyexecutingaset
ofdatadefinitionstatementsintheDDL.
2.Storagestructureandaccess-method
definition–
3.Schema and physical-orginzation
modification-
81IBS Hyderabad

Database Users and Administrators
DatabaseAdministrator:Functionsofa
DBA-
4.Grantingofauthorizationfordataaccess-
5.Routingmaintenance–like,backup,free
spacemanagement,monitoringjobsand
performanceofthedatabase.
82IBS Hyderabad

Reviews
DatabaseSystemApplications.
PurposeofDatabasesystems.
ViewofData.
DatabaseLanguage.
RelationalDatabase.
DatabaseDesign.
DatabaseArchitecture.
DatabaseUsersandDBA.
83IBS Hyderabad

Thank You!
84 IBS Hyderabad