Unt 1
Unt 1
Unit – I
INTRODUCTION
Database system:
It is a collection of interrelated data and collection of access programs to manage,utilize,store
the data
Data Sharing
The integration of the whole data in an organization leads to the ability to produce more
information from a given amount of data.
Enforcing Integrity Constraints
DBMSs should provide capabilities to define and enforce certain constraints such as data
type, data uniqueness, etc.
Data Independence
System data (Meta Data) descriptions are separated from the application programs. Changes
to the data structure is handled by the DBMS and not embedded in the program.
Transaction Processing
The DBMS must include concurrency control subsystems to ensure that several users trying
to update the same data do so in a controlled manner. The results of any updates to the
database must maintain consistency and validity.
Managing information
Managing information means taking care of it so that it works for us, and is useful for the
work we are doing. The information we collect is no longer subject to “accidental
disorganization” and becomes more easily accessible and integrated with the rest of our work.
Managing information using a database allows us to become strategic users of the data we
have.
DBMS vs File system
Database Users
Actors on Scene
Actors on the Scene These apply to "large" databases, not "personal" databases that are
defined, constructed, and used by a single person via, say, Microsoft Access. Users may be
divided into Those who actually use and control the database content, and those who design,
develop and maintain database applications (called “Actors on the Scene”), and Those who
design and develop the DBMS software and related tools, and the computer systems
operators (called “Workers behind the Scene”).
1. Database Administrator (DBA): This is the chief administrator, who oversees and
manages the database system (including the data and software). Duties include authorizing
users to access the database, coordinating/monitoring its use, acquiring hardware/software for
upgrades, etc. In large organizations, the DBA might have a support staff.
2. Database Designers: They are responsible for identifying the data to be stored and for
choosing an appropriate way to organize it. They also define views for different categories of
users. The final design must be able to support the requirements of all the user sub-groups.
3. End Users: These are persons who access the database for querying, updating, and report
generation. They are main reason for database's existence!
Casual end users: use database occasionally, needing different information each time; use
query language to specify their requests; typically middle- or high-level managers.
Naive/Parametric end users: Typically the biggest group of users; frequently query/update the
database using standard canned transactions that have been carefully programmed and tested
in advance. Examples: Bank tellers check account balances, post withdrawals/deposits
Reservation clerks for airlines, hotels, etc., check availability of seats/rooms and make
reservations. Shipping clerks (e.g., at UPS) who use buttons, bar code scanners, etc., to
update status of intransit packages.
Sophisticated end users: engineers, scientists, business analysts who implement their own
applications to meet their complex needs.
Stand-alone users: Use "personal" databases, possibly employing a special purpose (e.g.,
financial) software package. Mostly maintain personal databases using ready-to-use packaged
applications
DBMS system designers/implementors: provide the DBMS software that is at the foundation
of all this.
Tool developers: design and implement software tools facilitating database system Design,
performance monitoring, creation of graphical user interfaces, prototyping, etc.
Operators and maintenance personnel: responsible for the day-to-day operation of the system.
Advantages of Data base systems
The database management system has a number of advantages as compared to traditional
computer file-based processing approach.
2.Sharing of Data
In DBMS, data can be shared by authorized users of the organization. The database
administrator manages the data and gives rights to users to access the data. Many users can be
authorized to access the same piece of information simultaneously. The remote users can also
share same data. Similarly, the data of same database can be shared between different
application programs.
3.Data Consistency
By controlling the data redundancy, the data consistency is obtained. If a data item appears
only once, any update to its value has to be performed only once and the updated value is
immediately available to all users. If the DBMS has controlled redundancy, the database
system enforces consistency.
4.Integration of Data
In Database management system, data in database is stored in tables. A single database
contains multiple tables and relationships can be created between tables (or associated data
entities). This makes easy to retrieve and update data.
5.Integration Constraints
Integrity constraints or consistency rules can be applied to database so that the correct data can be
entered into database. The constraints may be applied to data item within a single record or the may
be applied to relationships between records.
6.Data Security
Form is very important object of DBMS. You can create forms very easily and quickly in DBMS.
Once a form is created, it can be used many times and it can be modified very easily. The created
forms are also saved along with database and behave like a software component. A form provides
very easy way (user-friendly) to enter data into database, edit data and display data from database.
The non-technical users can also perform various operations on database through forms without going
into technical details of a fatabase.
7.Report Writers
Most of the DBMSs provide the report writer tools used to create reports. The users can create very
easily and quickly. Once a report is created, it can be used may times and it can be modified very
easily. The created reports are also saved along with database and behave like a software component.
10.Data Independence
The separation of data structure of database from the application program that uses the data is called
data independence. In DBMS, you can easily change the structure of database without modifying the
application program.
Database applications
Telecom: There is a database to keeps track of the information regarding calls made,
network usage, customer details etc. Without the database systems it is hard to
maintain that huge amount of data that keeps updating every millisecond.
Industry: Where it is a manufacturing unit, warehouse or distribution centre, each one
needs a database to keep the records of ins and outs. For example distribution centre
should keep a track of the product units that supplied into the centre as well as the
products that got delivered out from the distribution centre on each day; this is where
DBMS comes into picture.
Banking System: For storing customer info, tracking day to day credit and debit
transactions, generating bank statements etc. All this work has been done with the help
of Database management systems.
Education sector: Database systems are frequently used in schools and colleges to
store and retrieve the data regarding student details, staff details, course details, exam
details, payroll data, attendance details, fees details etc. There is a hell lot amount of
inter-related data that needs to be stored and retrieved in an efficient manner.
Online shopping: You must be aware of the online shopping websites such as
Amazon, Flipkart etc. These sites store the product information, your addresses and
preferences, credit details and provide you the relevant list of products based on your
query. All this involves a Database management system.
Brief introduction of different Data Models
Physical data model :represent the model where it describes how data are stored in computer
memory, how they are scattered and ordered in the memory, and how they would be retrieved
from memory. Basically physical data model represents the data at data layer or internal
layer. It represents each table, their columns and specifications, constraints like primary key,
foreign key etc. It basically represents how each tables are built and related to each other in
DB.
Representation data model: It is between High level & Low level data model Which
provides concepts that may be understood by end-user but that are not too far removed from
the way data is organized by within the computer.
1. Relational Model :The Relational Model uses a collection of tables both data and the
relationship among those data.
2.Account –Table
Account- Balance
Number
A-101 1000.00
A-125 1200.00
A-456 5000.00
A-987 1234.00
A-111 3000.00
Customer Preethi and Rocky share the same account number A-111
Advantages:
1. The main advantage of this model is its ability to represent data in a simplified format.
2. The process of manipulating record is simplified with the use of certain key attributes
used to retrieve data.
3. Representation of different types of relationship is possible with this model.
2. Network Model
The data in the network model are represented by collection of records and relationships
among data are represented by links, which can be viewed as pointers.
A-101 1000.00
A-111 3000.00
Advantages:
3.Hierarchical Model
A hierarchical data model is a data model which the data is organized into a tree like
structure. The structure allows repeating information using parent/child relationships:
each parent can have many children but each child only has one parent. All attributes
of a specific record are listed under an entity type.
Advantages:
1. The representation of records is done using an ordered tree, which is natural
method of implementation of one–to-many relationships.
2. Proper ordering of the tree results in easier and faster retrieval of records.
3. Allows the use of virtual records. This result in a stable database especially when
modification of the data base is made.
Database Schema
A database schema is the skeleton structure that represents the logical view of the entire
database. It defines how the data is organized and how the relations among them are
associated. It formulates all the constraints that are to be applied on the data.
A database schema defines its entities and the relationship among them. It contains a
descriptive detail of the database, which can be depicted by means of schema diagrams. It’s
the database designers who design the schema to help programmers understand the database
and make it useful.
A database schema can be divided broadly into two categories −
Physical Database Schema − This schema pertains to the actual storage of data and its form of
storage like files, indices, etc. It defines how the data will be stored in a secondary storage.
Logical Database Schema − This schema defines all the logical constraints that need to be
applied on the data stored. It defines tables, views, and integrity constraints.
Database Instance
The data stored in database at a particular moment of time is called instance of
database. Database schema defines the variable declarations in tables that belong to a
particular database; the value of these variables at a moment of time is called the instance of
that database.. It contains a snapshot of the database. Database instances tend to change with
time. A DBMS ensures that its every instance (state) is in a valid state, by diligently
following all the validations, constraints, and conditions that the database designers have
imposed.
Data independence is ability to modify a schema definition in one level without affecting a
schema definition in the next higher level.
• Provides a powerful and flexible security mechanism by hiding parts of the DB from
certain users. The user is not aware of the existence of any attributes that are missing
from the view
. • It permits users to access data in a way that is customized to their needs, so that the
same data can be seen by different users in different ways, at the same time.
CONCEPTUAL LEVEL
• Complete view of the data requirements of the organization, independent of any storage
consideration.
INTERNAL LEVEL
• Physical implementation of the DB to achieve optimal run– time performance and storage space
utilization. - Storage space allocation for data and indexes - Record description for storage - Record
placement - Data compression, encryption
Data Files: - It has the real data stored in it. It can be stored as magnetic tapes, magnetic
disks or optical disks.
Compiled DML: - Some of the processed DML statements (insert, update, delete) are
stored in it so that if there is similar requests, it will be re-used.
Data Dictionary: - It contains all the information about the database. As the name suggests, it
is the dictionary of all the data items. It contains description of all the tables, view, materialized
views, constraints, indexes, triggers etc.
2. Software: To make the database system work properly, three types of software are needed:
operating system, DBMS software, and application programs.
a) Operating system: It manages all hardware components and allows other software to run on
the computers. Examples of operating system software include Windows, Linux and etc.
b) DBMS software: It manages the database within the database system. Some examples of
DBMS software include Oracle, Access, MySql and etc.
c) Application programs: These are used to access and manipulate data in the DBMS and to
manage the computer environment in which data access and manipulation take place.
Application programs are most commonly used to access data to generate reports. Most of
the application programs provide GUI.
3. People: This component includes all users of the database system. According to the job
nature, five types of users can be identified: systems administrators, database administrators,
database designers, systems analysts and programmers, and end users.
a) System administrators: They supervise the database system's general operations.
b) Database administrators: They are also known as DBAs. They manage the DBMS and
ensure that the database is functioning properly.
c) Database designers: They design the database structure. They are the database architects.
As this is very critical, the designer's job responsibilities are increased.
d) Systems analysts and programmers: They design and implement the application programs.
They design and create the data entry screens, reports, and procedures through which end
users can access and manipulate the data.
e) End users: They are the people who use the application programs to run the organization's
daily operations. For example, sales-clerks, supervisors, managers are classified as end
users.
4. Procedures: Procedures are the instructions and rules that supervise the design
and use of the database system. Procedures are a critical component of the
system. Procedures play an important role in a company because they enforce
the standards by which business is conducted in an organization
5.
Data: Data refers the collection of facts stored in the database. Because data are
the raw material from which information is generated, no database can exist
without data.
Earlier architectures used mainframe computers to provide the main processing for all system
functions, including user application programs and user interface programs, as well as all the
DBMS functionality. The reason was that most users accessed such systems via computer
terminals that did not have processing power and only provided display capabilities.
Therefore, all processing was performed remotely on the computer system, and only display
information and controls were sent from the computer to the display terminals, which were
connected to the central computer via various types of communications networks. At first,
database systems used these computers similarly to how they had used display terminals, so
that the DBMS itself was still a centralized DBMS in which all the DBMS functionality,
application program execution, and user inter-face processing were carried out on one
machine
Many Web applications use an architecture called the three-tier architecture, which adds an
intermediate layer between the client and the database server, as illustrated in Figure below
This intermediate layer or middle tier is called the application server or the Web server,
depending on the application. This server plays an intermediary role by run-ning application
programs and storing business rules (procedures or constraints) that are used to access data
from the database server. It can also improve database security by checking a client’s
credentials before forwarding a request to the data-base server. Clients contain GUI interfaces
and some additional application-specific business rules. The intermediate server accepts
requests from the client, processes the request and sends database queries and commands to
the database server, and then acts as a conduit for passing (partially) processed data from the
database server to the clients, where it may be processed further and filtered to be presented
to users in GUI format. Thus, the user interface, application rules, and data access act as the
three tiers.