Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and...

33
Introduction to Introduction to Databases Databases A line manager asks, A line manager asks, “If data unorganized is “If data unorganized is like matter unorganized and God created the heavens like matter unorganized and God created the heavens and earth in six days, how come it takes six months for and earth in six days, how come it takes six months for all these consultants to build a database model for a all these consultants to build a database model for a simple business process?” simple business process?”

Transcript of Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and...

Page 1: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Introduction to DatabasesIntroduction to Databases

A line manager asks, A line manager asks, “If data unorganized is like “If data unorganized is like matter unorganized and God created the matter unorganized and God created the

heavens and earth in six days, how come it heavens and earth in six days, how come it takes six months for all these consultants to takes six months for all these consultants to build a database model for a simple business build a database model for a simple business

process?”process?”

Page 2: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Introduction to DatabasesIntroduction to Databases

File System LimitationsFile System Limitations Database SystemsDatabase Systems History of DatabasesHistory of Databases Pros & Cons of DatabasesPros & Cons of Databases Database CareersDatabase Careers

Page 3: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

File System LimitationsFile System LimitationsSection #1Section #1

Separating and Joining DataSeparating and Joining Data Duplicating DataDuplicating Data Data DependenceData Dependence Incompatible File FormatsIncompatible File Formats Fixed QueriesFixed Queries Security LimitationsSecurity Limitations

Page 4: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Separating and Isolating Separating and Isolating DataData

Files store related data about a subjectFiles store related data about a subject Files only contain information for their primary Files only contain information for their primary

purpose.purpose. Joining files lets you answer questionsJoining files lets you answer questions

Programs resolve complex relationships and Programs resolve complex relationships and formatting between different files.formatting between different files.

Business reports read multiple filesBusiness reports read multiple files Programmers write reports by joining data from Programmers write reports by joining data from

multiple files to create meaningful information.multiple files to create meaningful information.

Page 5: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Duplicatiing DataDuplicatiing Data

Files systems duplicate dataFiles systems duplicate data Files become data islands with complex organization, Files become data islands with complex organization,

and store copies of secondary data from other files.and store copies of secondary data from other files. Files maintain their copy of the dataFiles maintain their copy of the data

Files maintain their own copy of data and change the Files maintain their own copy of data and change the data data withoutwithout advising the primary source file. advising the primary source file.

Duplicate data leads to inconsistent dataDuplicate data leads to inconsistent data Over time, businesses don’t know which file contains Over time, businesses don’t know which file contains

the most accurate data, and can make bad the most accurate data, and can make bad decisions.decisions.

Page 6: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Data DependenceData Dependence

Physical storage in filesPhysical storage in files Files store things in structures or lines of text Files store things in structures or lines of text

and they are called flat files.and they are called flat files. Delimiters, parsing and concatenatingDelimiters, parsing and concatenating

Delimiters are non-text characters separating Delimiters are non-text characters separating data elements, and can be XML tags. data elements, and can be XML tags.

Position specific filesPosition specific files Files organized by physical position define Files organized by physical position define

what character range contains a data element.what character range contains a data element.

Page 7: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Incompatible File FormatsIncompatible File Formats

Programming languages differProgramming languages differ Files written by C/C++ differ from files written Files written by C/C++ differ from files written

by COBOL or RPG.by COBOL or RPG. Programmers solve problems differentlyProgrammers solve problems differently

Organization of files differs dependent on how Organization of files differs dependent on how the programmer saw the problem.the programmer saw the problem.

Formats differFormats differ Data structures differ between files and require Data structures differ between files and require

mapping their differences.mapping their differences.

Page 8: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Fixed QueriesFixed Queries

Fixed queries report or enter dataFixed queries report or enter data These are programs dealing with one or more files These are programs dealing with one or more files

that are reports or data entry forms.that are reports or data entry forms. Fixed queries are written by programmersFixed queries are written by programmers

