Скачать презентацию Database Management Systems TEXT BOOKS n 1 Скачать презентацию Database Management Systems TEXT BOOKS n 1

291ab0ff02663b816855154f4905cc9f.ppt

  • Количество слайдов: 27

Database Management Systems Database Management Systems

TEXT BOOKS n 1. Database Management Systems, Raghurama Krishnan, Johannes Gehrke, TATA Mc. Graw. TEXT BOOKS n 1. Database Management Systems, Raghurama Krishnan, Johannes Gehrke, TATA Mc. Graw. Hill 3 rd edition n 2. Database System Concepts, Silberschatz, Korth, Mc. Graw hill, 5 th edition. n REFERENCES : n 1. Database Systems design, Implementation, and Management, Peter Rob & Carlos Coronel 7 th Edition. n 2. Fundamentals of Database Systems, Elmasri Navate, Pearson Education n 3. Introduction to Database Systems, C. J. Date, Pearson Education Database System Concepts 1. 2

Chapter 1: Introduction n Purpose of Database Systems n View of Data n Data Chapter 1: Introduction n Purpose of Database Systems n View of Data n Data Models n Data Definition Language n Data Manipulation Language n Transaction Management n Storage Management n Database Administrator n Database Users n Overall System Structure Database System Concepts 1. 3

Database Management System (DBMS) n Collection of interrelated data n Set of programs to Database Management System (DBMS) n Collection of interrelated data n Set of programs to access the data n DBMS contains information about a particular enterprise n DBMS provides an environment that is both convenient and efficient to use. n Database Applications: H Banking: all transactions H Airlines: reservations, schedules H Universities: registration, grades H Sales: customers, products, purchases H Manufacturing: production, inventory, orders, supply chain H Human resources: employee records, salaries, tax deductions n Databases touch all aspects of our lives Database System Concepts 1. 4

Some Issues n Creation of definitions/structures H Various views H Various types of users Some Issues n Creation of definitions/structures H Various views H Various types of users n Storing n Retrieving -- Indexes n Manipulating the data n Designing a good database --Normalization n Support for transactions H Crash recovery H Concurrent execution 4 Two clerks trying to reserve the same berth in a railway reservation system! 4 Two concurrent programs trying to add Rs 50 and Rs 100 to the same account. n Security Database System Concepts 1. 5

Purpose of Database System n In the early days, database applications were built on Purpose of Database System n In the early days, database applications were built on top of file systems n Drawbacks of using file systems to store data: H Data redundancy and inconsistency 4 Multiple file formats, duplication of information in different files H Difficulty in accessing data 4 Need to write a new program to carry out each new task H Data isolation — multiple files and formats. 4 It should be possible for you to write your program without worrying about other programs. Thinks that you alone is using the data. H Integrity problems 4 Integrity constraints (e. g. account balance > 0) become part of program code 4 Hard to add new constraints or change existing ones Database System Concepts 1. 6

Purpose of Database Systems (Cont. ) n Drawbacks of using file systems (cont. ) Purpose of Database Systems (Cont. ) n Drawbacks of using file systems (cont. ) H Atomicity of updates 4 Failures may leave database in an inconsistent state with partial updates carried out 4 E. g. transfer of funds from one account to another should either complete or not happen at all H Concurrent access by multiple users 4 Concurrent accessed needed for performance 4 Uncontrolled concurrent accesses can lead to inconsistencies – E. g. two people reading a balance and updating it at the same time H Security problems n Database systems offer solutions to all the above problems Database System Concepts 1. 7

Levels of Abstraction n Physical level describes how a record (e. g. , customer) Levels of Abstraction n Physical level describes how a record (e. g. , customer) is stored. n Logical level: describes data stored in database, and the relationships among the data. H There are customers and accounts. Relationship is a customer can have one or many accounts. H Similarly a constraint saying that account-balance is non-negative is also part of the logical level description. n View level: There are several categories of users of a DBMS. They want to see the data in a particular form because of ease or clarity. Sometimes only part of a database is allowed to be accessed by a particular user. n There is only one Physical and Logical level schema, but there can be many view level schemas. Database System Concepts 1. 8

View of Data An architecture for a database system Database System Concepts 1. 9 View of Data An architecture for a database system Database System Concepts 1. 9

Instances and Schemas n Similar to types and variables in programming languages n Schema Instances and Schemas n Similar to types and variables in programming languages n Schema – the description about the data -- Meta data (data about data) H Schema is also data ! H A program which wants to access data, should first access the schema to know the things likes format, type of the data, etc. H This is a powerful concept which allows us to see the data in a more abstract way. H Physical schema: database description at the physical level H Logical schema: database description at the logical level n Instance – the actual content of the database at a particular point in time H Analogous to the value of a variable n Physical Data Independence – the ability to modify the physical schema without changing the logical schema H Applications depend on the logical schema H In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others. Database System Concepts 1. 10

Data Models n A collection of conceptual tools for describing data items along with Data Models n A collection of conceptual tools for describing data items along with relationship between them. It can also describe other information like constraints, etc. n Entity-Relationship model: A high level conceptual model which can be used to describe an enterprise without worrying about the technicalities of DBMS or any other system. H Good to do the requirements analysis. H Later on this can be converted easily into other models which are more technical. n Relational model: DB is a collection of relations. Relations(tables) are used to describe both data and relationships. n Other models: object-oriented model, semi-structured data models. Older models: network model and hierarchical model Database System Concepts 1. 11

Entity-Relationship Model An Example: ( we will see in detail later-on) Database System Concepts Entity-Relationship Model An Example: ( we will see in detail later-on) Database System Concepts 1. 12

