+ All Categories

dbms1

Date post: 24-Nov-2014
Category:
Upload: mailforsv259
View: 7 times
Download: 2 times
Share this document with a friend
Popular Tags:
70
1 Database Systems
Transcript
Page 1: dbms1

1

Database Systems

Page 2: dbms1

2

Key Terms cont.• Database System

– A database, a database management system and appropriate hardware and personnel.

number, Designation

Hours worked, Pay

rateInsurance,

Pension

Page 3: dbms1

3

Database System: Hardware

• Set of physical devices on which a database resides. It consists of one or more computers, disk drives, CRT terminals, printers, tape drives, connecting cables and other auxiliary and connecting hardware.

Page 4: dbms1

4

Database System: Hardware cont.

Client

Client

Server

TAPETAPEPrinter

Page 5: dbms1

5

Database System: Software

• A database software includes two types of software– General-purpose database management

software, usually called the database management system (DBMS)

– Application software that uses DBMS facilities to manipulate the database to achieve a specific business function, such as providing reports or documents, which can be used by users.

Page 6: dbms1

6

Database System: Software cont.

• Application software is generally written standard programming language such as C, or it may be written in a language (commonly called a fourth-generation language) supplied with the DBMS.

• These programs utilise the command language of the DBMS and make use of the information contained in the data dictionary.

Page 7: dbms1

7

Database System: Software cont.

• User Interface– Language, menus and other facilities by which users

interact with various system components, such as application programs, the DBMS

• Computer-aided software engineering (CASE) tools– Automated tools used to design databases and

application programs.

Page 8: dbms1

8

Data Dictionary/Directory (Repository)• A subsystem that keeps track of the

– definitions of all data items in the database.

– relationships that exists between various data structures.

– indexes that are used to access data quickly.

– screen and report format definitions that may be used by various application programs.

Page 9: dbms1

9

Data Dictionary

• Definitions of data items in the database includes:

– Elementary-level data items (fields),

– group and record-level data structures, and

– files or relational tables.

Page 10: dbms1

10

• Data that describe the properties or characteristics of other data.

• Some of these properties include data definitions, data structures and rules or constraints. Item name, the data type, length, minimum and maximum allowable values (where appropriate) and a brief description of each data item.

• Metadata allow database designers and users to understand what data exist, what the data mean.

• Data without clear meaning can be confusing, misinterpreted or erroneous.

Metadata

Page 11: dbms1

11

E.g. Data Item ValueName Type Length Min Max DescriptionName Character 30 Employee

NameID Number 9 Employee No.Dept Character 10 Dept. No.Age Integer 2 18 60 Employee Age

Name Character 15 Dept. NameManager Number 9 Mgr. Emp. No.

Employee No. (ID) uniqueManager is an employee of the organisation

Metadata

Page 12: dbms1

12

Database System: People

• Two different types of people (users and practitioners) are concerned with the database.

Users– who need information from the database to

carry out their primary business responsibility

e.g. Executives, managers, staff, clerical personnel

Page 13: dbms1

13

Database System: People cont.

Practitioners

– people responsible for the database system and its associated application software.

e.g. Database administrators, analysts, programmers, database and system designers, information systems managers.

Page 14: dbms1

14

Components of a Database System

Four components: People, H/W, S/W, Data

• Practitioners (analysts and database designers) in consultation with users identify data needs and design database structures to accommodate these needs.

• The database structures are specified to the DBMS through the data dictionary.

Page 15: dbms1

15

Components of a DBS cont.• Users enter data into the system by following

specified procedures.

• The entered data are maintained on hardware media such as disks and tapes.

• Application programmes that access the database are written by practitioners and users to be run on computers.

Page 16: dbms1

16

Components of a DBS cont.

DATABASE

DATA DICTIONARY/ DIRECTORY

Application Program

Application Program

Application Program

DBMS

ComputerTerminals

PRINTER

Analyst

User

Page 17: dbms1

17

Key Terms cont.• Database Management System

– Systems software that facilitates the management of a database.

E.g. Oracle, Access, SQL Server

Page 18: dbms1