Programmers write reports and forms as requested Programmers write reports and forms as requested and budgeted by organizations. and budgeted by organizations.

Fixed queries don’t answer Ad Hoc questionsFixed queries don’t answer Ad Hoc questions Impromptu end-user questions can’t be answered Impromptu end-user questions can’t be answered

without the assistance of an IT organization.without the assistance of an IT organization.

Page 9: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Security LimitationsSecurity Limitations

File ownership limitsFile ownership limits Primary source files are controlled by one Primary source files are controlled by one

organization in businesses.organization in businesses. File change limitsFile change limits

Primary source files are changeable only with Primary source files are changeable only with permission of the owning organization.permission of the owning organization.

File confidentialityFile confidentiality Primary source files are viewable as a whole Primary source files are viewable as a whole

and cannot be restricted by data elements, and cannot be restricted by data elements, resulting in compromised confidentiality.resulting in compromised confidentiality.

Page 10: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

File System LimitationsFile System LimitationsReview Section #1Review Section #1

Separating and Joining DataSeparating and Joining Data Duplicating DataDuplicating Data Data DependenceData Dependence Incompatible File FormatsIncompatible File Formats Fixed QueriesFixed Queries Security LimitationsSecurity Limitations

Page 11: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database SystemsDatabase SystemsSection #2Section #2

Database InstanceDatabase Instance Database Management SystemDatabase Management System Standard Language InterfaceStandard Language Interface Security Privileges & RolesSecurity Privileges & Roles Database TypesDatabase Types

Page 12: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database InstanceDatabase Instance

Data and the definition of data are Data and the definition of data are stored in an organized way.stored in an organized way.

Data is stored in tables that are 2D Data is stored in tables that are 2D arrays, like a spreadsheet.arrays, like a spreadsheet.

Data definition is metadata, or data Data definition is metadata, or data about data, which is also stored in about data, which is also stored in tables.tables.

Data can also contain stored programs Data can also contain stored programs that let you access data.that let you access data.

Page 13: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database Management Database Management SystemSystem

Programs that manage and access Programs that manage and access the database instance.the database instance.

Programs that let external programs Programs that let external programs access the database instance.access the database instance.

Programs that control access to the Programs that control access to the database instance.database instance.

Programs that backup and recover Programs that backup and recover the database instance.the database instance.

Page 14: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Standard Language Standard Language InterfaceInterface

Structured Query Language (SQL)Structured Query Language (SQL) Structured English QUEry Language Structured English QUEry Language

(SEQUEL)(SEQUEL) ANSI StandardsANSI Standards

ANSI SQL-86ANSI SQL-86 ANSI SQL-89ANSI SQL-89 ANSI SQL-92ANSI SQL-92 ANSI SQL:1999ANSI SQL:1999 ANSI SQL:2003ANSI SQL:2003

Page 15: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Security Privileges & RolesSecurity Privileges & Roles

Security is tiered by ANSI-SPARC rulesSecurity is tiered by ANSI-SPARC rules Superuser – holds internal dataSuperuser – holds internal data Administrator – holds conceptual dataAdministrator – holds conceptual data User – holds external dataUser – holds external data

Superuser grants privileges to usersSuperuser grants privileges to users Grants individual privileges one at a time.Grants individual privileges one at a time. Creates roles as groups of privileges.Creates roles as groups of privileges. Grants grouped privileges as roles.Grants grouped privileges as roles.

Data can be restricted at various levelsData can be restricted at various levels

Page 16: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database TypesDatabase Types

Database typesDatabase types Operational – dynamic, time-independent, and Operational – dynamic, time-independent, and

critical business operational data.critical business operational data. Analytical – statistical, historic, and time-Analytical – statistical, historic, and time-

dependent business data. dependent business data. Database implementation typesDatabase implementation types

Online Transactional Processing (OLTP) – Online Transactional Processing (OLTP) – business applications, also known as operational business applications, also known as operational databases.databases.

