Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
55 views

Unit-1-Database System Architecture

The document discusses the introduction and importance of database management systems (DBMS). It explains that a DBMS allows for organized storage and retrieval of data, reduces data redundancy and inconsistencies, and enables sharing of data among multiple users. It also discusses some key DBMS concepts like database architecture, data dictionary, and data warehouse.

Uploaded by

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

Unit-1-Database System Architecture

The document discusses the introduction and importance of database management systems (DBMS). It explains that a DBMS allows for organized storage and retrieval of data, reduces data redundancy and inconsistencies, and enables sharing of data among multiple users. It also discusses some key DBMS concepts like database architecture, data dictionary, and data warehouse.

Uploaded by

Shiv Patel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Database

Management
System
Introduction
 Database is an integral part of real life application system. The
course will enable student understand the different issues
involved in the design and implementation of a database
system. Student will learn the physical and logical database
designs, database modeling, relational, hierarchical, and
network models.

 Student will learn to use data manipulation language to query,


update, and manage a database. Student will understand
essential DBMS concepts such as: database security, integrity,
concurrency, storage strategies etc. The students will get the
hands on practice of using SQL and PL/SQL concepts.
Why we study DBMS?
 Proper database management systems help increase
organizational accessibility to data, which in turn helps the end
users share the data quickly and effectively across the
organization. A management system helps get quick solutions
to database queries, thus making data access faster and more
accurate.

Database

Store Retrieve
Unit–1
Database System
Architecture
What is Database Management System (DBMS)?

Database Management System

Collection of logically Manipulation, Searching Programs or tools used


related data and Security of data to manage database

e.g. Books Database in e.g. Viewing result in GTU e.g. Oracle, My SQL
Library, Student Database website, Searching exam SQL Server,
in University etc papers in GTU website
What is Database Management System (DBMS)?
 Data - Fact that can be recorded or stored
• e.g. Person Name, Age, Gender and Weight etc.
 DBMS - A Database Management System is a collection of
interrelated data and a set of program to access those data.
OR
 DBMS - A Database Management System is a software for
creating and managing databases. It provides a systematic way
to create, retrieve, update and manage data.

 The primary goal of DBMS is to provide a way to store and


retrieve database that is both convenient and efficient.
Applications of DBMS
 DBMS is computerized record-keeping system.
 So where it is required to store data at there DBMS can be used.
1. E-Commerce (Flipkart, Amazon, Shopclues, eBay etc.)
2. Online Television Streaming (Hotstar, Amazon Prime etc.)
3. Social Media (WhatsApp, Facebook, Twitter, LinkedIn etc.)
4. Banking & Insurance
5. Airline & Railway
6. Universities and Colleges/Schools
7. Human Resource Department
8. Hospitals and Medical Stores
9. Government Organizations
DBMS Vs File Processing System
1. Reduce data redundancy (duplication)

EmpName Address Mob Subject EmpName Address Mob Subject


Vatsal Patel Navsari 1234 PPS Vatsal Patel Navsari 1234 PPS

Database management
system can remove such Same data is stored at
data redundancy by four different places
storing data centrally.

EmpName Address Mob Subject EmpName Address Mob Subject


Vatsal Patel Navsari 1234 PPS Vatsal Patel Navsari 1234 PPS
DBMS Vs File System(cont…)
2. Remove data inconsistency

EmpName Address Mob Subject EmpName Address Mob Subject


Vatsal Patel 678 PPS
Navsari 1234 Vatsal Patel Navsari 1234 PPS

Same data having


different state (values) Database management
system can keep data in
Mobile no is changed consistent state.

EmpName Address Mob Subject EmpName Address Mob Subject


Vatsal Patel Navsari 1234
678 PPS Vatsal Patel Navsari 1234 PPS
DBMS Vs File System(cont…)
3. Data Isolation
EmpName Address Mob Subject
File 1
Vatsal Patel Navsari 1234 PPS

EmpName Salary Load


File 2
Vatsal Patel 50000 20

EmpName Teaching Knowledge Discipline


File 3
Vatsal Patel Good V Good Excellent

• Data are scattered in various files


• Files may be in different formats
• Difficult to retrieve the appropriate data
Database management system allow us to
access (retrieve) appropriate data easily.
DBMS Vs File System(cont…)
4. Guaranteed Atomicity (Either transaction execute 0% or 100%)

Sum of both
account before
transfer is 3000

Person A Person B
Account A Transfer 500 Account B
Bal : 2000 Bal : 1000
Step 1 : Debit 500 from Account A
Step 2 : Credit 500 into Account B
Sum of both
Sum of both account account is 2500
after transfer is 3000 So Inconsistent
DBMS Vs File System(cont…)
5. Allow to implement integrity constraints
EmpName Address MobileNo Subject
Vatsal Patel Navsari 9898052340 PPS