18

Database Management System (DBMS)

• DBMS –An application software that

organises data into records in one or more databases and allows organising, accessing and sorting of the data in a variety of formats.

Page 19: dbms1

19

DBMS cont.

• Relational DBMS

–Most common type of DBMS. Data elements are stored in different tables made up of rows and columns. Relates data in different tables through the use of common data element(s).

Page 20: dbms1

20

Components of a DBMS

DATABASE

DATA DICTIONARY/ DIRECTORY

USER

PROGRAMMER

Data Dictionary/ Directory

Subsystem

Security and Integrity

Subsystem

Database Access Subsystem

User Query and Reporting Facilities

Application Program

Development Facilities

DBMS

USER

PROGRAMMER

Page 21: dbms1

21

Data Security

• The database is a valuable resource needing protection.

• The DBMS provides database security by limiting access to the database to authorised personnel.

• Authorised users will generally be restricted as to the particular data they can access and whether they can update it.

Page 22: dbms1

22

Data Security

• Access is often controlled by passwords and by data views, which are definitions of restricted portions of the database.

1

Data items

23

4

Page 23: dbms1

23

Data Integrity

• The integrity and consistency of the database are protected via constraints on values that data items can have and by backup and recovery capabilities provided within the DBMS.

• Data constraint definitions are maintained in the data dictionary.

Page 24: dbms1

24

Data Integrity

• Backup and recovery are supported by software that automatically logs changes to the database and provides for a means of recovering the current state of the database in case of system failure.

Page 25: dbms1

25

Concurrent Data Access

• One of the chief functions of the DBMS is to support the access, retrieval and update of data in the database.

• The DBMS provides the physical mechanisms allowing multiple users to access a variety of related data quickly and efficiently.

Page 26: dbms1

26

User-Oriented Data Manipulation

• DBMS provides user-oriented data manipulation tools.

• Easy-to-use query languages allow users to formulate queries and request one-time reports directly from the database.

• Often query languages will contain facilities to format the results of queries as reports.

Page 27: dbms1

27

Data Manipulation

• Report generators have more powerful reporting facilities than those in the query language.

Page 28: dbms1

28

Application Development

• The DBMS commonly provides significant assistance to the application programmer.– Tools for screen, menu and report

generation

– application generators

– compilers

– data and view definition facilities

Page 29: dbms1

29

Application Development

• Modern database systems provide language components that are much more powerful than those of traditional languages, making the programming process itself considerably more efficient.– Developer 2000/PowerBuilder for Oracle

– Visual Basic for Microsoft SQL server

Page 30: dbms1

30

Database ApplicationsDatabases range from those for a

single user with a desktop computer to those on mainframe computers with thousands of users.

• Personal databases

• Workgroup databases

• Departmental databases

• Enterprise databases

Page 31: dbms1

31

Personal Computer DatabasesDesigned to support one user with a

standard alone PC.

E.g. a sales person keeping track of this customer information with contact details.

Page 32: dbms1

32

Workgroup DatabasesA relatively small team of people (less

than 25) who collaborate on the same project or application.

E.g. a software development team maintaining a list of software objects.

Page 33: dbms1

33

Department DatabasesA department is a functional unit of an

organisation. It is larger than a workgroup.

Department databases are designed to support the various functions and activities of a department.

E.g. a personnel database that is designed to track data concerning employees, jobs, skills and job assignments.

Page 34: dbms1

34

Enterprise DatabasesAn enterprise is one whose scope is

the entire organisation or enterprise.

Such databases are intended to support organisation-wide operations and decision making.

E.g. a large health care organisation that operates a group of medical centre's including hospitals, clinics and nursing homes.

Page 35: dbms1

35

Enterprise Databases cont.An enterprise database does support

information needs from many departments. The most important type of enterprise database today is called a data warehouse.

• Data warehouse– An integrated decision support database

whose content is derived from the various operational databases.

Page 36: dbms1

36

Database Environment

Marketing Purchasing

Accounting

Marketing

Sales Advertising

Accounting

Accounts Receivable

Accounts Payable

