db lecture 01

54
 DA T ABASE SYSTEMS    CSC271 Lecture    01 Instructor Name: Tehseen Riaz Abbasi BOOK: Fundamentals of Database Systems, Edition: 6 th  Edition Authors: Ramez Elmasri, Shamkant B. Navathe Book: Chapter-01: Databases and Database Users 1

Upload: aquadestructor

Post on 02-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 1/54

 

DATABASE SYSTEMS –  CSC271Lecture –  01

Instructor Name: Tehseen Riaz Abbasi

BOOK: Fundamentals of Database Systems,

Edition: 6th Edition

Authors: Ramez Elmasri, Shamkant B. Navathe

Book: Chapter-01:

Databases and Database Users

1

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 2/54

 

 Agenda

Introduction To the Database Systems

Database Terminologies and DefinitionsSimplified Database System Environment

Typical DBMS Functionality

Example of a Simple Database

Types of Databases and Database ApplicationsExamples of Database Applications

Introduction to File Based System

Limitations of File-Based Approach

Database Approach - DBMS

Main Characteristics of the Database Approach

Components of DBMS Environment

History of Database Systems 2

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 3/54

 

 Agenda

Database Users

 Actors on the scene and Workers behind the scene Advantages of the Database Approach

 Advantages of using a DBMS

Disadvantages of DBMSs

Implications of the database approachWhen not to use a DBMS

3

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 4/54

 

Database Terminologies:

Data: The known facts that can be recorded and have an

implicit meaning is called data.For Example: Meaningful facts, text, graphics, images,

sound, video segments etc.

Information: Data processed to be useful in decisionmaking is said to be information

Database: An organized collection of logically related

data is called as database OR

A collection of related data.

OR

A data structure that stores metadata, i.e. data about data.4

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 5/54

 

Database Terminologies:

Mini-world:

„A database represents some aspect/part of the real world,sometimes called the Miniworld.

For Example: student grades and transcripts at a

university.

Metadata(System Catalog): Data that describes data

„Database Management System (DBMS):„It is software/collection of programs that enables users to

create and maintain a database. Examples are: MySQLMSSQL, Oracle, PostgreSQL OR

A software system that enables users to define, create,

maintain, and control access to the database.5

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 6/54

 

Database Terminologies:

Database System: The database and DBMS

software together forms a database system. OR  „The DBMS software together with the data itself.

Sometimes, the applications are also included.

NOTE: The term database is often erroneously referredto as a synonym for a “database  management system

(DBMS)”. They are not equivalent.

(Database) Application Program:A computer program that interacts with database

 by issuing an appropriate request (SQL statement)

to the DBMS. Examples are: Wikipedia, Wordpress

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 7/54

Simplified Database System Environment

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 8/54

Typical DBMS Functionality

• Define  a particular database in terms of its data types,

structures, and constraints(restrictions/limitations)

• Construct or Load the initial database contents on a

secondary storage medium

• Manipulating the database:• Retrieval: Querying, generating reports

• Modification: Insertions, deletions and updates to its

content

• Accessing the database through Web applications

• Processing and Sharing  by a set of concurrent users

and application programs  –   yet, keeping all data valid

and consistent(reliable)

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 9/54

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 10/54

Example of a Database(with a Conceptual Data Model)

• Mini-world for the example:

• Part of a UNIVERSITY environment.

• Some mini-world entities :

• STUDENTs

• COURSEs

• SECTIONs (of COURSEs)

• (academic) DEPARTMENTs

• INSTRUCTORs

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 11/54

Example of a Database(with a Conceptual Data Model)

• Some mini-world relationships :

 – SECTIONs are of specif ic  COURSEs

 – STUDENTs take  SECTIONs

 – COURSEs have prerequisite  COURSEs

 – INSTRUCTORs teach   SECTIONs

 – COURSEs are offered by   DEPARTMENTs

 – STUDENTs major in   DEPARTMENTs

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 12/54

Example of a Simple Database

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 13/54

Types of Databases and Database Applications

Traditional Applications:

•  Numeric and Textual Databases

More Recent Applications:

• Multimedia Databases

• Geographic Information Systems (GIS)

• Real-time and Active Databases

• Data Warehouses

• Many other applications

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 14/54

Examples of Database Applications

• Purchases from the supermarket• Purchases using your credit card

• Booking a holiday at the travel agents

• Using the local library

• Taking out insurance

• Renting a video

• Using the Internet

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 15/54

15

OK? 

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 16/54

16

File Based Systems

•Collection of application programs that perform services

for the end users (e.g. reports).

Each program defines and manages its own data.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 17/54

File Based System 

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 18/54

Limitations of File-Based Approach Separation and isolation of data

• Each program maintains its own set of data.

• Users of one program may be unaware of potentiallyuseful data held by other programs.

Duplication of data ( Data Redundancy )•Same data is held/understood by different programs.

•Wasted space and potentially different values and/ordifferent formats for the same item.

