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

DBMS PART 1

The document provides an overview of database concepts, including the importance of databases in various applications such as banking, education, and telecommunications. It explains key components of databases, such as data types, data independence, and the roles of different users in database management. Additionally, it discusses the evolution of database systems, data processing cycles, and the architecture of database management systems (DBMS).

Uploaded by

akhil2024mm333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

DBMS PART 1

The document provides an overview of database concepts, including the importance of databases in various applications such as banking, education, and telecommunications. It explains key components of databases, such as data types, data independence, and the roles of different users in database management. Additionally, it discusses the evolution of database systems, data processing cycles, and the architecture of database management systems (DBMS).

Uploaded by

akhil2024mm333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

Database Concepts

By:- Naveen Kumar V


Database concepts

Database is the backbone of all the software's


•Standalone
•Client-server
•online
•Mainframe
•Supercomputers etc
• For example use in
• Business,
• Government agency,
• Service organization etc.
Wherever the data and information is required
• There the database software is used and the results are presented
in the form of reports or graphical representation.
The Fees payment software

Basic requirements for new student admission are


• Name,
• student id,
• admission no,
• father name,
• class,
• section,
• amount,
• date of entry into the school
• are entered and saved.

Some of the activities can be admission fees/annual fees,


monthly fees, late payment etc. created and the respective
reports are generated
APPLICATION OF DATABASE

1.Banking: For customer information, accounts, and loans, and


banking transactions.
2. Water meter billing : The RR number and all the details are
stored in the database and connected to the server based works.
3. Rail and Airlines: For reservations and schedule information.
Airlines were among the first to use databases in a geographically
distributed manner
4. Colleges : For student information, course registrations, and
grades.
5. Credit card transactions: For purchases on credit cards and
generation of monthly statements.
6. Telecommunication: For keeping records of calls made, generating
monthly bills, maintaining balances on prepaid calling cards, and
storing information about the communication networks.
7. Finance: For storing information about holdings, sales, and
purchases of financial instruments such as stocks and bonds.
8. Sales: For customer, product, and purchase information.
9. Manufacturing: For management of supply chain and for tracking
production of items in factories, inventories of items in warehouses.
10.Human resources: For information about employees recruitment,
salaries, payroll taxes and benefits, and for generation of pay checks.
Origin of data

• Data: Data is a collection of facts, figures, statistics, which can


be processed to produce meaningful information.
• First task :- fact to data Conversion
• The human intervention is mandatory for converting from fact
to data form.
Data: -Letters, numbers, symbols, images, sound, video etc
• Example :- marks obtained by the student is 80,
– 80 is the fact,
• On the marks card the 80 entered will be in numeric symbols
which is data.
• Information: Information is processed data with some
definite meaning.
• Information represents facts, figures, or statistics, which
have proper meaning.
• For example, In the marks card
– student total marks, percentage and the result are processed
data known as the information.
Different Data forms
Evolution of Database - Manual File systems

File management came into existence


• Manual:- paper-and-pencil systems.
System of file folders and filing cabinets.
Relatively small data and fewer reporting

More complex data and reporting


• Companies looked to computer technology
• Initially, the computer files within the file system were similar
to the manual files.
DATA PROCESSING CYCLE
• Data Preparation: Gathering data, facts and statistics required
for an organization which may be available at different stages.
• Data input: The mechanism of providing data into a data
processing system.
• Data processing: The processing is a series of action from the
input data to generate output.
• Some of the operations are:
Calculation, searching, sorting
• Data output: After all the above operations are performed, the
result should be put forward which helps in proper decision
making.
• Data storage: The results are stored in secondary storage for
future use.
Database concept

• Database: A Database is a collection of logically related


data organized in a way that data can be easily accessed,
managed and updated.

• File : It is a basic unit of storage which consists of


large collection of related data.

• Tables : In Relational database,


• A Table is collection of data elements organized in terms of
rows and columns.
• It’s a convenient representation of relations.
• Records: A single entry in a table is called a Record/Row.
• A Record in a table represents set of related data.
• Following is an example of single record.

• Tuple :Records are also called the tuple.


• Fields : Each Columns is identified by a distinct header called
attribute or field
• Domain : Set of values for an attribute in that column.
• Entity : -An object such as a table or Form.
• An Entity Relationship is how each table link to each other
DBMS-DATABASE MANAGEMENT SYSTEM

• A DBMS is a software that allows creation, definition and