Online Analytical Processing (OLAP) – data Online Analytical Processing (OLAP) – data warehouses, also known as analytical databases.warehouses, also known as analytical databases.

Page 17: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database SystemsDatabase SystemsRevised Section #2Revised Section #2

Database InstanceDatabase Instance Database Management SystemDatabase Management System Standard Language InterfaceStandard Language Interface Security Privileges & RolesSecurity Privileges & Roles Database TypesDatabase Types

Page 18: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

History of DatabasesHistory of DatabasesSection #3Section #3

File SystemsFile Systems Hierarchical File SystemsHierarchical File Systems Networked File SystemsNetworked File Systems Relational DatabasesRelational Databases Object Relational DatabasesObject Relational Databases

Also known as Also known as ExtendedExtended Relational Relational DatabasesDatabases

Object-Oriented DatabasesObject-Oriented Databases

Page 19: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

File SystemsFile Systems

Files were the first way to organize Files were the first way to organize data.data.

Files contain related data in structures.Files contain related data in structures. File systems contain files, and they File systems contain files, and they

duplicate and corrupt copies of data.duplicate and corrupt copies of data. File systems are programming language File systems are programming language

specific, restricting file sharing.specific, restricting file sharing. File systems have too many structures.File systems have too many structures.

Page 20: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Hierarchical File SystemsHierarchical File Systems

Are defined by an inverted treeAre defined by an inverted tree The top most node is a parent, who can The top most node is a parent, who can

have child nodes, and the bottom node have child nodes, and the bottom node is a leaf node – by a parent-child is a leaf node – by a parent-child pointer.pointer.

You navigate from the top most node to You navigate from the top most node to all subordinate nodes, which becomes all subordinate nodes, which becomes expensive when data is spread out.expensive when data is spread out.

Page 21: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Networked File SystemsNetworked File Systems

Are also defined by an inverted treeAre also defined by an inverted tree The top most node (also a set structure) The top most node (also a set structure)

links by a pointer or list of pointers to links by a pointer or list of pointers to other set structures or nodes.other set structures or nodes.

Searches are made from node to node Searches are made from node to node through pointers that associate a node through pointers that associate a node with subordinate nodes or set structure.with subordinate nodes or set structure.

Page 22: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Relational DatabasesRelational Databases

Are defined by tables.Are defined by tables. Tables are defined by a list of columns, Tables are defined by a list of columns,

known as a signature.known as a signature. Metadata tables hold definitions of tables.Metadata tables hold definitions of tables. Links between tables are dynamic Links between tables are dynamic

relationships as opposed to stored pointer relationships as opposed to stored pointer structures.structures.

Relationships between tables are made by Relationships between tables are made by comparing values in columns, and columns comparing values in columns, and columns are known as primary and foreign keys.are known as primary and foreign keys.

Page 23: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Object Relational DatabasesObject Relational Databases(Extended Relational Databases)(Extended Relational Databases)

Are defined by objects, which can be tables, Are defined by objects, which can be tables, nested collections, or objects with methods.nested collections, or objects with methods.

Objects are defined by a list of columns, known Objects are defined by a list of columns, known as a signature, which can contain methods.as a signature, which can contain methods.

Metadata tables hold definitions of objects.Metadata tables hold definitions of objects. Links between objects are dynamic Links between objects are dynamic

relationships.relationships. Relationships between objects are made by Relationships between objects are made by

comparing values in columns, and columns are comparing values in columns, and columns are known as primary and foreign keys.known as primary and foreign keys.

Page 24: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Object-Oriented DatabasesObject-Oriented Databases

Are defined by instantiable objects with Are defined by instantiable objects with methods.methods.

Objects are defined by a list of attributes Objects are defined by a list of attributes with a constructor and methods.with a constructor and methods.

Metadata tables hold definitions of objects.Metadata tables hold definitions of objects. Links between objects are dynamic Links between objects are dynamic

