Unit 1

DBMS

Overview Of Database Systems

Database System Applications  DBMS contains information about a particular enterprise  Collection of interrelated data  Set of programs to access the data  An environment that is both convenient and efficient to use  Database Applications:  Banking: all transactions  Airlines: reservations, schedules  Universities: registration, grades  Sales: customers, products, purchases  Online retailers: order tracking, customized recommendations  Manufacturing: production, inventory, orders, supply chain  Human resources: employee records, salaries, tax deductions  Databases touch all aspects of our lives

What Is a DBMS?  A very large, integrated collection of data.  Models real-world enterprise.  Entities (e.g., students, courses)  Relationships (e.g., Madonna is taking CS564)  A Database Management System (DBMS) is a software package designed to store and manage databases.

Why Use a DBMS?     

Data independence and efficient access. Reduced application development time. Data integrity and security. Uniform data administration. Concurrent access, recovery from crashes.

Why Study Databases??  Shift from computation to information  at the “low end”: scramble to webspace (a mess!)  at the “high end”: scientific applications  Datasets increasing in diversity and volume.

1

Unit 1

DBMS

Overview Of Database Systems

 Digital libraries, interactive video, Human Genome project, EOS project  ... need for DBMS exploding  DBMS encompasses most of CS  OS, languages, theory, AI, multimedia, logic

Files vs. DBMS  Application must stage large datasets between main memory and secondary storage (e.g., buffering, page-oriented access, 32-bit addressing, etc.)  Special code for different queries  Must protect data from inconsistency due to multiple concurrent users  Crash recovery  Security and access control

Purpose of Database Systems  In the early days, database applications were built directly on top of file systems  Drawbacks of using file systems to store data:  Data redundancy and inconsistency  Multiple file formats, duplication of information in different files  Difficulty in accessing data  Need to write a new program to carry out each new task  Data isolation — multiple files and formats  Integrity problems  Integrity constraints (e.g. account balance > 0) become “buried” in program code rather than being stated explicitly  Hard to add new constraints or change existing ones  Atomicity of updates  Failures may leave database in an inconsistent state with partial updates carried out  Example: Transfer of funds from one account to another should either complete or not happen at all  Concurrent access by multiple users  Concurrent accessed needed for performance  Uncontrolled concurrent accesses can lead to inconsistencies

2

Unit 1

DBMS

Overview Of Database Systems

 Example: Two people reading a balance and updating it at the same time  Security problems  Hard to provide user access to some, but not all, data  Database systems offer solutions to all the above problems

Levels of Abstraction  Physical level: describes how a record (e.g., customer) is stored.  Logical level: describes data stored in database, and the relationships among the data. type customer = record customer_id : string; customer_name : string; customer_street : string; customer_city : string; end;  View level: application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes

Summary  DBMS used to maintain, query large datasets.  Benefits include recovery from system crashes, concurrent access, quick application development, data integrity and security.  Levels of abstraction give data independence.  A DBMS typically has a layered architecture.  DBAs hold responsible jobs and are well-paid!  DBMS R&D is one of the broadest, most exciting areas in CS.

3

Unit 1

DBMS

Overview Of Database Systems

View of Data  An architecture for a database system view level view 1

view 2

...

view n

logical view physical view

Instances and Schemas  Similar to types and variables in programming languages  Schema – the logical structure of the database  Example: The database consists of information about a set of customers and accounts and the relationship between them)  Analogous to type information of a variable in a program  Physical schema: database design at the physical level  Logical schema: database design at the logical level  Instance – the actual content of the database at a particular point in time  Analogous to the value of a variable  Physical Data Independence – the ability to modify the physical schema without changing the logical schema  Applications depend on the logical schema  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.

4

Unit 1

DBMS

Overview Of Database Systems

Data Models  A collection of tools for describing  Data  Data relationships  Data semantics  Data constraints  Relational model  Entity-Relationship data model (mainly for database design)  Object-based data models (Object-oriented and Object-relational)  Semi structured data model (XML)  Other older models:  Network model  Hierarchical model

Data Models  A data model is a collection of concepts for describing data.  A schema is a description of a particular collection of data, using the a given data model.  The relational model of data is the most widely used model today.  Main concept: relation, basically a table with rows and columns.  Every relation has a schema, which describes the columns, or fields.

Example: University Database  Conceptual schema:  Students(sid: string, name: string, login: string, age: integer,

gpa: real)  Courses(cid: string, cname: string, credits: integer)  Enrolled(sid: string, cid:string, grade: string)  Physical schema:  Relations stored as unordered files.  Index on first column of Students.  External Schema (View):  Course_info(cid: string, enrollment: integer)

Data Independence  Applications insulated from how data is structured and stored.  Logical data independence: Protection from changes in logical

5

Unit 1

DBMS

Overview Of Database Systems

structure of data.  Physical data independence: Protection from changes in physical structure of data.

DATA BASE LANGUAGE Data Manipulation Language (DML)  Language for accessing and manipulating the data organized by the appropriate data model  DML also known as query language  Two classes of languages  Procedural – user specifies what data is required and how to get those data  Declarative (nonprocedural) – user specifies what data is required without specifying how to get those data  SQL is the most widely used query language

