0% found this document useful (0 votes)
275 views

Database Concepts-Chapter1 PDF

The document discusses database management systems and their components. It describes how DBMSs store data in an organized way and provide tools to define data structures and relationships. It also explains how database languages allow users to access and manipulate the stored data, and how logical and physical schemas separate the conceptual design from physical storage.

Uploaded by

Anoj Suresh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
275 views

Database Concepts-Chapter1 PDF

The document discusses database management systems and their components. It describes how DBMSs store data in an organized way and provide tools to define data structures and relationships. It also explains how database languages allow users to access and manipulate the stored data, and how logical and physical schemas separate the conceptual design from physical storage.

Uploaded by

Anoj Suresh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

11/11/2014

 DBMS contains information about a particular enterprise


 Purpose of Database Systems ◦ Collection of interrelated data
 Database Languages ◦ Set of programs to access the data
◦ An environment that is both convenient and efficient to use
 Relational Databases  Database Applications:
 Database Design ◦ Banking: all transactions
 Data Models ◦ Airlines: reservations, schedules
◦ Universities: registration, grades
 Database Internals ◦ Sales: customers, products, purchases
 Database Users and Administrators ◦ Online retailers: order tracking, customized
 Overall Structure recommendations
◦ Manufacturing: production, inventory, orders, supply chain
 History of Database Systems ◦ Human resources: employee records, salaries, tax
deductions
 Databases touch all aspects of our lives

Prepared By Uthayakumar 1 Prepared By Uthayakumar 2

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

Prepared By Uthayakumar 3 Prepared By Uthayakumar 4

Physical level: describes how a record (e.g., customer) is stored.



An architecture for a database system
 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.

Prepared By Uthayakumar 5 Prepared By Uthayakumar 6

1
11/11/2014

 Similar to types and variables in programming languages  A collection of tools for describing
 Schema – the logical structure of the database ◦ Data
◦ Example: The database consists of information about a set of customers ◦ Data relationships
and accounts and the relationship between them) ◦ Data semantics
◦ Analogous to type information of a variable in a program ◦ Data constraints
◦ Physical schema: database design at the physical level  Relational model
◦ Logical schema: database design at the logical level  Entity-Relationship data model (mainly for database design)
 Instance – the actual content of the database at a particular point in time  Object-based data models (Object-oriented and Object-
◦ Analogous to the value of a variable relational)
Physical Data Independence – the ability to modify the physical schema

 Semistructured data model (XML)
without changing the logical schema
◦ Applications depend on the logical schema  Other older models:
◦ Network model
◦ In general, the interfaces between the various levels and components ◦ Hierarchical model
should be well defined so that changes in some parts do not seriously
influence others.

Prepared By Uthayakumar 7 Prepared By Uthayakumar 8

 Specification notation for defining the database schema


 Language for accessing and manipulating the data organized by the Example: create table account (
account_number char(10),
appropriate data model
branch_name char(10),
◦ DML also known as query language
balance integer)
 Two classes of languages  DDL compiler generates a set of tables stored in a data
◦ Procedural – user specifies what data is required and how to get dictionary
those data  Data dictionary contains metadata (i.e., data about data)
◦ Declarative (nonprocedural) – user specifies what data is required ◦ Database schema
without specifying how to get those data ◦ Data storage and definition language
 SQL is the most widely used query 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

Prepared By Uthayakumar 9 Prepared By Uthayakumar 10

Attributes
 Example of tabular data in the relational model

Prepared By Uthayakumar 11 Prepared By Uthayakumar 12

2
11/11/2014

 SQL: widely used non-procedural language The process of designing the general structure of the database:
◦ Example: Find the name of the customer with customer-id 192-83-
7465  Logical Design – Deciding on the database schema. Database
select customer.customer_name design requires that we find a “good” collection of relation
from customer schemas.
where customer.customer_id = ‘192-83-7465’ ◦ Business decision – What attributes should we record in the
◦ Example: Find the balances of all accounts held by the customer database?
with customer-id 192-83-7465 ◦ Computer Science decision – What relation schemas should we
select account.balance have and how should the attributes be distributed among the
from depositor, account various relation schemas?
where depositor.customer_id = ‘192-83-7465’ and
depositor.account_number = account.account_number
 Physical Design – Deciding on the physical layout of the database
 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

