ch01_dbs
ch01_dbs
Introduction to Database
and its users
⚫ Data
− Raw facts
− Unprocessed facts
⚫ Information
− Output of processing raw data
− Useful facts
Slide 1-2
Data vs Information
Slide 1-3
Points to remember
Slide 1-4
⚫ Files ??
− A data file is a computer file which stores data
to use by a computer application or computer
system
− Contains information used as input, or written
as output by some other software program
Slide 1-5
Basic File Terminology
⚫ Data : raw facts e.g. 13, ‘abc’
⚫ Field: Used to define and store data
− Represents a characteristic of individual/entity
e.g. name, rollnumber
⚫ Record
− Logical collections of fields that describes a
person/thing/place etc.. E.g.
(1,’mohan’,’maths(h))
⚫ File
− Collection of related records
Slide 1-6
Writing and reading from a File using
#include <fstream.h>
#include <string.h> a programming language
struct customer { char name [51] ; float balance ; };
int main ( )
{customer savac;
strcpy(savac.name, "Tina Marshall") ; // copy value to structure
savac.balance = 21310.75 ; // variable savac
ofstream fout ;
fout.open("Saving", ios :: out | ios :: binary) ; // open output file
if(!fout) { cout << "File can't be opened \n" ; return 1; }
fout.write((char *) & savac, sizeof(customer)) ; // write to file
fout.close() ; // close connection
ifstream fin ; // read it back now
fin.open("Saving", ios :: out | ios :: binary) ; // open input file
fin.read((char *) & savac, sizeof(customer)) ; // read structure
cout << savac.name ; // display structure now
cout << "has the balance amount of Rs." << savac.balance << "\n" ;
fin.close( );
}
Slide 1-7
Slide 1-8
File System ??
⚫ A file system is an abstraction to update,
store and retrieve a collection of files.
⚫ Windows supports three major file systems
which are file allocation table (FAT), file
allocation table 32 (FAT32), and new
technology file system (NTFS).
⚫ Ubuntu uses ext2fs, ext3, ext4 (from v 11.0
onwards) filesystem
Slide 1-11
Types of Databases and Database
Applications
⚫ Numeric and Textual Databases
⚫ Multimedia Databases
⚫ Geographic Information Systems (GIS)
⚫ Data Warehouses
⚫ Real-time and Active Databases
Slide 1-14
DBMS Environment
Slide 1-15
FIGURE:
A simplified
database
system
environment.
Slide 1-16
FS vs DBS
Slide 1-17
Typical DBMS Functionality
Other features:
− Protection or Security measures to prevent
unauthorized access
− “Active” processing to take internal actions on
data based on ECA (Event-condition-action) rules
(Possible use of active database is in alerting,
security monitoring, statistics gathering and
authorization.)
− Presentation and Visualization of data
Slide 1-19
Example of a Database
(with a Conceptual Data Model)
Slide 1-20
FIGURE 1.2a
A database that stores student and course information.
Slide 1-21
FIGURE 1.2b
A table showing section of a course being taught by an
instructor.
Slide 1-22
FIGURE 1.2c
Tables showing grade report and prerequisites of a course.
Slide 1-23
FIGURE 1.3
Internal storage format for a STUDENT record.
Slide 1-24
FIGURE 1.4
Two views derived from the database in Figure 1.2 (a)
The STUDENT TRANSCRIPT view. (b) The COURSE
PREREQUISITES view.
Slide 1-25
Main Characteristics of the Database
Approach
⚫ Self-describing nature of a database system:
⚫ A DBMS catalog stores the description (meta-data) of
the database.
⚫ Allows the DBMS software to work with different
databases.
⚫ Insulation between programs and data:
⚫ To provide program-data independence.
⚫ Allows changing data storage structures and
operations without having to change the DBMS access
programs.
Slide 1-26
Characteristics Contd..
⚫ Data Abstraction:
⚫ Data hiding thru a data model
⚫ A database model shows the logical structure of a
database, including the relationships and constraints
that determine how data can be stored and
accessed.
⚫ A data model is used to hide storage details and
present the users with a conceptual view of the
database
⚫ Support of multiple views of the data:
⚫ To provide user a different view of the database as
per his/her interest.
Slide 1-27
Characteristics Contd..
⚫Sharing of data and multiuser transaction
processing
− allows a set of concurrent users to retrieve and to
update the database in on-line time (OLTP).
− Concurrency control within the DBMS guarantees
that each transaction is correctly executed or
completely aborted.
Database Users
Slide 1-29
Database Users
Actors on the scene
− Database administrators: responsible for:
− authorizing access to the database
− coordinating and monitoring its use
− acquiring software, and hardware resources
− controlling its use
− monitoring efficiency of operations.
− Database Designers: responsible for
− defining the content of DB and its structure
− write the constraints to maintain data correctness
− decide functions or transactions against the database
concerning efficient data retrieval
− communicate with the end-users and understand their needs.
− End-users: who
− use the data for queries, reports
− may sometimes update the database content
− System Analyst and Programmers Slide 1-30
Categories of End-users
⚫ Casual : access database occasionally when
needed
– Use queries
⚫ Naïve or Parametric :
− a large section of the end-user population.
− use previously well-defined functions in the form of
“canned transactions” against the database.
− Examples are bank-tellers or reservation clerks or
sale staff who do this activity for an entire shift of
operations.
− Use GUI/form based application
Slide 1-31
Categories of End-users (contd..)
⚫ Sophisticated :
– include business analysts, scientists, engineers, others
thoroughly familiar with the system capabilities; have
Knowledge of DBMS working
– Many use tools in the form of software packages that
work closely with the stored database.
⚫ Stand-alone :
− mostly maintain personal databases using ready-to-use
packaged applications.
− An example is a tax program user that creates his or
her own internal database. (e.g. Tally)
− Customized software
Slide 1-32
Workers behind the scene
Slide 1-33
Advantages of Using the Database
Approach
⚫ Controlling redundancy in data storage and
minimizing efforts in development and
maintenance.
⚫ Sharing of data among multiple users.
⚫ Restricting unauthorized access to data.
⚫ Providing persistent storage for program
Objects
⚫ Providing Storage Structures for efficient
Query Processing
Slide 1-34
Advantages of Using the Database
Approach
⚫ Providing backup and recovery services.
⚫ Providing multiple interfaces to different
classes of users.
⚫ Representing complex relationships among
data.
⚫ Enforcing integrity constraints on the database.
⚫ Drawing Inferences and Actions using rules
Slide 1-35
Additional Implications of Using the
Database Approach
⚫ Potential for enforcing standards: crucial
for the success of database applications.
Standards refer to data item names, display
formats, screens, report structures, meta-data
(description of data) etc.
⚫ Reduced application development time:
Reduced incremental time to add each new
application
Slide 1-36
Additional Implications of Using the
Database Approach
⚫ Flexibility to change data structures:
database structure may evolve as new
requirements are defined.
⚫ Availability of up-to-date information: very
important for on-line transaction systems such
as airline, hotel, car reservations.
⚫ Economies of scale:
wasteful overlap of resources and personnel can
be avoided by consolidating data and
applications across departments
Slide 1-37
Software packages using DB as backend
Slide 1-46
When not to use a DBMS
Slide 1-48
Contd..
Slide 1-49
Contd..
− Structure of data
⚫ Structured : Well defined structure
− A student record
⚫ Unstructured or semi structured data
− E.g. A text, document
− XML (Extensible Markup Language)
Slide 1-50
Types of DBMS (Example)
Slide 1-51
System Catalog and Data Dictionary
Slide 1-53
Example for Data Dictionary
Slide 1-54
Slide 1-55