Corporate Database

Page 37: dbms1

37

3 Level ANSI/SPARC Architecture

• Made databases more independent of application

• Became a standard for the organisation of DBMS

Page 38: dbms1

38

3 Levels

• External– User’s and Application’s view of data

• Conceptual– Logical Data Model

• Physical– Physical data Model

Page 39: dbms1

39

• External (Sub) Schema– defines the external view of data

as seen by a user or program

• Conceptual Schema– defines the logical view of data

as seen by all users and programs

• Physical (Internal) Schema– defines the physical view of data

as seen by a DBMS

Page 40: dbms1

40

user a user i/program j program x

sub-schema a sub-schema i sub-schema z

conceptual schema

physical schema

3 Level Architecture

Databases

Page 41: dbms1

41

Name (20 characters) Address (40 characters)

NID (10 char) Designation (15 char)

Physical View

database

A.B.C. De Silva |222, Galle Road, Colombo |

650370690V|Senior Lecturer

• The DBMS must know– exact physical location– precise physical structure

Employee record

Page 42: dbms1

42

Physical View• Physical view provides the disk drives,

physical addresses, indexes and pointers.

• Physical Database Design is the responsibility of the Database Administrator (DBA). No user is concerned with this view.

• Physical devices to contain the data• Access methods to retrieve and update data• maintain and improve database performance

Page 43: dbms1

43

database

Logical View

Address 222, Galle Road, Colombo

• The user/application must know

– existence– logical reference Employee

Name A.B.C. De Silva

Designation Senior Lecturer

NID 650370690V

Page 44: dbms1

44

Logical View• This is a single logical description of all

data elements and their relationships.

• It is the result of the conceptual design which involves analysis of all users information needs and data definition of data items needs to meet them.

• SQL CREATE TABLE statement is used to define the data elements.

Page 45: dbms1

45

database

External View

Department Dept. of Computer Science

• The user/application see– authorised data– own format

Lecturer

Name A.B.C. De Silva

Designation Senior Lecturer Age 35

Page 46: dbms1

46

External View

• This consists of user views of the database.

• Each definable user group will have its own view of the database.

• Each of these views gives a user-oriented description of the data elements and relationships of which the view is composed.

Page 47: dbms1

47

• A logical description of some portion of the database that is required by a user to perform some task.

E.g. Benefit application user will view part of the employee data, excluding data such as date of birth and salary.

User View

Page 48: dbms1

48

External View

• It can be derived directly from the conceptual schema.

• The collection of all user views is the external level.

• SQL CREATE VIEW statement is used to create these views and SQL GRANT statement is used to restrict its use to a user group.

Page 49: dbms1

49

• External Views Allows to– hide unauthorised data

e.g. salary, dob

– provide user view e.g. view employee name, designation, department data taken from employee and department files

– derive new attributes

e.g. age derived from dob or nid

External View cont.

Page 50: dbms1

50

• External Views Allows to– change unit of measurement

e.g. show age in years or months

– define security levels

e.g. update access to employee file

read-only to department file

External View cont.

Page 51: dbms1

51

Mapping between Levels

• DBMS map or translate from one level to another.

External Conceptual

Conceptual Physical

• Database exists in reality only at the internal level.

Page 52: dbms1

52

user a user i/program j program x

sub-schema a sub-schema i sub-schema z

conceptual schema

physical schema

Databases

DDL

SDDL

DML/SQL

Practitioners:DBA

Users

Page 53: dbms1

53

• Data Definition Language (DDL)- is the language component of a DBMS

that defines each data element as it appears in the database.

• Sub-Schema Data Definition Language (SDDL)

- is the language component of a DBMS that defines data elements as it should appear to the end users and programmers.

Practitioners:DBA

Page 54: dbms1

54

• Data Manipulation Language (DML)- is a language associated with a DBMS

that is employed by end users and programmers to manipulate data in the database.

• Structured Query Language (SQL) - pronounced as sequel, is the standard

data manipulation for relational DBMSs.

User

Page 55: dbms1

55

Characteristics of Early DBMS

• Centralised Storage Management