manipulation of database.
• A tool used to perform any kind of operation on data in
database.
• It provides protection and security to database.
• It maintains data consistency in case of multiple users.
Popular DBMS Examples:-
• MySql, Oracle, Sybase, Microsoft Access and IBM DB2 etc.

The primary goal of a DBMS


• To provide a way to store and retrieve database information
that is both convenient and efficient.
Features of Database System(DBMS)

To the overcome of the drawbacks of file process in the


database approach,
“Data is stored at a central location and is shared
among multiple users”
• i.e centralized data management.
Advantages
• Controlled data redundancy: During database design, various
files are integrated and each logical data item is stored at
central location.
This eliminates replicating(duplication) and ensures consistency
and saves the storage space.
• Enforcing data integrity: In database approach, enforcing
data integrity is much easier.
Data integrity refers to the validity of data
Data integrity constraints can be enforced automatically
by the DBMS

• Data sharing: The data stored in the database can be shared


among multiple users or application programs.
New applications can be developed to use the same stored
data.
Ease of application development: Application programs
according to the users’ needs.
● The other issues like concurrent access, security, data
integrity, etc., are handled by the RDBMS itself.
● Hence makes the application development an easier task.

Data security: Since the data is stored centrally, enforcing


security constraints is much easier.
• The RDBMS ensures that the only means of access to the
database is through an authorized channel only.
• To ensure security, a RDBMS provides user codes and
passwords.
• Multiple user interfaces: In order to meet the needs of
various users having different technical knowledge,
• DBMS provides different types of interfaces such
 Query languages,
 Application program interfaces
 Graphical user interfaces
– include forms-style and menu-driven interfaces.
• Backup and recovery: The RDBMS provides backup and
recovery subsystem that is responsible for recovery from
hardware and software failures.
• For example, if the failure occurs in between the
transaction,
– the RDBMS recovery subsystem either reverts back the database to
the state which existed prior or resumes the transaction from the
point it was interrupted.
Different Layers of Database
Database Schema

• It is a logical representation of data that shows how the data in a


database should be stored logically.
– It shows how the data is organized and the relationship between the
tables.
– Database schema contains table, field, views and relation between
different keys like primary key, foreign key.
• Primary key :- Key used to uniquely identify the tuple of the
database.
• Foreign key :- It is a field (or collection of fields) in one table, that
refers to the primary key in another table.
• Its used to determine the relationship between the tables through the
primary key.
• Primary key of one table acts as a foreign key to another table.
Primary key and foreign key
In this example, the primary key of the EMPLOYEES table is used
as the foreign key of the SALES table:
Database schema
• It is the blueprint or design for the actual database structure
such as tables, columns, data types, and relationships.
Database instance
• A database instance consists of all the data actually stored at any
point in time within a database.
Difference between them
• Schema: A structure comprising definition, static.
• Instance: Dynamic, representing the current state of the data.
Data Abstraction

• The DBMS architecture describes how data in the database


is viewed by the users.
• It is not concerned with how the data is handled and
processed by the RDBMS.
• Database users are provided with an abstract view of the
data by hiding certain details of how data is physically
stored.
• This enables the users to manipulate the data without
worrying about where it is located or how it is actually
stored.
Three level RDBMS architecture/ANSI/SPARC
architecture.

• Internal/physical level
• Conceptual/logical level
• External levels /view level

Internal level: lowest level of data abstraction


•Deals with the physical representation(bits/byte)
•It describes how the data is physically stored and
organized on the storage medium.
• Trys to achieve optimal runtime performance and storage
space utilization.
Conceptual level: Abstraction deals with logical structure of the
entire Database .
• It describes what data is stored in the database, the
relationships among them.
• Complete view of the user’s requirements without
any concern for the physical implementation.
• It hides the complexity of physical storage structures.
• Provides overall view of the database and all related
information.
External level: Highest level of abstraction.
• Most of the users and application programs do not require the
entire data stored in the database.
• It describes a part of database for a particular group of users.
• It permits users to access data in a way that is customized
according to their needs
• The same data can be seen by different users in different ways,
at the same time.
• It provides a powerful and flexible security mechanism.
Three level RDBMS architecture/ANSI/SPARC
architecture.
Three level RDBMS architecture/ANSI/SPARC architecture.
DBMS users

1. Application programmers and system analysts


• System analysts determine the requirement of end users
• Develop specifications for transactions that meet these
requirements.
• Application programmers implement these into programs.
2. End users
 People who require access to the database for querying
updating and generating reports.
 The database exists primarily for/their use.