Data Definition Language (DDL)  Specification notation for defining the database schema Example: create table account ( account_number char(10), branch_name char(10), balance integer)  DDL compiler generates a set of tables stored in a data dictionary  Data dictionary contains metadata (i.e., data about data)  Database schema  Data storage and definition language  Specifies the storage structure and access methods used  Integrity constraints  Domain constraints  Referential integrity (e.g. branch_name must correspond to a valid branch in the branch table)  Authorization

6

Unit 1

DBMS

Overview Of Database Systems

Relational Model Attributes

 Example of tabular data in the relational model

customer_id 192-83-7465 192-83-7465 677-89-9011 182-73-6091 321-12-3123 336-66-9999 019-28-3746

customer_name customer_street customer_city account_number Johnson Johnson Hayes Turner Jones Lindsay Smith

12 Alma St. 12 Alma St. 3 Main St. 123 Putnam St. 100 Main St. 175 Park Ave. 72 North St.

Palo Alto Palo Alto Harrison Stamford Harrison Pittsfield Rye

A-101 A-201 A-102 A-305 A-217 A-222 A-201

A Sample Relational Database customer_id 192-83-7465 677-89-9011 182-73-6091 321-12-3123 336-66-9999 019-28-3746

customer_name customer_street customer_city Johnson 12 Alma St. Hayes 3 Main St. Turner 123 Putnam St. Jones 100 Main St. Lindsay 175 Park Ave. Smith 72 North St. (a)The customer table

account_number

balance

A-101 A-201 A-102 A-305 A-217 A-222 A-201 (b) The account table

500 700 400 350 900 750 700

customer_id

account_number

192-83-7465 192-83-7465 677-89-9011 182-73-6091

A-101 A-201 A-102 A-305

7

Palo Alto Harrison Stamford Harrison Pittsfield Rye

Unit 1

DBMS

Overview Of Database Systems

321-12-3123 A-217 336-66-9999 A-222 019-28-3746 A-201 (c)The depositor table

SQL  SQL: widely used non-procedural language  Example: Find the name of the customer with customer-id 192-83-7465 select customer.customer_name from customer where customer.customer_id = ‘192-83-7465’  Example: 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.account_number  Application programs generally access databases through one of  Language extensions to allow embedded SQL  Application program interface (e.g., ODBC/JDBC) which allow SQL queries to be sent to a database

Database Users  Users are differentiated by the way they expect to interact with the system  Application programmers – interact with system through DML calls  Sophisticated users – form requests in a database query language  Specialized users – write specialized database applications that do not fit into the traditional data processing framework  Naïve users – invoke one of the permanent application programs that have been written previously  Examples: people accessing database over the web, bank tellers, clerical staff

8

Unit 1

DBMS

Overview Of Database Systems

Database Administrator  Coordinates all the activities of the database system has a good understanding of the enterprise’s information resources and needs.  Database administrator's duties include:  Storage structure and access method definition  Schema and physical organization modification  Granting users authority to access the database  Backing up data  Monitoring performance and responding to changes  Database tuning

Data storage and Querying  Storage management  Query processing  Transaction processing

Storage Management  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.  The storage manager is responsible to the following tasks:  Interaction with the file manager  Efficient storing, retrieving and updating of data  Issues:  Storage access  File organization  Indexing and hashing

Query Processing 1. Parsing and translation 2. Optimization 3. Evaluation

9

Unit 1

query 

DBMS

parser and translator

Overview Of Database Systems

relational algebra expression

optimizer

query output

evaluation engine

execution plan

statistics about data

data

 Alternative ways of evaluating a given query  Equivalent expressions  Different algorithms for each operation  Cost difference between a good and a bad way of evaluating a query can be enormous  Need to estimate the cost of operations  Depends critically on statistical information about relations which the database must maintain  Need to estimate statistics for intermediate results to compute cost of complex expressions

Transaction Management  A transaction is a collection of operations that performs a single logical function in a database application  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.  Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database.

10

Unit 1

DBMS

Overview Of Database Systems

Database Architecture  The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running:  Centralized  Client-server  Parallel (multiple processors and disks)  Distributed

Database Application Architecture user

user client

application

application client

network

network

application server database system

server database system

b) three-tier architecture

a) two-tier architecture

Old

Modern

11

Unit 1

DBMS

Overview Of Database Systems

