Data
 The fact and figures that can be recorded in system
and that have some special meaning assigned to it.
 Eg- Data of a customer is name ,telephone number ,
address,product purchased etc.
Database
 A database is a collection of related data items stored
at one place.
 Eg- College database stores information about
students ,teachers,classes,subjects(All related data).
 A database is nothing but set of data having some
relation between them.
Sample Database Structure
 Student Table
Sid Name Class Major
Course Table
Cid Name Hours
Department Table
Did Name
Marks Table
Sid Cid Marks Grade
Database Management System (DBMS)
 DBMS is a software system that helps in the process
of defining,constructing ,manipulating the database.
 It is also known as computerized record-keeping
system.
 DBMS have become an integral part of the information
system of many organizations as it is used to handle
huge amount of data.
Need of data in Database system
 Nowadays data have become an integral part of the
information systems of many organizations , so it is very
important to manage data in system.
 Data- As a corporate resource
Data management and control is very important for to the
efficient working of the organization.
 Data Availability
As most of the organizational functions are computerized
.Hence it increases the need to keep data available for user
 Maintaining Complex data
As complexity of the data grows complex relationships
between them need to be managed in simpler way.
 Data independence and efficient access.
 Data integrity and security.
 Concurrent access, recovery from crashes.
Benefits of
Database System over File System
1. Redundancy can be reduced
 As we are using relational approach for data
organization ,data is not stored at more than one
location.
 Repetition of information can be avoided which in
turn saves storage space.
2. Inconsistency can be avoided
 With the usage of database ,it is assured that all the
users access actual or true data present in the
database.
3. Data can be shared
 Multiple users can login at a time into the database to
access information.
 They can manipulate the database in a controlled
environment.
4. Security restrictions can be applied
 Security is the process of limiting access to the
database server itself for some users.
5. Integrity can be maintained
 Through integrity ,one can ensure only accurate data is
stored within the database.
Database Architecture
External View 1
SNo Lname Branch
No
External View 2
SNo Fname Lname Age Salary
Conceptual Model
SNo Fname Lname Age Salary BranchNo
Internal View
Create table Employee
(
Sno number,
Fname varchar(50),
Lname varchar(50),
Age number ,
Salary number,
BranchNo number
)
Database Scheme levels
Schema
 A description of data in terms of a data model is called
a schema.
 The description of a database is called database
schema , which is specified during database design
and it does not expected to change frequently.
Data Independence
1) Data Independence can be defined as the capacity to
change one level of scheme without changing the schema
at the next higher level.
2) Types :
a) Logical Data Independence
 Logical data independence is a capacity to change the
conceptual schema without having any changes to
external schema.
 Eg: We may change the conceptual schema by removing a
data item.In this case the external schemas that refer only
to the remaining data should not be affected.
b) Physical data independence
 Physical data independence is a capacity to change the
internal schema without having any changes to
conceptual schema.
 Eg: By creating additional access paths to improve the
performance of retrieval .If the same data as before
remains in the database ,we should not have to change
the conceptual schema.
Relational DBMS (RDBMS)
Introduction
 Was introduced by Dr. E.F.Codd in 1970 .
 Standard for relational databases is published by
ANSI(the American National Standard Institute)
Features
 A relational database is composed of many relations in
the form of two-dimensional tables of rows and columns
containing related tuples known as logical view.
 Tables/Relations are a logical structure which is a
collection of 2-dimensional tables consists of horizantal
rows and vertical columns.
Advantages
 Use of OOPs concept
 Highly secured data.
 Multiple users can access which is not possible in
simple DBMS.
 Supports Data Independence.
Disadvantages
 Inability to handle application areas like spatial
databases(eg-CAD) ,applications involving images etc.
Transaction Management
 A transaction is a series of small database operations
that together form a single large operation.
 A transaction is started by issuing a BEGIN
TRANSACTION command.
 Once this command is executed the DBMS starts
monitoring the transaction.
Properties of Transaction
Atomicity
 If one part of the transaction fails,the entire
transaction fails and the database state is left
unchanged.
 Database modification must follow an “all or nothing”
rule.
Consistency
 Ensure the database is clean at the end of the
transaction .
 Ensures that any transaction that the database
performs will take it from one consistent state to
another.
Isolation
 Each transaction must remain unaware of other
concurrently executing transaction.
Durability
 Ability of the DBMS to recover the committed transaction
updates against any kind of system failure(hardware or
software).
 Application programs use transaction to execute
sequences of operations when it is important that all the
operations are successfully completed.
 Eg During the transfer of money between two bank
accounts it is unacceptable for the operation that updates
the second account to fail.This would lead to the
transferred money being lost.It will have been withdrawn
from one account but not inserted into the second
account.
BEGIN TRANSACTION transfer
Deduct Rs.100 from account A
Add Rs.100 to account B
If no errors then
Save changes made by this operation
Else
Delete changes made by this operation
End If
END TRANSACTION transfer

