Your SlideShare is downloading. ×
0
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Lec01
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Lec01

667

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
667
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
67
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. DB2 Database Management Systems Introduction to Database Systems 13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  2. Textbook Used <ul><li>Database System Concepts by Abraham Silberschatz, 5 th Edition </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  3. Outline <ul><li>Database Management Systems </li></ul><ul><li>Data Abstraction </li></ul><ul><li>Instances and Schemas </li></ul><ul><li>Data Models </li></ul><ul><li>Database Languages </li></ul><ul><li>Database Design </li></ul><ul><li>Database Architectures </li></ul><ul><li>History of Database systems </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  4. Data base Management System? <ul><li>Database Management system is a collection of interrelated data and a set of programs to access those data. </li></ul><ul><li>Data: stored representations of meaningful objects and events </li></ul><ul><ul><li>Structured: numbers, text, dates </li></ul></ul><ul><ul><li>Unstructured: images, video, documents </li></ul></ul><ul><li>Collection of data is usually referred to as database </li></ul><ul><ul><li>An environment that is both convenient and efficient to use </li></ul></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  5. Database Applications <ul><li>Database are widely used. Some of its applications are: </li></ul><ul><ul><li>Banking: all transactions </li></ul></ul><ul><ul><li>Airlines: reservations, schedules </li></ul></ul><ul><ul><li>Universities: registration, grades </li></ul></ul><ul><ul><li>Credit Card Transactions: Purchases on credit cards and generation of monthly statements </li></ul></ul><ul><ul><li>Telecommunication: Keeping record of calls made, generating monthly bills, maintaining balances on prepaid calling, storing information about communication networks </li></ul></ul><ul><ul><li>Finance: Storing information about holdings, sales and purchase of financial instruments such as stocks and bonds </li></ul></ul><ul><ul><li>Sales: customers, products, purchases </li></ul></ul><ul><ul><li>Online retailers: order tracking, customized recommendations </li></ul></ul><ul><ul><li>Manufacturing: production, inventory, orders, supply chain </li></ul></ul><ul><ul><li>Human resources: employee records, salaries, tax deductions </li></ul></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  6. Disadvantages of File Processing <ul><li>Data Redundancy and inconsistency </li></ul><ul><li>Example is address and telephone number stored in a file containing savings and checking account records. This redundancy leads to higher storage and access cost. Also a changed customer address is reflected in savings account but not elsewhere in the system resulting in data inconsistency. </li></ul><ul><li>Accessing Data: Example is let us say bank officer wants to find names of customers who live within the city’s zip code say 78733. As of here, the software was not designed to do this job . So here the officer is left with two choices: one is get list of all customers and extract the needed information manually. The second choice is ask the programmer to write the necessary application program. </li></ul><ul><li>Data isolation: Data scattered in various file and files are in different format, it is difficult to write a new program to retrieve the appropriate data. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  7. Disadvantages of File Processing <ul><li>Concurrent Access: Consider say you and your friend are holder of an account say A which got an amount of say $2000.00. let us say both you and friend withdraws say $500 and $200 from the account at the same time. This results in incorrect result say 1500 or 1800 and not 1300. So to guard against it, some form of supervision must be maintained. </li></ul><ul><li>Security : In banking system, payroll personnel need see some part of database only that has information about various bank employees. As application programs are added in ad hoc manner, it is difficult to enforce such security problems </li></ul><ul><li>Integrity Problems: Data values stored in database must satisfy certain type of consistency constraint. For example say bank account should not have balance less than say $100.00. But if new constraints are to be added, it has to be enforced in the program. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  8. 13/2/2012 DB2 Dr.Suresh Sankaranarayanan Duplicate Data
  9. Database Management System DBMS manages data resources like an operating system manages hardware resources A software system that is used to create, maintain, and provide controlled access to user databases Order Filing System Invoicing System Payroll System DBMS Central database Contains employee, order, inventory, pricing, and customer data 13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  10. Advantages of the Database Approach <ul><li>Program-data independence </li></ul><ul><li>Planned data redundancy </li></ul><ul><li>Improved data consistency </li></ul><ul><li>Improved data sharing </li></ul><ul><li>Increased application development productivity </li></ul><ul><li>Enforcement of standards </li></ul><ul><li>Improved data quality </li></ul><ul><li>Improved data accessibility and responsiveness </li></ul><ul><li>Reduced program maintenance </li></ul><ul><li>Improved decision support </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  11. Costs and Risks of the Database Approach <ul><li>New, specialized personnel </li></ul><ul><li>Installation and management cost and complexity </li></ul><ul><li>Conversion costs </li></ul><ul><li>Need for explicit backup and recovery </li></ul><ul><li>Organizational conflict </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  12. Components of the Database Environment 13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  13. Components of the Database Environment <ul><li>CASE Tools–computer-aided software engineering </li></ul><ul><li>Repository–centralized storehouse of metadata </li></ul><ul><li>Database Management System (DBMS) –software for managing the database </li></ul><ul><li>Database–storehouse of the data </li></ul><ul><li>Application Programs–software using the data </li></ul><ul><li>User Interface–text and graphical displays to users </li></ul><ul><li>Data/Database Administrators–personnel responsible for maintaining the database </li></ul><ul><li>System Developers–personnel responsible for designing databases and software </li></ul><ul><li>End Users–people who use the applications and databases </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  14. Data Abstraction <ul><li>Database System is a collection of interrelated data </li></ul><ul><li>Set of programmes that allow users to access and modify the data </li></ul><ul><li>Purpose of database system is to provide users with an abstract view of data </li></ul><ul><li>System hides certain details of how the data are stored and maintained. </li></ul><ul><li>Three levels of data abstraction </li></ul><ul><li>Physical Level : </li></ul><ul><li>Lowest level of abstraction describes how data are actually stored. </li></ul><ul><li>Describes complex low level data structures in detail. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  15. Data Abstraction <ul><li>Logical level </li></ul><ul><li>Next higher level of abstraction </li></ul><ul><li>Describes what data are stored in database and what relationships exist among those data </li></ul><ul><li>View level: </li></ul><ul><li>Highest Level of Abstraction </li></ul><ul><li>Describes only part of the entire database. </li></ul><ul><li>Application programs hide details of data types. </li></ul><ul><li>Views can also hide information (such as an employee’s salary) for security purposes. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  16. Data Abstraction 13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  17. Instances and Schemas <ul><li>Database change over time as information is inserted and deleted </li></ul><ul><li>Instance : </li></ul><ul><li>Collection of Information stored in the database at a particular moment </li></ul><ul><li>Analogous to a value of variable in a program </li></ul><ul><li>Schema </li></ul><ul><li>Overall design of the database- logical structure is called Schema. </li></ul><ul><li>Corresponds to the variable declarations in a program. </li></ul><ul><li>Database systems have several Schemas according to the level of abstraction </li></ul><ul><li>a. Physical Schema: Database design at physical level </li></ul><ul><li>b. Logical Schema: Database design at logical level. </li></ul><ul><li>c. Subschemas: Several Schemas at view level that describe different views of the database </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  18. Instances and Schemas <ul><li>Data Independence: Ability to modify the Schema at one level without affecting the schema definition at another level. </li></ul><ul><li>Physical Data Independence </li></ul><ul><li>Ability to modify the physical schema without causing application programs to be rewritten. </li></ul><ul><li>Modifications at physical level are necessary to improve the performance </li></ul><ul><li>Logical Data Independence </li></ul><ul><li>Ability to modify the logical schema without causing application programs to be rewritten. </li></ul><ul><li>Modifications at logical level are necessary when logical structure of database is altered. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  19. Data Models <ul><li>Data Models : Collection of tools for describing data, data relationships, data semantics and data constraints </li></ul><ul><li>Data Models can be classified into four different categories: </li></ul><ul><li>Relational Model: Collection of tables to represent both data and relationships among those data </li></ul><ul><li>Entity- Relationship Model: Collection of basic objects called entities and relationship among these objects </li></ul><ul><li>Object Oriented Data model: Object Oriented data model can be seen as extending E-R model with notions of encapsulation, functions and Object identity. Combines the features of object oriented data model and relational data model </li></ul><ul><li>Semi structured Data model: Specification of data where individual data items of same type may have different set of attributes. XML is used to represent semi structured data. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  20. Database Languages <ul><li>Provides two languages- Data Definition Language(DDL) and Data Manipulation Language (DML) </li></ul><ul><li>DDL: Specify Database Schema </li></ul><ul><li>DML: Express Database queries and updates. </li></ul><ul><li>DDL and DML are not two separate languages </li></ul><ul><li>DDL and DML form parts of single database language such as SQL. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  21. Relational Databases <ul><li>Relational database is based on two things : </li></ul><ul><li>a. Relational model </li></ul><ul><li>b. Collection of tables to represent both data and relationships among those data. </li></ul><ul><li>Includes DDL and DML </li></ul><ul><li>Employs SQL Language. </li></ul><ul><li>Relational data model is most widely used data model and majority of database systems are based on relational data model. </li></ul><ul><li>A sample of relational database comprising of three tables is shown here. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  22. Relational Databases 13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  23. Application Programs & SQL <ul><li>Sql is not as powerful as a universal tuning machine </li></ul><ul><li>Some computations cannot be obtained by Sql query </li></ul><ul><li>These computations must be written in a host language like Cobol, C, C++ or Java with embedded Sql that access the data in database </li></ul><ul><li>Applications programs are ones that interact with the database in this fashion. </li></ul><ul><li>Application programs access the database in following two ways : </li></ul><ul><ul><li>Language extensions to allow embedded SQL </li></ul></ul><ul><ul><li>Application program interface (e.g., ODBC/JDBC) which allow SQL queries to be sent to a database </li></ul></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  24. Database Design <ul><li>The process of designing the general structure of the database: </li></ul><ul><li>Logical Design – Deciding on the database schema. Database design requires that we find a “good” collection of relation schemas. </li></ul><ul><ul><li>Business decision – What attributes should we record in the database? </li></ul></ul><ul><ul><li>Computer Science decision – What relation schemas should we have and how should the attributes be distributed among the various relation schemas? </li></ul></ul><ul><li>Physical Design – Deciding on the physical layout of the database </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  25. Database Architecture <ul><li>The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running: </li></ul><ul><li>Centralized </li></ul><ul><li>Client-server </li></ul><ul><li>Parallel (multi-processor) </li></ul><ul><li>Distributed </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  26. Two and Three Tier- Client/Server <ul><li>In Two Tier application resides at the client machine that invokes the database system functionality at the server through query statements. ODBC and JDBC are used for interaction between client and server </li></ul><ul><li>In Three Tier, client machine acts as merely front end and contains no direct database calls. Instead client end communicates with the application server which in turn communicates with the database system to access data. </li></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  27. Database Users <ul><li>Users are differentiated by the way they expect to interact with </li></ul><ul><li>the system </li></ul><ul><li>Application programmers – interact with system through DML calls </li></ul><ul><li>Sophisticated users – form requests in a database query language </li></ul><ul><li>Specialized users – write specialized database applications that do not fit into the traditional data processing framework </li></ul><ul><li>Naïve users – invoke one of the permanent application programs that have been written previously </li></ul><ul><ul><li>Examples, people accessing database over the web, bank tellers, clerical staff </li></ul></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  28. Database Administrator <ul><li>Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise’s information resources and needs. </li></ul><ul><li>Database administrator's duties include: </li></ul><ul><ul><li>Schema definition </li></ul></ul><ul><ul><li>Storage structure and access method definition </li></ul></ul><ul><ul><li>Schema and physical organization modification </li></ul></ul><ul><ul><li>Granting user authority to access the database </li></ul></ul><ul><ul><li>Specifying integrity constraints </li></ul></ul><ul><ul><li>Acting as liaison with users </li></ul></ul><ul><ul><li>Monitoring performance and responding to changes in requirements </li></ul></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  29. System Structure 13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  30. History of Database Systems <ul><li>1950s and early 1960s: </li></ul><ul><ul><li>Data processing using magnetic tapes for storage </li></ul></ul><ul><ul><ul><li>Tapes provide only sequential access </li></ul></ul></ul><ul><ul><li>Punched cards for input </li></ul></ul><ul><li>Late 1960s and 1970s: </li></ul><ul><ul><li>Hard disks allow direct access to data </li></ul></ul><ul><ul><li>Network and hierarchical data models in widespread use </li></ul></ul><ul><ul><li>Ted Codd defines the relational data model </li></ul></ul><ul><ul><ul><li>Would win the ACM Turing Award for this work </li></ul></ul></ul><ul><ul><ul><li>IBM Research begins System R prototype </li></ul></ul></ul><ul><ul><ul><li>UC Berkeley begins Ingres prototype </li></ul></ul></ul><ul><ul><li>High-performance (for the era) transaction processing </li></ul></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan
  31. History of Database Systems <ul><li>1980s: </li></ul><ul><ul><li>Research relational prototypes evolve into commercial systems </li></ul></ul><ul><ul><ul><li>SQL becomes industrial standard </li></ul></ul></ul><ul><ul><li>Parallel and distributed database systems </li></ul></ul><ul><ul><li>Object-oriented database systems </li></ul></ul><ul><li>1990s: </li></ul><ul><ul><li>Large decision support and data-mining applications </li></ul></ul><ul><ul><li>Large multi-terabyte data warehouses </li></ul></ul><ul><ul><li>Emergence of Web commerce </li></ul></ul><ul><li>2000s: </li></ul><ul><ul><li>XML and XQuery standards </li></ul></ul><ul><ul><li>Automated database administration </li></ul></ul>13/2/2012 DB2 Dr.Suresh Sankaranarayanan

×