Overall System Structure native users(tellers, agents, web-users

use

application programmers

sophisticated users(analysts)

write

application interfaces

use

application programs

use

query tools

compiler and interpreter

DML Queries

application program object code

administratio n tools

DDL Interpreter

DML Compiler and organizer query evaluation engine

buffer manager

database administrator

file manager

query processor

authorization and integrity manager

transaction manager storage manager

disk storage indices data

data dictionary statistical data

12

Unit 1

DBMS

Overview Of Database Systems

For more e-books, materials and previous papers visit http://www.crazycodersoflits.wordpress.com

13

unit 1.pdf

need for DBMS exploding. DBMS encompasses most of CS. OS, languages, theory, AI, multimedia, logic. Files vs. DBMS. Application must stage large ...

705KB Sizes 0 Downloads 239 Views

Recommend Documents

Unit Type Unit Charter Organization Unit Leader Unit Leader Phone ...
Unit Leader E-mail. Boy Scout Troop. 152. First United Methodist Church, ... Keith Hanselman. 330-929-6679 [email protected]. Boy Scout Troop.

Nonfiction Unit
First… what do these things mean? Think of two things: the definition and why it might be important in analyzing and evaluating a nonfiction piece of writing.

UNIT - noorulfaisal
ii) Explain the software tools in designing of an embedded system. (8). UNIT-II. DEVICES ... Give any 3 examples of advanced serial high speed buses. 14. What is ISA ... ISRs, OS functions and tasks for resource management. (16). 4. i)Explain ...

UNIT - noorulfaisal
Give any two uses of timer devices. 10. What is I. 2. C Bus? ... Explain the timer and counting devices. (16) ... Explain the optimization of memory codes. (16). 6.

Item Vendor Unit size Units Unit cost Unit + tax Need credit card To ...
Unit + tax. Need credit card. To reimburse. Comment. Friday Morning. Coffee. Espresso Royale. 10 gal. 4. $60.00. $240.00. To be paid on delivery Fri AM. Tea.

unit 1 first impressions -- unit test
My mother says that I am a 1__________because I am very messy and don't follow any rules, but I am not a 2___________ boy. I know that I have to centre ...

UNIT-1 - PDFKUL.COM
If P is a permutation matrix of order 5 x 5, why is P6 = I? Also find a non-zero vector x so that (I – P)x = 0. 30. Solve using Gauss-Jordan method: 1 a b. 1. 0. 0. 0. 1.

Multiple heads cutting unit
Mar 22, 1999 - incises and goes though the leather, the skin or the synthetic material, obtaining the half-?nished product in the shape and. siZe desired. During the outlet of the Water jet, the head,. Which stands above the Work top, is continuously

UNIT 4 REVIEW
2 mol Al x. 2. 3. 1 mol Cr O. 26.98 g Al. 1 mol Al x. 7.10 g Al. = mass of Al(s) required to have a 20% excess = 120% 7.10 g 8.52 g x. = Part 2. (Pages 350–351).

unit-2diff.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. unit-2diff.pdf.Missing:

UNIT II -
Mercantile Transactions Using Credit. Cards. • Two major components compromise credit card transactions in this process: electronic authorization and ...

Unit 17 - eGyanKosh
Management is not only interested in the historical cost ... course of action. ... Decision: If company reduces the selling price by 5% then it requires 429 pens ...

UNIT 3 - eGyanKosh
the capital is bound to change correspondingly. It is totally based on Double Entry. System principles. The effect of transactions on Accounting Equation. 1. ... information. The procedure for large number is followed for a form, which is called the

unit 1_NoRestriction.pdf
s -pnd-e*A .bd brr, .d-e,v.A po!" L - .{ r."lt = (rvxr)ds. 1;. - J- 1. i- Lr;tr+-i " .... unit 1_NoRestriction.pdf. unit 1_NoRestriction.pdf. Open. Extract. Open with. Sign In.

Unit 3 - eGyanKosh
technology has evolved in business applications for the process of strategic ... One of the major advantages a data warehouse offers is that it allows a large ...

UNIT 6 | Celebrations - encarnara
ljlt'litllfln'l have bt't'l'tcould I be] better - they played great music, and everyone danced until 3.00! By the ... There may is a solution to this problem. -T“."L".-) qu.

Unit 17 - eGyanKosh
study the importance of relevant costs for decision making. .... With the help of the following data, a manufacturer seeks your advice whether to buy an item from ...

UNIT 3 - eGyanKosh
Assets = Total Claims. Assets = Liabilities + Capital. If there is any change in the amount of assets, or of the liability, the owner‟s claim or the capital is bound to change correspondingly. It is totally based on Double Entry. System principles.

UNIT 9 - eGyanKosh
Probe Pricing: This method of pricing is followed to probe the reaction qf the customers particularly when not much of information is available about the overseas market conditions. Pmforma Invoice: The Proforma Invoice gives a11 those details as are

Unit 3 - eGyanKosh
The data warehousing, online analytical processing (OLAP) and data ... For example, an electric billing company, by analysing data of a data warehouse can.

Unit 7 Adjectives
15. The jeans are ripped. ... “They taste so bitter,” the Not-so-big One said, “you have to cover them with sugar before you can eat ... “You get bigger helpings.”.

unit 2_NoRestriction.pdf
Page 3 of 48. unit 2_NoRestriction.pdf. unit 2_NoRestriction.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying unit 2_NoRestriction.pdf.

unit 1_NoRestriction.pdf
Define CDMA? Code Division Multiple Access systems use codes with certain characteristic to. sepamte different users. To enable access to the shared medium ...

UNIT-II.pdf
Requirements Gathering. If the project is to automate some existing procedures. e.g., automating existing manual accounting activities,. the task of the system ...