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

Dbms Project

Uploaded by

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

Dbms Project

Uploaded by

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

A Project on

DBMS

(Database Management System)


Database Management Concepts

o Database Management Systems (DBMS)


o An example of a database (relational)
o Database schema (e.g. relational)
o Data independence
o Architecture of a DBMS
o Types of DBMS
o Basic DBMS types
o Retrieving and manipulating data: query processing
o Database views
o Data Integrity
o Client-Server Architecture
o
DBMS

A Database Management System is a collection of


interrelated data and a set of programs to access those
data. The collection of data usually referred to as the
database, contains information relevant to an enterprise.
The primary goal of a DBMS is to provide a
way to score and retrieve database information that is
both convenient and efficient.
PROBLEMS WITHOUT AN
DBMS

 System crashes:
 What is the problem ?
 Large data sets (say 50GB)
Why is this a problem ?
 Simultaneous access by many users
 Lock students.txt – what is the problem ?
Functions of DBMS

 The ability to retrieve and update data
 Supporting concurrent updates
 Recovery of data
 Security
 Data integrity
 Interactive query
 Interactive data entry and updating
ADVANTAGES OF DBMS

 Managing large quantity of structured data

 Efficient retrieval and modification: query processing and


optimization

 Sharing data: multiple users use and manipulate data

 Controlling the access to data: maintaining the data


integrity
DISADVANTAGES OF DBMS
 Cost of hardware and software

 Cost of data conversion

 Cost of staff trailing

 Appointing technical staff

 Database damage
DBMS

An component of a database (relational):


 Relations (tables)
 Attributes (columns)
 Tuples (rows)

Example query: Salesperson='Mary' AND


Price>100.
Database System Applications

 Bank  Business
Database system Applications

Airlines Universities
DATA MODELS
• A data model is a collection of conceptual tools
for describing data, data relation-ship, data
semantics, and consistency constraints. In this
part, we study two data models
the E-R (entity relationship) model
and the relational model .
RDBMS
Relational database management system (RDBMS) is a
database management system (DBMS) that is based on
the relational model as introduced by E. F. Codd. Most
popular databases currently in use are based on the
relational database model.
Example
Relational languages


SQL
QBE
Datalog
ER Model
The E-R data model perceives the real world as
consisting of basic objects, called entities, and
relationships among these objects.

The E-R model is very useful in mapping the


meanings and interactions of real-world
enterprises onto a conceptual schema.
BASIC CONCEPTS OF E-R MODEL

The E-R data model employs basic


notions:

 Entity Sets
 Relationship Sets
 Attributes
E-R Diagram
RELATIONSHIP SETS
A Relationship is an associations among several
entities.

Mapping Cardinalities
 One to One
 One to Many
 Many to One
 Many to Many
RELATIONAL SETS

•Relations, attributes, tuples


•Primary key (unique combination of attributes for each tuple)
•Foreign keys: relationships between tuples (many-to-many).

Example: SUPPLIES defines relations between ITEM and SUPPLIER tuples.


•Advantages: many-to-many relationships, high level declarative query language (e.g.
SQL)
•SQL example (retrieve all items supplied by a supplier located in Troy):
 SELECT ItemName
 FROM ITEM, SUPPLIES, SUPPLIER
 WHERE SUPPLIER.City = "Troy" AND
 SUPPLIER.Supplier# = SUPPLIES.Supplier# AND
 SUPPLIES.Item# = ITEM.Item#
•Programming language interfaces: including SQL queries in the code
Transaction model
Distributed Transactions
DATABASE MANAGEMENT
SYSTEM ARCHITECTURE

o DBMS ARCHITECTURE

o THE PHYSICAL DBMS ARCHITECTURE


DBMS ARCHITECTURE
 The logical DBMS architecture

The logical architecture deals with the


way data is stored and presented to
users.

 The physical DBMS architecture


DBMS ARCHITECTURE
The logical DBMS architecture

The physical DBMS architecture


The physical architecture is concerned
with the s/w components that make up
DBMS.
“Two tier system” or “client-server”

connection
(ODBC, JDBC)

Database server
Data files (someone else’s
Applications
C program)
25
Three Level Architecture of DBMS
A major purpose of a database system is to provide
users with an abstract view of the data. That is,
the system hides certain details of how the data is
stored and maintained.

I. External or View Level

II. Conceptual Level

III. Internal or Physical Level


Three Level Architecture of DBMS

External
Level View 3
View 1 View 2

Conceptual level

Physical level
THREE LEVEL ARCHITECTURE OF DBMS

Sales Officer Inventory Controller

View 1 View 2
External Item_Name Item_Name
level Price Stock

