Unit 1-Introduction of Dbms-1
Unit 1-Introduction of Dbms-1
Practical: DM Labrotory
Teaching Scheme: Practical: 2 Hrs /Week
Examination Scheme:
• Oral : 25 Marks
Mr.Patil L. P.
CONTENTS
Unit I: Introduction to DBMS : 07 Hrs
Mr.Patil L. P.
BOOKS
Text Books:
Text Books:
1. A. Silberschatz, H.F. Korth and S. Sudarshan , “Database System Concepts”,
McGraw Hill, 6th Edition.
2. C.J. Date, A. Kannan, S. Swamynathan “An introduction to Database
Systems”, Pearson, 8th Edition.
Reference Books:
1. Martin Gruber, “Understanding SQL”, Sybex Publications.
2. Ivan Bayross, “SQL- PL/SQL”, BPB Publications, 4th Edition.
3. S.K. Singh, “Database Systems: Concepts, Design and Application”, Pearson,
Education, 2nd Edition.
Mr.Patil L. P.
UNIT 1
Mr.Patil L. P.
DATA
Mr.Patil L. P.
DATA
Data Phrases in Technology
As technology advances and changes, numerous phrases have been used over
the years to describe data
Raw Data: Information that has been collected but not formatted or analyzed.
Structured Data: Structured data refers to any data that resides in a fixed field
within a record or file. This includes data contained in relational databases and
spreadsheets.
Big Data: A massive volume of both structured and unstructured data that is so
large it is difficult to process using traditional database and software techniques
Big Data Analytics: The process of collecting, organizing and analyzing large sets of
data to discover patterns and other useful information. 10
Mr.Patil L. P.
DATA
Data Center: Physical or virtual infrastructure used by enterprises to
house computer, server and networking systems and components for
the company's information technology (IT) needs.
11
Mr.Patil L. P.
DATABASE
It is a collection of information arranged and
presented to serve an assigned purpose
Example:
Telephone directory
Dictionary
12
Mr.Patil L. P.
TYPES OF DATABASES
Centralized database
Typically used by bigger organizations,
eg. business or university
Cloud database
The data is stored on a local hard drive or server,
but the information is available online.
Distributed database
Spread out over multiple devices which
increased speed, better reliability and ease of
expansion.
End-user database
Spreadsheet stored on your local computer.
13
Mr.Patil L. P.
TYPES OF DATABASES
Object-oriented database
The data is represented as objects and classes
Open-source database
An open-source database is designed for the public to use for
free.
Operational database
The purpose of an operational database is to allow users to
modify data in real-time
Personal database
NoSQL database
Storage and retrieval of data other than tabular relations model
used in relational databases. allows them to process larger
amounts of data at speed and makes it easier to expand in the
future 14
Relational database
Information is stored and retrieved in a structured way
Mr.Patil L. P.
OPPORTUNITY
Data Manager
A data manager supervises a company’s data systems and
ensures they are organized, stored and secure.
Depending on the size of the company, a data manager
might work in a team of data operators or as an individual
Data Analysts
Data analysts organize and interpret large amounts of data
for others to easily understand.
Business professionals use this interpreted data to make
business decisions
Data Scientist
Data scientists analyze raw data and synthesize it into
results that can be easily understood.
data scientists use the data from their analyses to solve
real-world problems in business and politics 15
Mr.Patil L. P.
BANKING AND FINANCIAL SERVICES
SOFTWARE PROVIDERS
ACI Worldwide, Inc., Adobe, ADP, AdviseSoft, Alfa Financial Software
company, eFront, S.A., Ellie Mae, Envestnet, Equifax, ERI Bancaire, Exela
HubSpot 16
Mr.Patil L. P.
BANKING AND FINANCIAL SERVICES
SOFTWARE PROVIDERS
IBM, Imagine Software, Informatica, International Decision Systems
(IDS), ION Trading, ISGN Corporation, Jack Henry & Associates, Kofax,
Elite, Tieto (Ex EMRIC AB), TotalSoft, Verint Systems Inc., White Clarke
17
Group, Wolters Kluwer, Workday, Workiva, ZenTreasury, Zoom Video
18
Mr.Patil L. P.
DATABASE MANAGEMENT SYSTEM
(DBMS)
A DataBase Management System (DBMS)
is a piece of software that manages databases
and lets you create, edit and delete databases,
their tables and their data.
SQL Non SQL
Oracle Document: MongoDB, CouchDB,
MySQL
Microsoft SQL Server Key-value: Redis, DynamoDB
PostgreSQL
SQLite Wide-column: Cassandra, Hbase
Microsoft access
Graph: Neo4j, Amazon Nept
19
Mr.Patil L. P.
EMBEDDED / STATIC SQL
Embedded or Static SQL is those SQL statements
that are fixed and can't be changed at runtime in an
application.
These statements are compiled at the compile-time
only.
The benefit of using this statement is that you know
the path of execution of statements because you have
the SQL statements with you,
You can optimize your SQL query and can execute the
query in the best and fastest possible way.
The way of accessing the data is predefined and these
static SQL statements are generally used on those
20
databases that are uniformly distributed.
USE EMBEDDED SQL RATHER THAN SQL OR ONLY A
GENERAL-PURPOSE PROGRAMMING LANGUAGE.
Database Applications:
• Banking: all transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Manufacturing: production, inventory, orders, supply chain
23
• Human resources: employee records, salaries, tax deductions
•
Mr.Patil L. P. Databases touch all aspects of our lives
APPLICATION OF DBMS
Enterprise Information
Sales: For customer, product, and purchase
information.
Accounting: For payments, receipts, account balances,
assets and other accounting information.
Human resources: For information about employees,
salaries, payroll taxes, and benefits, and for
generation of paychecks.
Manufacturing: For management of the supply chain
and for tracking production of items in factories,
inventories of items in warehouses and stores, and
orders for items.
Online retailers: For sales data noted above plus
online order tracking, generation of recommendation
lists, and maintenance of online product evaluations. 24
Mr.Patil L. P.
APPLICATION OF DBMS
Banking and Finance
Banking: For customer information, accounts,
loans, and banking transactions.
Credit card transactions: For purchases on credit
cards and generation of monthly statements.
Finance: For storing information about holdings,
sales, and purchases of financial instruments
such as stocks and bonds; also for storing real-
time market data to enable online trading by
customers and automated trading by the firm.
25
Mr.Patil L. P.
APPLICATION OF DBMS
Universities: For student information, course
registrations, and grades (in addition to standard
enterprise information such as human resources
and accounting).
Airlines: For reservations and schedule
information. Airlines were among the first to use
databases in a geographically distributed
manner.
Telecommunication: For keeping records of calls
made, generating monthly bills, maintaining
balances on prepaid calling cards, and storing
information about the communication networks. 26
Mr.Patil L. P.
DATABASE MANAGEMENT SYSTEM
27
Mr.Patil L. P.
DATABASE MANAGEMENT SYSTEM
28
Mr.Patil L. P.
PURPOSE OF DATABASE SYSTEM
In the early days, database applications were built on top of file
systems
Data isolation —
multiple files and formats
Integrity problems
Integrity constraints (e.g. account balance > 0) become part of program code
29
Hard to add new constraints or change existing ones
Mr.Patil L. P.
PURPOSE OF DATABASE SYSTEM
Drawbacks of using file systems (cont.)
Atomicity
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
Security problems
30
Mr.Patil L. P.
INSTANCES AND SCHEMAS
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 of a variable in a program
Physical schema: database design at the physical level
Logical schema: database design at the logical level
Instance – the actual content of the database at a particular
point in time
Analogous to the value of a variable
Physical Data Independence – the ability to modify the
physical schema without changing the logical schema
Applications depend on the logical schema
In general, the interfaces between the various levels and
components should be well defined so that changes in some parts do
not seriously influence others. 33
Mr.Patil L. P.
INSTANCES AND SCHEMAS
For Customer For Purchase Manager
View 1
View 2 • A database may also have several
Item_Number
Item_Name
Item_Name schema's at the view level (external
Price
Quantity Price level)
Quantity • Sometimes called subschemas, that
describe different views of the
database.
Logical / Conceptual Level • Eg: Name, price of Item
There is a client
process, which
requires some
resource
server, which
provides the
resource
no requirement
that the client
and server must
reside on the
same machine.
36
Mr.Patil L. P.
ADVANTAGES CLIENT SERVER ARCHITECTURE
It enables wider access to existing databases.
Increased performance – if the clients and server reside on
different computers then different CPUs can be processing
applications in parallel.
It should also be easier to tune the server machine if its
only task is to perform database processing.
Hardware costs may be reduced – it is only the server that
requires storage and processing power sufficient to store
and manage the database.
Communication costs are reduced – applications carry out
part of the operations on the
client and send only requests for database access across the
network, resulting in less data being sent across the
network.
Mr.Patil L. P.
DATABASE SYSTEM ARCHITECTURE
Functions of DBA
• Schema Definition.
• Storage structure and
access method
definition.
• Schema and physical
organization
modification.
• Granting of
authorization for data
access.
• Routine maintenance.
40
Mr.Patil L. P.
TWO-TIER AND THREE-TIER ARCHITECTURES
User
client User
Application Application
client
network
network
Application
Database server server
system
Database
system
Two-tier architecture:
E.g. client programs using ODBC/JDBC to communicate with a
database 41
Three-tier architecture:
E.g. web-based applications, and applications built using middleware”
Mr.Patil L. P.
DATA MODELS
Data Model is a collection of conceptual tools
for describing data, data relationships, data
semantics, and consistency constraints.
Mr.Patil L. P.
HIERARCHICAL DATA MODEL
• Each child record has only one parent, whereas each parent record
can have one or more child records.
• The relationships formed in the tree-structure diagram must be such
that only one-to-many or one-to-one relationships exist between a
parent and a child. 44
• In order to retrieve data from a hierarchical database the whole tree
needs to be traversed starting from the root node.
Mr.Patil L. P.
NETWORK DATA MODEL
Mr.Patil L. P.
RELATIONAL MODEL
A relational model uses a collection of tables to
represent both data and the relationships
among those data
Each table has multiple columns(attributes)
and each column has a unique name.
No special charter allowed to define attribute
except under score(_)
Each table consists of multiple rows (tuples)
Table: Student-Info
Table: Student-Info
Student_ID Student_roll_no Student_Name Student_Email
P20203201 2345 Sachin [email protected]
Z20203405 2641 Parag [email protected]
47
T20194390 4555 Mrunal [email protected]
Mr.Patil L. P.
RELATIONAL MODEL
A relational database management
system (RDBMS) has following
properties:
Represent data in the form of tables
Does not require the user to understand its
physical implementation
Provides information about its content and
structure in system table
Supports the concepts of NULL value
48
Mr.Patil L. P.
RELATIONAL MODEL PROPERTIES…
Mr.Patil L. P.
RELATIONAL DATABASE
Relation A relation is a table with columns and
rows.
Attribute An attribute is a named column of a
relation
Tuple A tuple is a row of a relation.
50
Mr.Patil L. P.
DOMAIN
A domain is the set of allowable values for one or more attributes
Every attribute in a relation is defined on a domain.
Domains may be distinct for each attribute, two or more attributes may
be defined on the same domain.
More information is available to the system when it undertakes the
execution of a relational operation, and operations that are semantically
incorrect can be avoided.
A semantic error means that a legal SQL query was entered, but the
query does not or not always produce the intended results, and is
therefore incorrect for the given task. i.e. error can arises using the
wrong variable or using wrong operator or doing operation in
wrong order
Domains for some attributes of the Branch and Staff relations as below
51
Mr.Patil L. P.
DEGREE
The degree of a relation is the number of
attributes it contains
If relation has four attributes i.e. degree
four.
A relation with only one attribute would have
degree one and be called a unary relation or
one-tuple.
A relation with two attributes is called binary
Mr.Patil L. P.
FUNDAMENTALS OF DATABASE
Field Name
Field Contents
53
File Database
Mr.Patil L. P.
FUNDAMENTALS OF DATABASE
Fields /Attributes/Columns
Mr.Patil L. P.
PROCEDURAL AND NONPROCEDURAL LANGUAGE
In the non-procedural languages, the user has to
specify only “what to do” and not “how to do”.
It is considered as a function-driven language.
57
Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE
Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE
Data Manipulation Language[DML]
DDL is a language which deals with the
processing or manipulation of various
database objects
Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE
DATA MANIPULATION LANGUAGE[DML] CONT…
Two classes of languages
Procedural – user specifies what data is required
and how to get those data
60
Mr.Patil L. P.
TYPES OF DATABASE LANGUAGE
61
Mr.Patil L. P.
62