Fixed Queries/Proliferation of applicationprograms

• Programs are written to satisfy particular functions.

Any new requirement needs a new program.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 19/54

Limitations of File-Based Approach

Program-Data Dependence

• All programs maintain metadata for each file they use

Data dependence

• File structure is defined in the program code.

Incompatible file formats

• Programs are written in different languages, and socannot easily access each other’s files.

Limited Data Sharing 

• No centralized control of data

• Excessive Program Maintenance 

• 80% of information systems budget

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 20/54

Database Approach (SOLUTION):

• Arose because:

• Definition of data was embedded in application programs, rather than being stored separately andindependently.

• No control over access and manipulation of data beyondthat imposed by application programs.

• Central repository of shared data

• Data is Stored in a standardized, convenient form

• Result:

• The database and Database Management System(DBMS).

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 21/54

Database Approach

• Controlled access to database may include:•a security system

•an integrity system

•a concurrency control system

•a recovery control system

•a user-accessible catalog.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 22/54

Database Management System:

• A DBMS  is a data storage and retrieval systemwhich permits data to be stored non-redundantly

while making it appear to the user as if the data is

well-integrated.

DBMS

Database

containingcentralizedshareddata

Application#1

Application#2

Application#3

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 23/54

Database Management System:

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 24/54

Main Characteristics of the Database Approach

1. Self-describing nature of a database system:

• A DBMS catalog  stores the description of a particular database (e.g. data structures, types, and

constraints). The description is called meta-data

• This allows the DBMS software to work with

different database applications.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 25/54

Example of a simplified database catalog

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 26/54

Main Characteristics of the Database Approach

2. Insulation between programs and data:

„The structure of data files is stored in the DBMS catalogseparately from the access programs and as Called

program-data independence.

• Allows changing data structures and storage organization

without having to change the DBMS access programs.

3. Data Abstraction:

• „A data model is used to hide storage details and present

the users with a conceptual view of the database.

• „Programs refer to the data model constructs rather than

data storage details

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 27/54

Views

• Allows each user to have his or her own view of the

database.• A view is essentially some subset of the database.

Views - Benefits

• Reduce complexity

• Provide a level of security

• Provide a mechanism to customize the appearance

of the database• Present a consistent, unchanging picture of the

structure of the database, even if the underlying

database is changed

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 28/54

Main Characteristics of the Database Approach

4. Support of multiple views of the data :

„ Each user may see a different view of the database, whichdescribes only the data of interest to that user.

5.Sharing of data and multi-user transaction processing:

• „Allowing a set of concurrent users to retrieve from and to update

the database.

•  Concurrency control within the DBMS guarantees that

each transaction is correctly executed or aborted.

• Recovery subsystem ensures each completed transaction

has its effect permanently recorded in the database

• OLTP (Online Transaction Processing) is a major part of database

applications This allows hundreds of concurrent database applications.

This allows hundreds of concurrent transactions to execute per

second.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 29/54

Components of DBMS Environment

•HardwareCan range from a PC to a network of computers.

•SoftwareDBMS, operating system, network software (ifnecessary) and also the application programs.

•DataUsed by the organization and a description of thisdata called the schema.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 30/54

Components of DBMS Environment

• Procedures

• Instructions and rules that should be applied tothe design and use of the database and DBMS.

• People

• Data Administrators –  personnel responsible formaintaining the database

• System Developers –  personnel responsible fordesigning databases and software

End Users –  people who use the applications anddatabases

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 31/54

31

OK? 

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 32/54

History of Database Systems

• First-generation

• Hierarchical and Network

• Second generation

• Relational

• Third generation

• Object-Oriented

• Object-Relational

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 33/54

Historical Development of Database Technology

• Early Database Applications:

• The Hierarchical and Network Models wereintroduced in mid 1960s and dominated during the

seventies.

• Relational Model based Systems:

• Relational model was originally introduced in 1970,

was heavily researched and experimented within IBM

Research and several universities.• Rational DBMS products emerged in the early 1980’s 

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 34/54

Historical Development of Database Technology

(continued)

• Object-oriented :• Object-Oriented Database Management Systems

(OODBMSs) were introduced in late 1980s and

early 1990s to cater to the need of complex data

 processing in CAD and other applications.

• Their use has not taken off much.

• Object-Relational :

• Many relational DBMSs have incorporated objectdatabase concepts, leading to a new category called

object-relationa l DBMSs (ORDBMSs)

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 35/54

DBs Hierarchical 1960s

• The hierarchical data model organizesdata in a tree structure.

• There is a hierarchy of parent and childdata segments.

• This structure implies that a record canhave repeating information, generally inthe child data segments.

• Data in a series of records, which have a

set of field values attached to it. Itcollects all the instances of a specificrecord together as a record type.

• These record types are the equivalent oftables in the relational model, and withthe individual records being the

equivalent of rows.• To create links between these record