Entity Relationship Model (Cont. ) n E-R model of real world H Entities (objects) Entity Relationship Model (Cont. ) n E-R model of real world H Entities (objects) 4 E. g. customers, accounts, bank branch H Relationships between entities 4 E. g. Account A-101 is held by customer Johnson 4 Relationship set depositor associates customers with accounts n Widely used for database design at a very high abstract level H Database design in E-R model usually converted to design in the relational model (coming up next) which is used for storage and processing Database System Concepts 1. 13

Relational Model Attributes n Example of tabular data in the relational model Customer-id customername Relational Model Attributes n Example of tabular data in the relational model Customer-id customername 192 -83 -7465 Johnson 019 -28 -3746 Smith 192 -83 -7465 Johnson 321 -12 -3123 Jones 019 -28 -3746 Smith Database System Concepts customerstreet customercity accountnumber Alma Palo Alto A-101 North Rye A-215 Alma Palo Alto A-201 Main Harrison A-217 North Rye A-201 1. 14

A Sample Relational Database System Concepts 1. 15 A Sample Relational Database System Concepts 1. 15

DDL and DML n Language for accessing and manipulating the data organized by the DDL and DML n Language for accessing and manipulating the data organized by the appropriate data model H DML also known as query language n Two classes of languages H Procedural – user specifies what data is required and how to get those data H Nonprocedural – user specifies what data is required without specifying how to get those data n SQL is the most widely used query language Database System Concepts 1. 16

DDL and DML : SQL n Data definition language is used to define schema DDL and DML : SQL n Data definition language is used to define schema (mostly at logical level) of a relation. H E. g. create table account ( account-number balance char(10), integer) n DDL compiler generates a table (relation) called account which is ready to be populated. n To insert a row (a data item) into the account table H insert into account values (‘A-9732’, 1200) Database System Concepts 1. 17

SQL n SQL: widely used non-procedural language which contains both DDL and DML. H SQL n SQL: widely used non-procedural language which contains both DDL and DML. H E. g. find the name of the customer with customer-id 192 -83 -7465 select customer-name from customer where customer-id = ‘ 192 -83 -7465’ H E. g. find the balances of all accounts held by the customer with customer -id 192 -83 -7465 select account. balance from depositor, account where depositor. customer-id = ‘ 192 -83 -7465’ and depositor. account-number = account-number n Application programs generally access databases through one of H Language extensions to allow embedded SQL H Application program interface (e. g. ODBC/JDBC) which allow SQL queries to be sent to a database Database System Concepts 1. 18

Database Users n Users are differentiated by the way they expect to interact with Database Users n Users are differentiated by the way they expect to interact with the system n Application programmers – Write applications which uses a database. They should know regarding how to access the database by using a host language, etc. n Sophisticated users – form requests in a database query language n Naïve users – Use already developed tools to access the data. E. g. people accessing database over the web, bank tellers, clerical staff Database System Concepts 1. 19

Database Administrator n Coordinates all the activities of the database system; the database administrator Database Administrator n Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise’s information resources and needs. n Database administrator's duties include: H Schema definition H Storage structure and access method definition H Schema and physical organization modification H Granting user authority to access the database H Specifying integrity constraints H Acting as liaison with users H Monitoring performance and responding to changes in requirements Database System Concepts 1. 20

Transaction Management n A transaction is a collection of operations that performs a single Transaction Management n A transaction is a collection of operations that performs a single logical function in a database application n Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e. g. , power failures and operating system crashes) and transaction failures. n Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database. Database System Concepts 1. 21

Storage Management n Storage manager is a program module that provides the interface between Storage Management n Storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. n The storage manager is responsible to the following tasks: H interaction with the file manager H efficient storing, retrieving and updating of data Database System Concepts 1. 22

Overall System Structure Database System Concepts 1. 23 Overall System Structure Database System Concepts 1. 23

Application Architectures §Two-tier architecture: E. g. client programs using ODBC/JDBC to communicate with a Application Architectures §Two-tier architecture: E. g. client programs using ODBC/JDBC to communicate with a database §Three-tier architecture: E. g. web-based applications, and applications built using “middleware” Database System Concepts 1. 24

History n It is closely related to the history of storage mediums from punched History n It is closely related to the history of storage mediums from punched cards to hard disks; also related to data models from early network or hierarchical model to object oriented models. n 1950 s and early 1960 s: Magnetic tapes, punched cards are used as input medium. Output could be tape or punched card or printer. H Tapes are sequential, often main memory size is for lesser than the tape size. You need to write restricted programs which process at a time only a small quantity of data. n Late 1960 s and 1970 s: Hard disks. Random access. Allowed data structures to be stored on a disk. Network and hierarchical model of early databases is possible because of this. H A landmark paper by Codd [1970] defined the relational model and non-procedural ways of querying data in the relational model. H Codd won the prestigious Association of Computing Machinery Turing Award. Database System Concepts 1. 25

History n 1980 s: Hierarchical and network models dominated in late 1970 s, even History n 1980 s: Hierarchical and network models dominated in late 1970 s, even though relational model is academically insteresting. H This is because, hierarchical and network models are efficient (speed) than relational models H Situation changed with System R, a ground breaking project at IBM Research that developed techniques for construction of an efficient relational database system. H Initial commercial RDBMS came into picture: IBM DB 2, Oracle, Ingres, and DEC Rdb H 1980 s saw much research on parallel and distributed databases, as well as initial work on object-oriented databases. Database System Concepts 1. 26

History n Early 1990 s: Transaction processing capabilities H Tools for analyzing large amounts History n Early 1990 s: Transaction processing capabilities H Tools for analyzing large amounts of data n Late 1990 s: World Wide Web H High transaction processing rates H 24 X 7 working systems – no downtime even for maintenance. n Early 2000 s: H XML, XQuery new database technology. H Data warehousing, data mining tools Database System Concepts 1. 27