3. Database Administrator (DBA)
• Authorization access to the database for coordinating and
monitoring its use.
• Acquiring the needed software and hardware resources.
4. Database designers
• Responsible for identifying the data to be stored in the
database
• Choosing appropriate structures to represent and store the
data.
Data types of DBMS(Data types in DBMS)

1. Integer – Hold whole number without fractions.


2. Single and double precision – Seven significant value for a
number.
3. Logical data type- Store data that has only two values (true
or false)
4. Characters – Include letter, number, spaces, symbols and
punctuation.
Characters fields or variables store text information like
name, address, but size will be one byte.
5. Strings – Sequence of character more than one.
Fixed length is 0 to 63Kb and dynamic strings length range
from 0 to 2 billion characters.
6. Memo data type – Store more than 255 characters.
A memo fields can store up to 65536 characters.
Long documents can store OLE objects.
7. Index fields –Used to store relevant information along with the
documents.
The document input to an index field is used to find those
documents when needed.
Name drop-down look-up list, Standard, auto-complete History
list.
8. Currency fields – The currency field accepts data in dollar form by
default.
9. Date fields -The date fields accepts data entered in date format.
10. Text fields – Accepts data as an alpha-numeric text string.
Data Independence

• Data Independence: Ability of a database to modify a


schema definition at one level without affecting a schema in
the next higher level .
• (the ability to change the conceptual schema without
affecting the external schemas or application programs).
• When the schema is changed at one level, the schema at
next level remains unchanged and only the mapping
between the two levels is changed.

Two types of data independence are:


1. Physical Data Independence
2. Logical Data Independence
Data Independence
Data mapping:- It is the process of matching fields from one database to another.
It's the first step to facilitate data migration, data integration, and other data
management tasks
Two types of data independence:

Logical Data Independence Physical Data Independence


• It’s the characteristic of being The capacity to change the internal
able to change the conceptual schema without having to change
schema without having to the conceptual schema.
change the external schema. • If we do any changes in the
• Used to separate the external storage then the Conceptual
level from the conceptual structure of the database will
view.
not be affected.
• If we do any changes in the
• Used to separate conceptual
conceptual view of the data,
then the user view of the data levels from the internal levels.
would
. not be affected. • It occurs at the logical interface
• This happens at the user level.
interface level.
Physical Data independence

• All schemas are logical


• Actual data is stored in bit format on the disk.(HDD)

• System designs choose


– To organize, access and process records and files in different ways
– Depending on the type of application and the needs of users.
• The three commonly used file organizations used in dbms/rdbms
data processing applications are
• Sequential
• Direct
• Indexed sequential access method(ISAM)
File Organization

The selection of a particular file


organization depends upon the
application used.

To access a record some key field


or unique identifying value that is
found in every record in a file is
used.
Serial File Organization

• Records are arranged one after another, in the chronological


order in which they are added to the file.

• Commonly found in the transaction data, where records are


created in the order of transaction.
Advantages of Serial file organization

– Fast access to next records in sequence


– Stored in economical storage media
– Easy to do the file backup facility
– Updating is slow in file organization
Sequential File organization

• Records are stored one after another in an ascending or descending


order determined by the key field of the records.
Eg:- payroll file, records are stored in the form of employee id.

• Normally stored on storage media such as magnetic tape, punched


cards, or magnetic disks.
• The first record is read and processed first, then the second
record in the file sequence, and so on.
• To locate a particular record, the computer program must
read in each record in sequence and compare its key field to
the one that is needed.
• The retrieval search ends only when the desired key
matches with the key field of the currently read record.
Random/Direct Access File Organization

• Direct access file organization allow immediate direct access to


individual records on the file.
• The record are stored and retrieved using a relative record
number, which gives the position of the record in the file.

• It also allows the file to accessed sequentially.


• The primary storage in a CPU truly provides for direct access.
• Self(direct) Addressing: A record key is used as its relative
address.
• The record’s address is calculated
– Record key + physical address of the first record in the file.

Advantage:- No need to store an index.

Disadvantages :- Records must be of fixed length


• if some records are deleted the space
remains empty
Random access method

• Records are stored on disk by using a hashing algorithm.

• The key field is fed through hashing algorithm and a relative


address is created.
• This address gives the position of the record stored.

• The desired records can be directly accessed using


randomizing procedure or hashing without accessing all
other records in the file.

• Randomizing procedure :- Records are stored in such a way


that there is no relationship between the keys of the
adjacent records.
The technique provide computational procedure
• For converting the
records key number  physical location
on a disk address

Hashing is a technique for searching for needed record by without