• Transaction Management

• Recovery Facilities

• System Maintained Access Paths

Page 56: dbms1

56

Characteristics of Modern DBMS• Query processing and optimisation

• Transaction management

• Concurrency control

• Database recovery

• Database security and authorisation

• Distributed databases

• Data warehousing and data mining

Page 57: dbms1

57

Function of a DBMSFunctions of a DBMS are concerned with

providing efficient flexible data processing capabilities without compromising data validity.

Main Functions are:– Shared data– Control redundancy– Data integrity– Data security

Page 58: dbms1

58

Capabilities of a DBMS

Capabilities vary considerable, but basic operations are:

• Data definition

• Data entry

• Data manipulation

• Data display

Page 59: dbms1

59

Advantages• Program-data independence• Minimal data redundancy• Improved data consistency• Improved data sharing• Increased productivity of application

development• Enforcement of standards• Improved data quality• Improved data accessibility and responsiveness• Reduced program maintenance

Database Approach

Page 60: dbms1

60

• The separation of data descriptions (metadata) from the application programs that use the data.

In the database approach data descriptions are stored in a central location called the data dictionary. This property allows an organisation’s data to change and evolve (within limits) without changing the application program that process the data.

Program-Data/Data Independence

Page 61: dbms1

61

• Data files are integrated into a single, logical structure. Each primary fact is recorded (ideally) in only one place in the database.

E.g. Employee data not with the payroll and benefit files.

Note: Data redundancy is not eliminated entirely. Some data items will appear in more than one place (e.g. employee no.) to represent the relationship with others.

Minimal Data Redundancy

Page 62: dbms1

62

• By eliminating (or controlling) data redundancy, we greatly reduce the opportunities for inconsistency.

E.g. employee address is stored only once and hence we cannot have disagreement on the stored values.

• Also, updating data values is greatly simplified and have avoid the wasted storage space.

Improved Data Consistency

Page 63: dbms1

63

• A database is designed as a shared corporate resource. Authorised users are granted permission to use the database, and each user (or group of users) is provided one or more user views to facilitate this use.

E.g. employee data common to payroll, benefit applications will be shared among different users.

Improved Data Sharing

Page 64: dbms1

64

• A major advantage of the database approach is that it greatly reduces the cost and time for developing new business applications.– Programmer could concentrate on the

specific functions required for the new application, without having to worry about design or low-level implementation details; as related data have already been designed and implemented.

Increased Productivity of Application Development

Page 65: dbms1

65

– DBMS provides a number of high-level productivity tools such as forms and report generations and high-level languages that automate some of the activities of database design and implementation.

Increased Productivity of Application Development cont.

Page 66: dbms1

66

– When the database approach is implemented with full management support, the database administration function should be granted single-point authority and responsibility for establishing and enforcing data standards.

– Standards include naming conventions, data quality standards and uniform procedures for accessing, updating and protecting data.

– Powerful set of tools for developing and enforcing these standards are available for some DBMS.

Enforcement of Standards

Page 67: dbms1

67

A number of tools and processes are available to improve data quality.– Database designers can specify integrity

constraints that are enforced by the DBMS.– One of the objectives of a data warehouse

environment is to clean up operational data before they are placed in the data warehouse.

ConstraintA rule that cannot be violated by database users.

Improved Data Quality

Page 68: dbms1

68

With relational database, end users without programming experience can often retrieve and display data, even when it crosses traditional departmental boundaries.

– English-like query language SQL and query tools such as Query-By-Example provide such facilities.

Improved Data Accessibility and Responsiveness

Page 69: dbms1

69

Stored data are changed frequently for variety of reasons such as new data items types are added, and data formats change (e.g. date format from two-digit to four digit).

Data independence allows to reduce the program maintenance time.

Reduced Program Maintenance

Page 70: dbms1

70

Disadvantages• DBMS are more vulnerable than file-based

system because of the centralised nature of a large integrated database.

• If a failure occurs the recovery process is more complex and some times may results in lost transactions.

• Hardware, software and personnel cost are higher for DBMS.

Database Approach


Recommended