2. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
About Us
Author: Algae Services
Have Decade of experience in Corporate Training Classroom
sessions in different streams of Technology.
• Expertise in Big Data, ERP, Business Process Engineering,
Database Technologies, Spread sheet modeling.
• Worked with top service and product companies like
Wipro , Volvo , TVS , TEG ANALYTICS, General Electrics ,
Royal Bank of Scotland , Verizon etc.
• Worked with Universities like Jain University , RGTU,
Praxis, LMS Pro-School.
www.algaeservices.co.in2
3. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
What is Database
• A Database is a collection of related data
organized in a way that data can be easily
accessed, managed and updated.
• Any piece of information can be a data
Example name of your school.
• Database is actually a place where related piece
of information is stored and various operations
can be performed on it.
www.algaeservices.co.in
4. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
What is DBMS
• A DBMS is a software that allows creation, definition and manipulation
of database.
• DBMS is actually a tool used to perform any kind of operation on data
in database.
• DBMS also provides protection and security to database.
• It maintains data consistency in case of multiple users.
Examples:
• MySql
• Oracle
• Sybase
• Microsoft Access
• IBM DB2
www.algaeservices.co.in
5. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Historical Perspective
Early 1960s
Integrated data store, first general-purpose DBMS designed by Charles Bachman at GE
Formed basis for network data model later
Bachman received Turing Award in 1973 for his work in database area
Late 1960s
IBM developed Information Management System (IMS), used even today in many major installations
IMS formed the basis for hierarchical data model
American Airlines and IBM jointly developed SABRE for making airline reservations
1970
Edgar Codd, at IBM’s San Jose Research Laboratory, proposed relational data model.
It sparked the rapid development of several DBMSs based on relational model, along with a rich body of
theoretical results that placed the field on a firm foundation.
Codd won 1981 Turing Award.
Database systems matured as an academic discipline
The benefits of DBMS were widely recognized, and the use of DBMSs for managing corporate data became
standard practice.
www.algaeservices.co.in
6. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Historical Perspective (Cont.)
1980s
Relational data model consolidated its position as dominant DBMS paradigm, and database systems continued to
gain widespread use
SQL query language, developed as part of IBM’s System R project, is now the standard query language
SQL was standardized in late 1980s, and current standard SQL:1999 was adopted by ANSI and ISO
Late 1980s till 1990s
Considerable research into more powerful query language and richer data model, with emphasis on supporting
complex analysis of data from all parts of an enterprise
Several vendors, e.g., IBM’s DB2, Oracle 8, Informix UDS, extended their systems with the ability to store new data
types such as images and text, and to ask more complex queries
Data warehouses have been developed by many vendors to consolidate data from several databases, and for
carrying out specialized analysis
www.algaeservices.co.in
7. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
DBMS Data Model
• A Database model defines the logical design of data.
• The model describes the relationships between
different parts of the data.
• Historically, in database design, three models are
commonly used. They are,
1. Hierarchical Model
2. Network Model
3. Relational Model
www.algaeservices.co.in
9. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Network Model
• The network database model was invented by
Charles Bachman in 1969 as an enhancement of
the already existing database model, the
hierarchical database model.
• Because the hierarchical database model was
highly flaw, Bachman decided to create a
database that is similar to the hierarchical
database but with more flexibility and less
defaults.
• The original and existing hierarchical database
has one owner file linked strictly to one member
file, creating a ladder affect that restricted the
database to find relationships outside of its
category.
• In the network model, entities are organized in a
graph, in which some entities can be accessed
through several path
www.algaeservices.co.in
11. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Structured vs. Unstructured Data
High maintenance costs
Data Redundancy: The same data will be represented multiple times in the file
Data dependence: If you change things about the file format then there will be expensive changes
to programs that use it
Ensuring data consistency and controlling access to the data is difficult (i.e. you cannot finely
control multi-user access to the file)
THE PROBLEM WITH UNSTRUCTURED DATA
Flat file = unstructured data
Database = structured data
www.algaeservices.co.in
12. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Advantages and Disadvantages of Network Model
• Advantages of a Network Database Model
1. Because it has the many-many relationship, network database
model can easily be accessed in any table record in the
database
2. For more complex data, it is easier to use because of the
multiple relationship founded among its data
3. Easier to navigate and search for information because of its
flexibility
• Disadvantage of a Network Database Model
1. Difficult for first time users
2. Difficulties with alterations of the database because when
information entered can alter the entire database
www.algaeservices.co.in
13. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Difference Between Network and Hierarchical models
#
Network Database Model Hierarchical Database Model
1
Many-to-many relationship One-to-many relationship
2
Easily accessed because of the linkage between the
information
Difficult to navigate because of its strict owner to
member connection
3
Great flexibility among the information files because
the multiple relationships among the files
Less flexibility with the collection of information
because of the hierarchical position of the files
www.algaeservices.co.in
15. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
What is RDBMS
• RDBMS stands for Relational Database Management
Systems
• It is called Relational Data Base Management System
(RDBMS) because it is based on relational model
introduced by E.F. Codd.
• In RDBMS data is represented in terms of tuples (rows).
• Due to a collection of organized set of tables, data can be
accessed easily in RDBMS.
• Relational database is most commonly used database.
• It contains number of tables and each table has its own
primary key.
www.algaeservices.co.in
17. http://tutorials.algaeservice.com/
LEVELS OF ABSTRACTION
Abstraction means hide all but the relevant data about an object in order to reduce complexity and increase
efficiency. Three types 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
name : string;
street : string;
city : integer;
end;
View level: application programs hide details of data types. Views can also hide information (e.g., salary) for
security purposes.
www.algaeservices.co.in
19. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Difference Between DBMS and RDBMS
# DBMS RDBMS
1) DBMS applications store data as file. RDBMS applications store data in a tabular form.
2)
In DBMS, data is generally stored in either a hierarchical form or a
navigational form.
In RDBMS, the tables have an identifier called primary key and the
data values are stored in the form of tables.
3) Normalization is not present in DBMS. Normalization is present in RDBMS.
4)
DBMS does not apply any security with regards to data
manipulation.
RDBMS defines the integrity constraint for the purpose of ACID
(Atomocity, Consistency, Isolation and Durability) property.
5)
DBMS uses file system to store data, so there will be no relation
between the tables.
in RDBMS, data values are stored in the form of tables, so
a relationship between these data values will be stored in the form of
a table as well.
6)
DBMS has to provide some uniform methods to access the stored
information.
RDBMS system supports a tabular structure of the data and a
relationship between them to access the stored information.
7) DBMS does not support distributed database. RDBMS supports distributed database.
8)
DBMS is meant to be for small organization and deal with small
data. it supports single user.
RDBMS is designed to handle large amount of data. it
supports multiple users.
9) Examples of DBMS are file systems, xml etc. Example of RDBMS are mysql, postgre, sql server, oracle etc.
www.algaeservices.co.in
20. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Drawbacks of using file systems
In the early days, database applications were built on top of file systems but there were lot of drawbacks
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 part of program code
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
E.g. 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
E.g. two people reading a balance and updating it at the same time
Security problems
www.algaeservices.co.in
21. http://tutorials.algaeservice.com/
SCHEMAS
Similar to types and variables in programming languages
Schema – the logical structure of the database
e.g., 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
www.algaeservices.co.in
22. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Why is the data model so important?
• We generally settle for a design that “does the job” even though we
recognize that with more time and effort we might be able to develop a
more elegant solution.
• Reasons:
– LEVERAGE
• A small change in the data model may have a major impact on the system as a whole.
• Programs and applications using the database are heavily influenced by the database design
(i.e. the data model).
• A well-designed data model can make the development of programs and applications
simpler and easier.
• Poor data organization can be very expensive to fix.
– CONCISENESS
• A data model is a very powerful tool for expressing the heart of the information systems
requirements and capabilities.
– DATA QUALITY
• Data held in a database is almost always a valuable asset that is built up over time.
• Poor data quality (inaccurate data) reduces the asset value and can be expensive or
impossible to correct.
• The data model is important in achieving good data quality because it defines
www.algaeservices.co.in
23. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
• How does this model support the sound overall system design and meets the business requirements?
– COMPLETENESS
• Does the model support all the necessary data?
– NONREDUNDANCY
• Does the model specify a database in which the same fact could be recorded more than once?
– ENFORCEMENT OF BUSINESS RULES
– DATA REUSABILITY
• Will the data stored in the database be reusable for purposes beyond those anticipated in the present process model?
• If data has been organized with one particular application in mind, it is often difficult to use for other purposes.
– STABILITY AND FLEXIBILITY
• How well will the model cope with possible changes to the business requirements?
• A data model is stable when, in the face of change to requirements, we do not need to modify it.
• A data model is flexible when it can be readily extended to accommodate new requirements with minimal impact on the existing
structure.
– ELEGANCE
• Does the data model provide a reasonably neat and simple classification of the data?
– COMMUNICATION
• Does the data model represent the concepts that the users who are familiar with it and can easily verify?
• Will programmers interpret the model correctly?
– INTEGRATION
• How will the database fit into the organization’s existing databases? How many other databases hold similar data?
WHAT MAKES A GOOD DATA MODEL? (CONT’D)
www.algaeservices.co.in
24. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Performance
• Why is performance not in the list of quality criteria?
– Performance differs from our other criteria because it
depends heavily on the software and hardware platforms
on which the database will run.
– Exploiting the capabilities of the hardware and software is a
technical task quite different from the modeling activity.
– The usual and recommended procedure is to develop the
data model without considering performance, then attempt
to implement it with the available hardware and software.
www.algaeservices.co.in
25. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Data Definition Language (DDL)
• Specification notation for defining the database schema
– E.g.
create table account (
account-number 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
• Language in which the storage structure and access methods used by the database system are specified
• Usually an extension of the data definition language
• Commands
– CREATE TABLE
– CREATE INDEX
– ALTER TABLE
– RENAME TABLE
– DROP TABLE
– DROP INDEX
www.algaeservices.co.in
26. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
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
– Nonprocedural – user specifies what data is required without specifying how
to get those data
– Commands
– SELECT - Retrieve data from the a database
– INSERT - Insert data into a table
– UPDATE - Updates existing data within a table
– DELETE - deletes all records from a table, the space for the records remain
www.algaeservices.co.in
27. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
SQL
• SQL: widely used non-procedural language
– E.g. 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’
– 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.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
www.algaeservices.co.in
28. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
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
– E.g. people accessing database over the web, bank tellers, clerical
staff
www.algaeservices.co.in
29. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
Database Administrator
• Coordinates all the activities of the database system; the
database administrator has a good understanding of the
enterprise’s information resources and needs.
• Database administrator's duties include:
– Schema definition
– Storage structure and access method definition
– Schema and physical organization modification
– Granting user authority to access the database
– Specifying integrity constraints
– Acting as liaison with users
– Monitoring performance and responding to changes in requirements
www.algaeservices.co.in
32. http://tutorials.algaeservice.com/http://tutorials.algaeservice.com/
About Us
Author: Algae Services
Have Decade of experience in Corporate Training Classroom
sessions in different streams of Technology.
• Expertise in Big Data, ERP, Business Process Engineering,
Database Technologies, Spread sheet modeling.
• Worked with top service and product companies like
Wipro , Volvo , TVS , TEG ANALYTICS, General Electrics ,
Royal Bank of Scotland , Verizon etc.
• Worked with Universities like Jain University , RGTU,
Praxis, LMS Pro-School.
www.algaeservices.co.in