Conceptual
Conceptual level level Item_Number Character (6)
Item_Name Character(30)
Price Numeric(5,2)
Stock Numeric(4)

Physical
Stored_Item Length=50
Item # Type = Byte(6), offset = 0, Index = Ix
Physical level Name Type = Byte(30), offset = 6
Price Type = Byte(8), offset = 36
Stock Type = Byte(4), offset = 44
External or View Level

This level is closest to the users and is concerned with the way
in which the data is viewed by individual users. Most of the
users are not concerned with all the information contained in
the database. Instead they need only a part of the database
relevant to them. The system provides many views for the
same databa
External or View Level

Highest level of abstraction of database.

Allows to see only the data of interest to them.

Users – Application programmers or end-users.

Any no. of external views – external schema.


External or View Level

 It consists of the definition of logical records and relationships

in the external view.


 It also contains the methods for deriving the objects such as

entities, attributes and relationships in the external view from


the.
CONCEPTUAL LEVEL

The sum total of DBMS users view.


Describes what data are actually stored
in the database (ie,all the records and
relationships included in the database).
CONCEPTUAL LEVEL

The conceptual view is defined by means of


the conceptual schema, which includes the
definition of each of the various types of
conceptual records and the mapping between
the conceptual schema and the internal
schema).
Internal or Physical Level

 Lowest level of abstraction.


 Describes how the data are physically stored.
 Internal view – internal schema (not only defines the
various types of stored record but also specifies what
indexes exists, how files are represented, etc.)
Internal or Physical Level

The internal level is closest to physical storage. This level is


also termed as physical level. It describes how the data are
actually stored on the storage medium. At this level, complex
low-level data structures are described in detail.
DATA INDEPENDENCE
The ability to modify a schema definition in one level
without affecting a scheme definition in the next higher
level is called DATA INDEPENDENCE

1) Physical Data Independence

2) Logical Data Independence


PHYSICAL DATA INDEPENDENCE

It refers to the ability to modify the scheme followed at the


physical level without affecting the scheme followed at the
conceptual level.

The application programs remain the same even though the


scheme at the physical level gets modified.

Modifications at the physical level are occasionally necessary

in order to improve performance of the system


Logical Data Independence
It refers to the ability to modify the conceptual scheme without
causing any changes in the schemes followed at view levels.
The logical data independence ensures that the application
programs remain the same.
Modifications at the conceptual level are necessary whenever
logical structures of the database get altered because of some
unavoidable reasons.
Physical & Logical
Data Independence

It is more difficult to achieve logical data independence than


the physical data independence.
The reason being that the application programs are heavily
dependent on the logical structure of the database
DBMS Structure
General users AP Query DBA

Application System Database


Programs Calls Schema

Object Code DML Query DDL


Of Program Precompiler Processor Compiler

Database
Manager

File
Manager

Data Files Data Dict.


40
*Database Systems
The big commercial database vendors:
• Oracle
• IBM (with DB2)
• Microsoft (SQL Server)
• Sybase
Some free database systems (Unix) :
• Postgres
• MySQL
• Predator
S Q
L
(St r uc ture que r y lang uag e )
INTRODUCTION TO SQL

What is SQL?
 When a user wants to get some information from a
database file, he can issue a query
 A query is a user–request to retrieve data or
information with a certain condition.
 SQL is a query language that allows user to specify
the conditions. (instead of algorithms)
INTRODUCTION TO SQL

Concept of SQL
 The user specifies a certain condition
 The program will go through all the records in the database file
and select those records that satisfy the condition.(searching).
 Statistical information of the data.
 The result of the query will then be stored in form of a table.
Basic structure of an SQL query
General SELECT, ALL / DISTINCT, *,
Structure AS, FROM, WHERE

Comparison IN, BETWEEN, LIKE "% _"

Grouping GROUP BY, HAVING,


COUNT( ), SUM( ), AVG( ), MAX( ), MIN( )

Display Order ORDER BY, ASC / DESC

Logical AND, OR, NOT


Operators

Output INTO TABLE / CURSOR


TO FILE [ADDITIVE], TO PRINTER, TO SCREEN

Union UNION
THE SITUATION:
STUDENT PARTICULARS
field type width contents
 id numeric 4
student id number
 name character 10 name
 dob date 8 date of birth
 sex character 1 sex: M / F
 class character 2 class
 hcode character 1 house code: R,
Y, B, G
 dcode character 3 district code
 remission logical 1 fee remission
 mtest numeric 2 Math test score
General Structure
SELECT ...... FROM ...... WHERE ......

SELECT [ALL / DISTINCT] expr1 [AS


col1], expr2 [AS col2] ;

FROM tablename WHERE


condition
Thanks

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