Must contain
exact 10 digits

StudentName SPI BackLogs


Jay Patel 8 0

Must between
0 and 10

Database management system allow us


to implement such rules in our database.
DBMS Vs File System(cont…)
6. Sharing of data among multiple users

EmpName Address Mob Subject EmpName Address Mob Subject


Vatsal Patel Navsari 1234 PPS Vatsal Patel Navsari 1234 PPS

Want
Wanttoto
access
access
Database management
system allows more than
one user to access same
data simultaneously.

EmpName Address Mob Subject EmpName Address Mob Subject


Vatsal Patel Navsari 1234 PPS Vatsal Patel Navsari 1234 PPS
DBMS Vs File System(cont…)
7. Restricting unauthorized access to data Wants to
access
EmpName Address Mob Subject
Vatsal Patel Navsari 1234 PPS

EmpName Salary Load XYZ


Wants to
Vatsal Patel 50000 20 access

EmpName Teaching Knowledge Discipline


Vatsal Patel Good V Good Excellent Vatsal

Database management system prevents


unauthorized user to access data.
DBMS Vs File System(cont…)
8. Providing backup and recovery services
Advantages of DBMS (Summary)
1. Reduce data redundancy (duplication)
• Same data is stored at two different places
2. Remove data inconsistency
• Same data having different state (values)
3. Data Isolation
• Data are scattered in different files
• Each file may have different formats
• Difficult to retrieve proper data
4. Guaranteed Atomicity
• Either transaction executes 0% or 100%
Advantages of DBMS (cont…)
5. Allow to implement integrity constraints
• Rules such as do not allow to store amount less than Rs. 0 in balance.
6. Sharing of data among multiple users
• More than one users can access same data at same time
7. Restricting unauthorized access to data
• User can only access data which is authorized to him/her
8. Providing backup and recovery services
• Can take regular auto or manual backup and use it to recover database if
it corrupts.
Basic Terms
 Data
• Data is raw, unorganized facts that need to be processed.
• Example: Marks of subjects
• DBMS – 85/100, DS – 80/100, DF – 75/100.

 Information
• When data is processed, organized, structured or presented in a given
context so as to make it useful, it is called information.
• Example: Percentage
• Percentage = (DBMS + DS + DF) / 3
(85 + 80 + 75) / 3 = 80%
Basic Terms (cont…)
 Metadata
• Metadata is data about data.
• Data such as table name, column name, data type, authorized user and
user access privileges for any table is called metadata for that table.
Faculty
EmpName Address Mob Subject Salary
Vatsal Patel Navsari 1234 PPS 50000

• Table Name – Faculty


• Column Name – EmpName, Address, Mob, Subject, Salary
• Datatype – Varchar, Decimal
• Access Privileges – Read, Write (Update)
Basic Terms (cont…)
 Data dictionary
• Data dictionary is an information repository which contains metadata.
• It is usually a part of the system catalog.
 Data warehouse
• Data warehouse is an information repository which stored data.
• It is design to facilitate reporting and analysis.
Faculty
EmpName Address Mob Subject Salary Data
Vatsal Patel Navsari 1234 PPS 50000

• Table Name – Faculty


• Column Name – EmpName, Address, Mob, Subject, Salary
Metadata
• Datatype – Varchar, Decimal
• Access Privileges – Read, Write (Update)
Basic Terms (cont…)
 Field
• A field is a character or group of characters that have a specific meaning.
• It is also called a data item. It is represented in the database by a value.
• For Example EmpName, Address, Mob, Subject, Salary are all fields for
Employee Database.
 Record
• A record is a collection of logically related fields.
• For examples, collection of fields (EmpName, Address, Mob, Subject &
Salary) forms a record for employee.

Faculty
EmpName Address Mob Subject Salary
Vatsal Patel Navsari 1234 PPS 50000
Basic Terms (cont…)
 Instances
• Databases change over time as information is inserted and
deleted.
• The collection of information stored in the database at a
particular moment is called instance of the database.
 Schemas
• The overall design of the database is called the database
schema.
• Schemas are changed frequently.
Data Abstraction (3-tier architecture)
 3 Levels ANSI SPARC Database System
User 1 User 2 User 3
How data are viewed View
by each users? View 1 View 2 View 3
Level

What data are stored and Conceptual Logical


What relationships exist? Level Level

How the data are actually Internal Physical


stored on storage devices? Level Level

Database
Data Abstraction (3-tier architecture)
Mapping
Want to access some data

View 1 View 2 View 3

Request
Conceptual
Level

Internal
Process of transforming Level
requests and results Result
between the three
levels is called mapping
Database
Types of Mapping
Want to access some data

View 1 View 2 View 3

External/Conceptual
Mapping
• Which objects on the Conceptual
conceptual level correspond to Level
the objects requested on a
particular user's external view Conceptual/Internal
• Several mapping Mapping
Internal
Level
• How conceptual records
and fields stored
• One mapping

Database
Data Independence
Want to access some data

View 1 View 2 View 3

• Allows to change conceptual


schema without affecting the Logical Data
Conceptual
existing external schema. Independence
Level
• Required whenever the logical
structure of the database is
altered.
• Difficult to achieve
Internal Physical Data
Level Independence
• Allows changing in physical storage
devices without change in the Ability to modify a schema
conceptual view or external view. definition in one level without
• Required to improve performance. affecting a schema definition in
• Easy to achieve Database the next higher level.
Types of database users
1. Naive Users (End Users)
• Unsophisticated users who have zero knowledge of database system
• User interacts to database via sophisticated software or tools
• e.g. Clerk in Bank
2. Application Programmers
• Programmers who write software using tools such as Java, .Net, PHP etc…
• e.g. Software Developers
3. Sophisticated Users
• Interact with database system without using application program
• Use query tools like SQL
• e.g. Analyst
4. Specialized Users (DBA)
• User write specialized database applications program
• Use administration tools
• e.g. Database Administrator
DBA (Database Administrator)
 The Database Administrator (DBA) is responsible for
the overall planning of the company's data resources , for
the design data , and for the day to day operational aspects
of data management.
 A Database Administrator (DBA) person responsible for
the installation , configuration, upgradation , maintenance
and monitoring databases in an organization.
 A Database Administrator (DBA) is a specialized
computer systems administrator who maintains a
successful database environment by directing or
performing all related activities to keep the data secure.
Role of DBA (Database Administrator)
1. Schema Definition
• Defines the logical schema of the database.
2. Storage Structure and Access Method Definition
• Decides how the data is to be represented in the
database & how to access it.
3. Defining Security and Integrity Constraints
• Decides various security and integrity constraints.
4. Granting of Authorization for Data Access
• Determines which user needs access to which part of
the database.
Role of DBA (Database Administrator)
5. Liaison with Users
• Provide necessary data to user.
6. Assisting Application Programmer
• Provides assistance to application programmers to develop
application programs.
7. Monitoring Performance
• Ensures that better performance is maintained by making
change in physical or logical schema if required.
8. Backup and Recovery
• Backing up the database on some storage devices such as
DVD, CD or Magnetic Tape or remote servers and recover
system in case of failures, such as flood or virus attack from
this backup.
Skills Required for DBA (Database Administrator)
 Good communication skills.
 Excellent knowledge of database architecture and design .
 Knowledge of SQL.
Database Languages
DDL (Data Definition Language)
DDL or Data Definition Language actually consists of the SQL
commands that can be used to define the database schema. It
simply deals with descriptions of the database schema and is
used to create and modify the structure of database objects in
database.
Examples of DDL commands:
 CREATE – is used to create the database or its objects (like
table, index, function, views, store procedure and triggers).
 DROP – is used to delete objects from the database.
 ALTER-is used to alter the structure of the database.
 TRUNCATE–is used to remove all records from a table,
including all spaces allocated for the records are removed.
 RENAME –is used to rename an object existing in the database.
DML(Data Manipulation Language)
 The SQL commands that deals with the manipulation of data
present in database belong to DML or Data Manipulation
Language and this includes most of the SQL statements.
 There are two types of DMLs:
 Procedural DMLs require a user to specify what data are
needed and how to get those data.
 Declarative DMLS (also refereed as nonprocedural DMLs)
require a user to specify what data are needed without
specifying how to get those data.
Examples of DML:
 SELECT – is used to retrieve data from the a database.
 INSERT – is used to insert data into a table.
 UPDATE – is used to update existing data within a table.
 DELETE – is used to delete records from a database table.
DCL(Data Control Language)
 DCL includes commands such as GRANT and REVOKE which
mainly deals with the rights, permissions and other controls of
the database system.
Examples of DCL commands:
 GRANT-gives user’s access privileges to database.
 REVOKE-withdraw user’s access privileges given by using the
GRANT command.
TCL(Transaction Control Language)
TCL commands deals with the transaction within the database.
Examples of TCL commands:
 COMMIT– commits a Transaction.
 ROLLBACK– rollbacks a transaction in case of any error occurs.
 SAVEPOINT–sets a savepoint within a transaction.
Database System Architecture

You might also like