Prepared By Uthayakumar 13 Prepared By Uthayakumar 14

 Models an enterprise as a collection of entities and relationships  Object-oriented data model


◦ Entity: a “thing” or “object” in the enterprise that is distinguishable  Object-relational data model
from other objects
 Described by a set of attributes
◦ Relationship: an association among several entities
 Represented diagrammatically by an entity-relationship diagram:

Prepared By Uthayakumar 15 Prepared By Uthayakumar 16

 Storage management
 Query processing
 Transaction processing
(web browser)

Old Modern

Prepared By Uthayakumar 17 Prepared By Uthayakumar 18

3
11/11/2014

1. Parsing and translation


 Storage manager is a program module that provides the interface 2. Optimization
between the low-level data stored in the database and the 3. Evaluation
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

Prepared By Uthayakumar 19 Prepared By Uthayakumar 20

 Alternative ways of evaluating a given query  A transaction is a collection of operations that performs a
◦ Equivalent expressions single logical function in a database application
◦ Different algorithms for each operation  Transaction-management component ensures that the
 Cost difference between a good and a bad way of evaluating a database remains in a consistent (correct) state despite system
query can be enormous failures (e.g., power failures and operating system crashes) and
transaction failures.
 Need to estimate the cost of operations
◦ Depends critically on statistical information about relations  Concurrency-control manager controls the interaction among
which the database must maintain the concurrent transactions, to ensure the consistency of the
database.
◦ Need to estimate statistics for intermediate results to compute
cost of complex expressions

Prepared By Uthayakumar 21 Prepared By Uthayakumar 22

 1950s and early 1960s:


◦ Data processing using magnetic tapes for storage
 Tapes provide only sequential access
◦ Punched cards for input
 Late 1960s and 1970s:
◦ Hard disks allow direct access to data
◦ Network and hierarchical data models in widespread use
◦ Ted Codd defines the relational data model
 Would win the ACM Turing Award for this work
 IBM Research begins System R prototype
 UC Berkeley begins Ingres prototype
◦ High-performance (for the era) transaction processing

Prepared By Uthayakumar 23 Prepared By Uthayakumar 24

4
11/11/2014

 1980s: Users are differentiated by the way they expect to interact with
◦ Research relational prototypes evolve into commercial systems the system
 SQL becomes industry standard  Application programmers – interact with system through DML calls
◦ Parallel and distributed database systems
 Sophisticated users – form requests in a database query language
◦ Object-oriented database systems
 Specialized users – write specialized database applications that do
 1990s:
not fit into the traditional data processing framework
◦ Large decision support and data-mining applications
 Naïve users – invoke one of the permanent application programs
◦ Large multi-terabyte data warehouses
◦ Emergence of Web commerce that have been written previously
 2000s: ◦ Examples, people accessing database over the web, bank tellers,
◦ XML and XQuery standards clerical staff
◦ Automated database administration
◦ Increasing use of highly parallel database systems
◦ Web-scale distributed data storage systems

Prepared By Uthayakumar 25 Prepared By Uthayakumar 26

 Coordinates all the activities of the database system The architecture of a database systems is greatly influenced by
◦ has a good understanding of the enterprise’s information the underlying computer system on which the database is
resources and needs. running:
 Database administrator's duties include:  Centralized
◦ Storage structure and access method definition  Client-server
◦ Schema and physical organization modification  Parallel (multiple processors and disks)
◦ Granting users authority to access the database  Distributed
◦ Backing up data
◦ Monitoring performance and responding to changes
 Database tuning

Prepared By Uthayakumar 27 Prepared By Uthayakumar 28

 Extend the relational data model by including object orientation  Defined by the WWW Consortium (W3C)
and constructs to deal with added data types.  Originally intended as a document markup language not a
 Allow attributes of tuples to have complex types, including database language
non-atomic values such as nested relations.  The ability to specify new tags, and to create nested tag
 Preserve relational foundations, in particular the declarative structures made XML a great way to exchange data, not just
access to data, while extending modeling power. documents
 Provide upward compatibility with existing relational  XML has become the basis for all new generation data
languages. interchange formats.
 A wide variety of tools is available for parsing, browsing and
querying XML documents/data

Prepared By Uthayakumar 29 Prepared By Uthayakumar 30

5
11/11/2014

Prepared By Uthayakumar 31 Prepared By Uthayakumar 32

Prepared By Uthayakumar 33

You might also like