types, the hierarchical model uses ParentChild Relationships. These are a 1:Nmapping between record types. This isdone by using trees,

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 36/54

DBs Network 1970s

• data were more naturallymodeled with more than oneparent per child.

• So, the network model permitted the modeling ofmany-to-manyrelationships in data

• The basic data modelingconstruct in the networkmodel is the set construct.

• A set consists of an ownerrecord type, a set name,

and a member record type.A member record type canhave that role in more thanone set

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 37/54

Database Users

• Users may be divided into;

• Actors on the Scene:

•Those who actually use and control thedatabase content, and those who design,

develop and maintain database applications(called “Actors on the Scene”), 

•Workers Behind the Scene:

Those who design and develop the DBMSsoftware and related tools, and the computersystems operators (called “Workers Behind theScene”) 

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 38/54

Database Users

• Actors on the scene

• Database administrators:

• Responsible for authorizing access to the database, for

coordinating and monitoring its use, acquiring

software and hardware resources, controlling its useand monitoring efficiency of operations.

• Database Designers:

• Responsible to define the content, the structure, the

constraints, and functions or transactions against thedatabase. They must communicate with the end-users

and understand their needs.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 39/54

Database Users 

•Actors on the scene (continued)• End-users: They use the data for queries,

reports and some of them update thedatabase content.

• Categories of End-users

• End-users can be categorized into:

•  Casual: access database occasionally whenneeded

• „Naïve or Parametric: they make up a largesection of the end-user population.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 40/54

Database Users • Categories of End-users

• They use previously well-defined functions in theform of “canned transactions” against thedatabase.

• Canned transactions are standard types ofqueries and updates which frequently used byNaive or parametric end users to constantlyquerying and updating

•  Examples are bank-tellers or reservation clerkswho do this activity for an entire shift ofoperations this activity for an entire shift ofoperations.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 41/54

Database Users • Categories of End-users

•„Sophisticated: These include business analyst’sscientist’s engineer’s „and engineers, others thoroughlyfamiliar with the system capabilities.

•„Many use tools in the form of software packages that

work closely with the stored database work closely withthe stored database.

•Stand-alone: Mostly maintain personal databasesusing ready-to-use packaged applications packagedapplications.

•„ An example is a tax program user that creates itsown internal database. Another example is a user

that maintains an address book

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 42/54

Roles in the Database Environment

Data Administrator (DA)• Database Administrator (DBA)

• Database Designers (Logical and Physical)

•  Application Programmers

• End Users (naive and sophisticated)

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 43/54

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 44/54

Application programs talk to DBMS and ask for the

data required

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 45/54

Database Administration’s interaction with other users 

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 46/54

Advantages of DBMSs

• Control of data redundancy (data storage, development )

• Sharing of data (among multiple users )

• Improved data integrity(accuracy and consistency of data )

• Improved security

• Enforcement of standards

• Data consistency

• Economy of scale

• More information from the same amount of data

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 47/54

Advantages of DBMSs

•  • Improved maintenance through data independence

• Increased concurrency

• Improved backup and Recovery Services

• Security mechanism

• Balance conflicting requirements

• Improved data accessibility and responsiveness

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 48/54

Disadvantages of DBMSs

• Complexity• Size

• Cost of DBMS

• Additional hardware costs• Cost of conversion

• Performance

• Higher impact of a failure

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 49/54

Additional Implications of Using the Database Approach

•Potential for enforcing standards: 

•„ This is very crucial for the success of database

applications in large organizations. Standards  refer to

data item names, display formats, screens, report,

structures, meta-data (description of data), Web pagelayouts, etc.

•  Reduced application development time: Incremental time to add each new application is reduced

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 50/54

Additional Implications of Using the Database Approach

•Flexibility to change data structures: Database

structure may evolve as new requirements are defined.

•Availability of current information: Availability of

current information:

• „Extremely important for on-line transaction systemssuch as airline, hotel, car reservations.

•Economies of scale: 

•„Wasteful overlap of resources and personnel can beavoided by consolidating data and applications

across departments...

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 51/54

When not to use a DBMS

•Main inhibitors (costs) of using a DBMS:

• „High initial investment and possible need „High initialinvestment and possible need

•Overhead for providing generality, security,

concurrency control, recovery, and integrity functions.

•„When a DBMS may be unnecessary:

• „If the database and applications are simple well defined

• If there are stringent real-time requirements that may

not met because of DBMS overhead.

• If access to data by multiple users is not required.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 52/54

When not to use a DBMS

•When no DBMS may suffice:

• „If the database system is not able to handle thecomplexity of data because of modeling limitations

• „If the database users need special operations notsupported by the DBMS

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 53/54

53

• Task – 

 01: Search, Understand with concepts and thenwrite down about the following:

• Conceptual Design

• Logical Design

• Physical Design

• Date: Week-01 (Feb-14 , 2014)

Your Work.

8/11/2019 DB Lecture 01

http://slidepdf.com/reader/full/db-lecture-01 54/54

54