utilising an index structure.
Advantages
• The access to and retrieval of a records is quick and direct.
• Transactions need not be stored and placed in sequence
prior to processing.
• Best used for online transaction
Disadvantages
• Address generation overhead is involved for accessing each
record due to hashing function.
• May be less efficient in the use of storage space than
sequentially organized files.
Indexed Sequential Access Method(ISAM)

• Hybrid between sequential and direct access file organization.


• Technique that provides efficient ways to both sequentially
and randomly access records.
• The records within the file are stored sequentially but direct
access to individual records is possible through an index.

Data is stored in sorted order based on a key, and


An index is maintained to facilitate quick search operations.
• Data is stored sequentially, but an index is maintained for
faster access.

• Indexing:- Permits access to selected records without


searching the entire file.

• Analogy :- Think of it like having a bookmark in a book that


guides you to specific pages.
Advantages:
• ISAM permits efficient and economical use of sequential
processing techniques when the activity ratio is high.
• Permits direct access processing of records in a relatively
efficient way when the activity ratio is low.

Disadvantages:
• Files must be stored in a direct-access storage device.
• Relatively expensive hardware and software resources
• Access to records may be slower than direct file.
• Less efficient in the use of storage space.
Different types of DBMS Architecture

1.Logical one-tier In 1-tier architecture,


2. Logical two-tier Client / Server architecture
3. Logical three-tier Client/Server architecture
1-tier architecture

• DBMS is the only entity


where user directly sits on
DBMS and uses it.
• Any changes done here will
directly be done on DBMS
itself.
• It does not provide tools On a single-tier application, the application
and database reside on the same device.
for end users
• Database designers and
programmers use single
tier architecture.
Two-tier Client/ Server Architecture

• It is used for User Interface


program and Application
Programs that runs on client
side.
• An interface called ODBC
(Open Database Connectivity)
provides an API that allows
client side program to call the
DBMS.
• A client program may connect
to several DBMS's.
• Here some variation of client
is also possible
Three-tier Client / Server Architecture

• Commonly used architecture for


web applications.
• Intermediate layer called
Application server/ Web Server
stores the web connectivity software
and the business logic (constraints).
– Used to access the right amount of
data from the database server

• This layer acts like medium for


sending partially processed data
between the database server and
the client.
Database model/Data model

• An abstract model that describes how the data is


represented and operations that can be performed on the
data.
• A data model consists of a set of data structures and
conceptual tools that is used to describe the structure
– Data types
– Relationships
– Constraints(rules/conditions applied to database data)

(They define limitations and requirements that data must meet,


preventing the entry of invalid or inconsistent data)
Data model

Data model theory


• Formal description of how data may be structured and used
Data model instance
• Practical data model designed for a particular application.
Data Modelling
The process of applying a data model theory to create a data
model instance .
Main objective of database system is Data abstraction
– Highlight only the essential features and
– Hide the storage and data organization details from the user.

A database model provides the necessary means to achieve data


abstraction.
Three database design models

* Hierarchical Model
* Network Model
* Relational Model
Hierarchical Model

• Data Organized in a tree


structure.
• Data is represented by a
collection of records and the
relationships are represented
by links.
• Here each entity has only one
parent but can have several
children.
• At the top of hierarchy there
is only one entity which is
called Root node.
Advantages Disadvantages
• Simplicity: The relationship • Implementation complexity
between the various layers is
• Database management
logically simple.
problem
• Data Security: The data security is
• Lack of structural
provided by the DBMS.
Independence.
• Data Integrity: There is always
• Operational Anomalies
link between the parent segment
and the child segment under it.
• Efficiency: It is very efficient
because when the database
contains a large number of one to
many relationships.
Network Model

• In 1971, the Conference on Data


Systems Languages (CODASYL) formally
defined the network models.
• Here data is represented by a collection
of records and the relationships are
represented by links.
• Each record is collection of fields, which
contains only one data value.
• A link is an association between two
records.
• In the network model, entities are
organized in a graph
– in which some entities can be accessed
through several paths.
• It is simple and easy to • More complex system of
implement. database structure
• It can handle many • Lack of structural
relationships within the dependence.
organization.
• It has better data
independence compared to
hierarchical model.
Relation Data Model

• Developed by E.F Codd in 1970.


• Unlike, hierarchical and network
model, there are no physical links.
• All data is maintained in the form of
tables consisting of rows and columns.
• Each row (record) represents an entity
and column (field) represents an
attribute of the entity.
• In this model, data is organized in 2D
tables called relations.
• The tables or relation are related to
each other.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy