DBMS-UNIT-1 prepared
DBMS-UNIT-1 prepared
UNIT-1
DATABASEMANAGEMENTSYSTEM
Ans:
Example of data are rollno, name, rama, 50000,age,Hyderabad, salary , address etc.,
DATABASE: A database is a collection of data about one particular organization. A database contains
one or more tables. A database is also known as “Schema”
SYMBOLof database:
DBMS:DBMS stands for Database Management System. It is a collection of programs used to create a
database structure, organize the database(add,modify ordeletedata) and provide security for data in a
database. We use SQL to work with DBMS.
Examples of DBMS Software’s are: Oracle, MYSQL,MS-SQL,MS-Access etc.,
DATA INFORMATION
Data is raw fact and figures. Information is a processed form of data.For
For example:32 in data. example: Age 32
Data is not significant to a business. Information is signification to a business.
Data are atomic level pieces of information. Information is a collection of data. For example:
It can be in the form of numbers, characters, Age and 32 collected together to
Symbols ,or even pictures. form information(Age 32).
Data does not help in decision making. Information helps in decision making.
Observations and recordings are done to Analysis is done to obtain information
Obtain data.
Input to any system may be treated as data. Output afterprocessing the system is
information.
Difficult to understand properly. Easy to understand.
Data must be processed to understand. Information is already in understandable
form .It may be processed further to make it more
understandable.
Data may not be in the order. Information should be in the order.
1
BSC-DBMS
Record: A record is defined as collection of related fields. A record is also known as “Tuple”.
Table: A table is defined as collection of records. A table is also known as “Entity” or “sub-schema” or
“File”.
4Q. What is File Processing System.What are drawbacks or limitation of File Processing System.
A file processing system(FPS)is a method of storing and organizing data in computer files.
In File processing system files are designed using programming languages like c, cobol , c++,
java etc.,
Here ,Files are called “Flat Files”. It is best suited for small databases.
2
BSC-DBMS
3
BSC-DBMS
It is central repository of shared data. It allows several users to access the database
concurrently.
A fundamental feature of the database approach is that the database system does not only
contain the data but also the complete definition and description of these data. These
description are basically details about the extent, the structure, the type and the formant of
all data and, additionally, the relationship between the data. This kind of stored data is called
metadata (“data about data”).
A primary feature of the database approach is a standardized, uniform approach to database
access. This means that the same overall procedures are used by all applications programs to
retrieve data and information.
Data should be correct with respect to the real world entity that they represent.
Data should be protected from unauthorized access.
Its organization is such that duplication of data is minimized.
Data in a database exit permanently until it is not explicitly deleted.
A database system is composed of following four major components, which coordinate with each other
to form an effective database system.
(c)Software (d)Users
(a)Data: It is a very important component of the database system. Most of the organizations
generate, store and process large amount of data. Data may be of different types:
1. User data: It consists of a table(s)of data called structure(s), where column(s)are called fields
or attributes and rows are called records or tuples for tables. A relation must be structured
properly.
2. Metadata: Metadata means “data about data”. It is a description about the structure of the
database. System tables store the metadata which includes basic information about the
design of each table, the data type of each field and various constraints set on them.
(b) Hardware: The hardware consists of the secondary storage devices such as magnetic disk (hard
disk, zip disk, floppy disk), optical disk (CD-ROM, DVD), magnetic tapes etc.
4
BSC-DBMS
(c) Software: The DBMS needs three types of softwares. They are
1. Operating system software: Manages all hardware components and acts as an interface between
user and the computer. Ex: Microsoft Windows, Linux, Unix.
2. DBMS software: Databases/w is used to create database structure and organize the database. Ex:
Oracle, MS SQL,MY SQL,MS Access etc.,
3. Application Software: Used to design an front-end application. Ex: Java, HTML, .NETetc.,
(i) Naïve Users: Naïve user has no knowledge of database system and about its any supporting
Software. These users uses the existing application to interact with the database.
Ex: ATMs, online library system, ticket booking systems etc.
(ii) Online Users: Online users are those who may communicate with the database directly via an
Online device or via a user interface and application program.
(iii) Application Programmer: Application Programmers are developers who are responsible for
Developing application programs.
(iv) DataBase Administrator(DBA): A person who Is responsible for managing the overall
database Management system is called Database Administrator.
(v) EndUser: These are the people who interact with dbms to perform different operation on
Database such as retrieving, updating, inserting ,deleting data etc.
5
BSC-DBMS
Controlling redundancy:
In DBMS ,all the data of an organization is integrated into a single database.
The data is recorded at only one place in the database and it is not duplicated.
By controlling redundancy, we can save storage space.
Data Consistency:
In the file processing system, information is duplicate throughout the system .so
changes made in one file may be necessary be carried over to another file.
Reduced data redundancy leads to better data consistency.
Improved Data Sharing:
In a paper-based record keeping ,data can not be shared among many users.
Data stored in DBMS can be shared among multiple users at the same time if they
are connected through a network.
The data can be shared by authorized users only.
Improved Data security:
Data security is the protection of database from unauthorized users.
DBMS provides a framework for better enforcement of data privacy and security
policies.
Improved DataAccess:
Data in a database can be accessed and manipulated by means of a query.
DBMS sends output of query to the application.
Data Integration:
Data integrity means that the data contained in the database is both accurate and
consistent.
Therefore, data values being entered for storage could be checked to ensure that
they are of the correct format or not.
Integrity Rules:
Integrity constraints or consistency rules can be applied to database, so that the
correct data can be entered into the database.
Ex: primarykey ,foreignkey, uniqueetc.
Data Independence:
The separation of database from the application program that is used to access the
data is called data independence.
In DBMS, the database and application programs are separated from each other.
Data Atomicity:
Anyoperationondatabasemustbeatomici.e.itshouldeithercompleteornot occur at
all.(all or none).
Backup and Recovery:
Most of the DBMSs provide the backup and recovery systems that automatically
create the backup and restoring the data if required.
6
BSC-DBMS
DISADVANTAGES OF DBMS:
High cost
Complexity of Backup and recovery
Security Threats.
In the early 1970s, the ANSI-SPARC (American National Standard Institute-Standard Planning
and requirements committee) defined a frame work for data modelling on degrees of abstraction.
The term abstraction means the amount of detail you want to hide.
7
BSC-DBMS
This framework is used for describing the structure of specific database system. In this, the database
schemas can be defined at 3 levels. So, this architecture is called as three level (or) ANSI-SPARC
Three-tier (or) Three schemes
DATA
The external level or user view is at the highest of the three level DBMS architecture.
This is the highest level of data abstraction.
It includes a number of user views of the database.
It is also known as view level.
Different views may have different representation of same data.
It describes only part of the entire database that is relevant to each user.
8
BSC-DBMS
The lowest level of three level DBMS architecture is known as the internal level or internal
schema.
This is the lowest level of data abstraction.
It describes the physical structure of data in database.
It describes how the data items are stored in the physical storage devices (hard disk,CD,DVD,
Tape drives etc).
It deals with file structures, access methods, data compression and ecncryption techniques if
used.
Data Independence:
The ability to modify the schema definition in one level without affecting another level is called
data independence. They are of two types.
Physical Data Independence: The ability to modify a physical schema without causing application
programs to be rewritten.
Logical Data Independence: The ability to modify a logical schema without causing application
programs to be rewritten.
Classification of DBMS:
The DBMSs can be classified into different categories on the basis of several criteria’s. These
are classified according to: DBMS is categorized into types based on the following:
9
BSC-DBMS
1. Based on the datamodel: Depending on the data model they use ,the DBMS can be classified as
1. Hierarchical Data Model
Single user Database–It can support only one user at a time. It is mostly used with the personal
computer on which the data resides accessible to a single person. The user may design ,maintain and
write the database programs.
Multiple user Database– It supports multiple users concurrently. In this, data can be both integrated and
shared. It can be divided into two types.
→ Workgroup Database: When a multiuser database supports a small number of users (or) a
specific department in an organization, then it is called as workgroup database.
→ Enterprise Database: When the database is used by the entire organization, across many
departments, then it is known as enterprise database.
Centralized database – The DBMS and database are stored at the single site that is used by several other
systems is called centralized database. The data is maintained on the centralized server.
10
BSC-DBMS
Distributed database–In this data and the DBMS software are distributed over several sites but
connected to the single computer.
2. Heterogeneous Database: If the different softwares are accessed to different systems then
it can be called as heterogeneous database.
11
BSC-DBMS
1. Object Based Logical Models: These models can be used in describing the data at the logical
and view levels. These models are having flexible structuring capabilities classified into
following types.
The entity-relationship model.
The object-oriented model.
The semantic data model.
The functional data model
2. Record Based Logical Models: These models can also be used in describing the data at the logical and
view levels. These models can be classified into:
Relational model.
Network model.
Hierarchal model.
3. Physical Models: These models can be used in describing the data at the lowest level (physical level).
These models can be classified into
Unifying model
Frame memory model.
Basic Building blocks: The basic building blocks of all data models are:
12
BSC-DBMS
1. Entity: An entity is anything which data are to be collected and stored.
13
BSC-DBMS
3. Easy Conversion to Any Model – The ER Model can be easily converted into the relational model and
other models like the network model, hierarchical model, etc.
2) Object oriented Model– The information here is in the form of the object as used in object oriented
programming. It adds the database functionality to object programming languages. It requires less
code, use more natural data and also code bases are easy to maintain. Examples are ObjectDB
(ObjectDB software).
3) The Semantic Data Model
A semantic Data Model is a more high-level data model that makes it easier for a user to give starting
description of data in an enterprise. These models contain a wide variety of relations that helps to
describe a real application scenario. A DBMS cannot support all these relations directly; so, it is built
only with few relations Known as relational model in DBMS.A widely used semantic data model is the
Entity-Relationship (ER) data model which allows us to graphically denote entities and relationship
between them.
The functional Data Model makes it easier to define functions and call them wherever necessary to
process data.
14
BSC-DBMS
Advantages:
Simplicity
Data security
Data Integrity
Efficiency
Disadvantages:
Implementation complexity
Database Management problem
Lack of structural independence.
2) NetworkModel–
Advantages:
Conceptual simplicity
Easy to access data.
Data Integrity
15
BSC-DBMS
Data Independence
Disadvantages:
System complexity
Absence of Structural independence
3) Relational Model–
Advantages:
Conceptual simplicity
Easy to access data.
Structural Independence
Design Implementation
Data Integrity
Data Security
Data Independence
16
BSC-DBMS
Disadvantages:
Hardware overheads
Cost
Physical Models
Physical models describe how data is stored at the lowest (hardware) level. They focus on performance,
storage structures, and data access methods.
1) Unifying Model
Description:
Key Features:
Description:
Key Features:
Example:
Navigation systems store frequently accessed landmarks in memory.
17
BSC-DBMS
In database approach in order to maintain or develop database we should take a risk and we should
invest money, time and environment. Database approach when we develop a new database or when
we maintain an existing database, we should consider the following costs and risks of the database
approach are categorized into 5 factors:
Conversion costs
Organizational conflict
Organizations that adopt the database approach need to hire or train individuals to design and
implement databases, provide database administration services and manage a staff of new people.
Further, because of the rapid changes in technology these new people will have to be retrained or
upgraded on a regular basis.
A multi user database management system is a large and complex software that has a high initial cost,
requires a staff of trained personnel to install and operate, annual maintenance etc. Installing such a
system may also require upgrade to the hardware and data communication system in the
organization.
Conversion Costs
If the database is changed or modified in some manner, all the data needs to be converted to the new
form. This cost may even exceed the database creation and management costs sometimes. This is the
reason most organizations prefer to work on their old databases rather than upgrade to new ones.
A shared database must be accurate and available at all times. This requires that procedures should be
developed and used for providing backup copies of data and for restoring a database when damage
occurs.
Organizational conflict
Centralization also means that the data is accessible from a single source, namely the database. This
increases the severity of security breaches and disrupting the operation of the organization.
BUSINESS RULES
18
BSC-DBMS
A business rule is statement that imposes some form of constraint on a specific aspect of the database,
such as the elements within a field specification for a particular field or the characteristics of a given
relationship. You base a business rule on the way the organization perceives and uses its data which
you determine from the manner in which the organization functions or conducts its business.
An important aspect of any design process is making choices. In database design, for example, you must
choose which data to store in the database; you would not necessarily want or need to store every
last piece of data the organization might possibly use. The data you finally choose to store and how
you decide to store it will be determined by the way the organization uses its data. A hospital may
wish to store times of various events to the second, whereas a warehouse requires only the date for
any given event.
A SHIP DATE cannot be prior to an ORDER DATE for any given order.
Tables from the Bel Air High School and Lake City High School databases.
Database oriented
Application oriented
Both types of business rules impose some form of constraint and help enforce and maintain overall data
integrity, but they differ with regard to where and how they are established.
Database oriented
In this method business rules impose constraints that you can establish within the logical design of the
database. You implement a given constraint by modifying various field specification elements,
relationship characteristics, or a combination of the two.
This business rule limits the values that you can enter into the VENDSTATE field to WA, OR, ID, and MT.
You can establish the business rule's constraint in a meaningful manner by modifying the Range of
Values element in the field specifications for the VENDSTATE field.
Application oriented
Business rules impose constraints that you cannot establish within the logical design of the database You
must instead establish them within the physical design of the database or within the design of a
database application, where they will be more applicable and meaningful.
19
BSC-DBMS
A customer with a "Preferred" status receives a 15% discount on all purchases. There are certain
constraints that designers apply to ensure that a database honors a company's business rules. These
constraints help preserve data integrity.
For purposes of this lesson, we will resort to the language of general database discussions (for instance,
table, field, record).
1)Field constraints
There are various field constraints that can be imposed on a database to honor business rules Consider
the example below
Business rule: We ship our fertilizer to just four states: Texas, New Mexico, Oklahoma, and Louisiana.
Field constraint: These states are represented in a Customers table in a field called State as: TX NM, OK,
and LA. A constraint is placed on the State field so that only those four state abbreviations are
accepted into the database for that specific table.
Constraints are especially common on date fields, where dates would become meaningless in a database
if a product's ship date. Etc...
2)Relationship constraints
There are also various constraints that can be placed on the relationships (links) between tables.
Relationship constraint: The relationship between the Vendors table and Products table must be
governed by a participation constraint wherein a single record in the Vendors table must be related
to at least one record in the Products table.
20
BSC-DBMS
21
BSC-DBMS
22