Introduction To Database.ppt

  • 2.
    Data  The factand figures that can be recorded in system and that have some special meaning assigned to it.  Eg- Data of a customer is name ,telephone number , address,product purchased etc.
  • 3.
    Database  A databaseis a collection of related data items stored at one place.  Eg- College database stores information about students ,teachers,classes,subjects(All related data).  A database is nothing but set of data having some relation between them.
  • 4.
    Sample Database Structure Student Table Sid Name Class Major Course Table Cid Name Hours Department Table Did Name Marks Table Sid Cid Marks Grade
  • 5.
    Database Management System(DBMS)  DBMS is a software system that helps in the process of defining,constructing ,manipulating the database.  It is also known as computerized record-keeping system.  DBMS have become an integral part of the information system of many organizations as it is used to handle huge amount of data.
  • 6.
    Need of datain Database system  Nowadays data have become an integral part of the information systems of many organizations , so it is very important to manage data in system.  Data- As a corporate resource Data management and control is very important for to the efficient working of the organization.  Data Availability As most of the organizational functions are computerized .Hence it increases the need to keep data available for user
  • 7.
     Maintaining Complexdata As complexity of the data grows complex relationships between them need to be managed in simpler way.  Data independence and efficient access.  Data integrity and security.  Concurrent access, recovery from crashes.
  • 8.
    Benefits of Database Systemover File System 1. Redundancy can be reduced  As we are using relational approach for data organization ,data is not stored at more than one location.  Repetition of information can be avoided which in turn saves storage space. 2. Inconsistency can be avoided  With the usage of database ,it is assured that all the users access actual or true data present in the database.
  • 9.
    3. Data canbe shared  Multiple users can login at a time into the database to access information.  They can manipulate the database in a controlled environment. 4. Security restrictions can be applied  Security is the process of limiting access to the database server itself for some users. 5. Integrity can be maintained  Through integrity ,one can ensure only accurate data is stored within the database.
  • 10.
    Database Architecture External View1 SNo Lname Branch No External View 2 SNo Fname Lname Age Salary Conceptual Model SNo Fname Lname Age Salary BranchNo Internal View Create table Employee ( Sno number, Fname varchar(50), Lname varchar(50), Age number , Salary number, BranchNo number ) Database Scheme levels
  • 11.
    Schema  A descriptionof data in terms of a data model is called a schema.  The description of a database is called database schema , which is specified during database design and it does not expected to change frequently.
  • 12.
    Data Independence 1) DataIndependence can be defined as the capacity to change one level of scheme without changing the schema at the next higher level. 2) Types : a) Logical Data Independence  Logical data independence is a capacity to change the conceptual schema without having any changes to external schema.  Eg: We may change the conceptual schema by removing a data item.In this case the external schemas that refer only to the remaining data should not be affected.
  • 13.
    b) Physical dataindependence  Physical data independence is a capacity to change the internal schema without having any changes to conceptual schema.  Eg: By creating additional access paths to improve the performance of retrieval .If the same data as before remains in the database ,we should not have to change the conceptual schema.
  • 14.
    Relational DBMS (RDBMS) Introduction Was introduced by Dr. E.F.Codd in 1970 .  Standard for relational databases is published by ANSI(the American National Standard Institute) Features  A relational database is composed of many relations in the form of two-dimensional tables of rows and columns containing related tuples known as logical view.  Tables/Relations are a logical structure which is a collection of 2-dimensional tables consists of horizantal rows and vertical columns.
  • 15.
    Advantages  Use ofOOPs concept  Highly secured data.  Multiple users can access which is not possible in simple DBMS.  Supports Data Independence. Disadvantages  Inability to handle application areas like spatial databases(eg-CAD) ,applications involving images etc.
  • 16.
    Transaction Management  Atransaction is a series of small database operations that together form a single large operation.  A transaction is started by issuing a BEGIN TRANSACTION command.  Once this command is executed the DBMS starts monitoring the transaction.
  • 17.
    Properties of Transaction Atomicity If one part of the transaction fails,the entire transaction fails and the database state is left unchanged.  Database modification must follow an “all or nothing” rule. Consistency  Ensure the database is clean at the end of the transaction .  Ensures that any transaction that the database performs will take it from one consistent state to another.
  • 18.
    Isolation  Each transactionmust remain unaware of other concurrently executing transaction. Durability  Ability of the DBMS to recover the committed transaction updates against any kind of system failure(hardware or software).  Application programs use transaction to execute sequences of operations when it is important that all the operations are successfully completed.  Eg During the transfer of money between two bank accounts it is unacceptable for the operation that updates the second account to fail.This would lead to the transferred money being lost.It will have been withdrawn from one account but not inserted into the second account.
  • 19.
    BEGIN TRANSACTION transfer DeductRs.100 from account A Add Rs.100 to account B If no errors then Save changes made by this operation Else Delete changes made by this operation End If END TRANSACTION transfer