relationships.relationships. Relationships between objects are made Relationships between objects are made

during instantiation of object instances by during instantiation of object instances by dynamic marshalling.dynamic marshalling.

Page 25: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

History of DatabasesHistory of DatabasesReview Section #3Review Section #3

File SystemsFile Systems Hierarchical File SystemsHierarchical File Systems Networked File SystemsNetworked File Systems Relational DatabasesRelational Databases Object Relational DatabasesObject Relational Databases

Also known as Also known as ExtendedExtended Relational Relational DatabasesDatabases

Object-Oriented DatabasesObject-Oriented Databases

Page 26: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Pros & Cons of DatabasesPros & Cons of DatabasesSection #4Section #4

AdvantagesAdvantages Data redundancy control, consistency, Data redundancy control, consistency,

sharing, integrity, security, access, sharing, integrity, security, access, responsiveness, concurrency, responsiveness, concurrency, independence, and backup/recovery.independence, and backup/recovery.

DisadvantagesDisadvantages Complexity, conversion costs, Complexity, conversion costs,

performance, and all-or-nothing risk of performance, and all-or-nothing risk of catastrophic failure.catastrophic failure.

Page 27: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database CareersDatabase CareersSection #5Section #5

Database Administrator (DBA)Database Administrator (DBA) Physical Database AdministratorPhysical Database Administrator Application Database AdministratorApplication Database Administrator

Database AnalystDatabase Analyst Database DesignerDatabase Designer Database ProgrammerDatabase Programmer

Page 28: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database Administrator Database Administrator (DBA)(DBA)

Physical Database AdministratorPhysical Database Administrator Physical file administration and Physical file administration and

ownershipownership Startup and shutdown authorityStartup and shutdown authority Backup and recovery responsibilityBackup and recovery responsibility

Application Database AdministratorApplication Database Administrator Privilege and role administrationPrivilege and role administration User/schema administrationUser/schema administration Operations and tuning administrationOperations and tuning administration

Page 29: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database AnalystDatabase Analyst

Database physical model implementationDatabase physical model implementation Translation of logical design to physical Translation of logical design to physical

modelmodel Analysis of query performanceAnalysis of query performance Analysis of index performanceAnalysis of index performance

Database data integrityDatabase data integrity Analysis of insertion, update and deletion Analysis of insertion, update and deletion

anomaliesanomalies Analysis of primary and foreign key validationAnalysis of primary and foreign key validation

Page 30: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database DesignerDatabase Designer

Define a data model for business processDefine a data model for business process Meet with users and define requirementsMeet with users and define requirements Understand the purpose of the businessUnderstand the purpose of the business Design a logical model to manage dataDesign a logical model to manage data Define primary and foreign key relationshipsDefine primary and foreign key relationships Render model and generate build scriptsRender model and generate build scripts

Secure business acceptance of modelSecure business acceptance of model

Page 31: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database ProgrammerDatabase Programmer

Define a business processesDefine a business processes Meet with users and define requirementsMeet with users and define requirements Understand the purpose of the businessUnderstand the purpose of the business Design a program architecture for processDesign a program architecture for process

Write programs to support processWrite programs to support process Coordinate unit and integration testingCoordinate unit and integration testing Document and release code to Document and release code to

productionproduction

Page 32: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

Database CareersDatabase CareersReview Section #5Review Section #5

Database Administrator (DBA)Database Administrator (DBA) Physical Database AdministratorPhysical Database Administrator Application Database AdministratorApplication Database Administrator

Database AnalystDatabase Analyst Database DesignerDatabase Designer Database ProgrammerDatabase Programmer

Page 33: Introduction to Databases A line manager asks, “If data unorganized is like matter unorganized and God created the heavens and earth in six days, how come.

SummarySummary

File System LimitationsFile System Limitations Database SystemsDatabase Systems History of DatabasesHistory of Databases Pros & Cons of DatabasesPros & Cons of Databases Database CareersDatabase Careers