Topic 02 : Database & DBMS

25
TOPIC 2 : DATABASES & DBMS Er. Pradip Kharbuja

description

 

Transcript of Topic 02 : Database & DBMS

Page 1: Topic 02 : Database & DBMS

TOPIC 2 : DATABASES & DBMS

Er. Pradip Kharbuja

Page 2: Topic 02 : Database & DBMS

Metadata

Metadata is data about data.

It is the way in which the database keeps information about its own structure.

Metadata is stored in the data dictionary.

Page 3: Topic 02 : Database & DBMS

Metadata

Name Type Length Description

Student Name Character 50 Student’s name

Student ID Number 8 Unique identification number for a student

Date of Birth Date 8 Student’s date of birth in the format ’01.01.80’

Page 4: Topic 02 : Database & DBMS

Metadata in MS Access

Page 5: Topic 02 : Database & DBMS

Metadata in Oracle SQL

SQL> DESC emp

Name Null? Type

------------------------------- -------- ----

EMPNO NOT NULL NUMBER(4)

ENAME VARCHAR2(10)

JOB VARCHAR2(9)

MGR NUMBER(4)

HIREDATE DATE

SAL NUMBER(7,2)

COMM NUMBER(7,2)

DEPTNO NUMBER(2)

SQL>

Page 6: Topic 02 : Database & DBMS

Metadata in SQL Server

Page 7: Topic 02 : Database & DBMS

Metadata

Column Name Type Length NULL Key

Datatypes

1. VARCHAR2. TEXT3. INTEGER4. DECIMAL5. DATE

Page 8: Topic 02 : Database & DBMS

Activity

Define metadata for data about the following:Students in a college database

College Examination

Books in a library system

Holidays booked by a person at a workplace

Shopping Mart

Try to think about what data needs to be kept - will it be a character, date or number?

Page 9: Topic 02 : Database & DBMS

Two-File Processing System

Customer

File

User

Customer

Processing System

Rental

Processing System

Customer File

Rental File

Rental File

User

Page 10: Topic 02 : Database & DBMS

Two-File Processing System

The example used is of a car rental system.

One system processes CUSTOMER data, and the other processes RENTAL data.

Each of the files and the applications that use them are totally separate.

Although this is an improvement over older manual systems, there are a number of problems.

Page 11: Topic 02 : Database & DBMS

Problems in Two-File Processing System

1. Data are separated and isolated.

2. Data are often duplicated.

3. Problem of Data integrity

4. Application programs are dependent on file formats.

5. It is difficult to represent data in a user’s perspective.

Page 12: Topic 02 : Database & DBMS

Basic Structure of a Database

Customer

Processing

Application

Rental

Processing

Application

Other

Application

DBMS

User

User

UserDatabase

Page 13: Topic 02 : Database & DBMS

Database System in Detail

DATA

Customer

Processing

Application

Rental

Processing

Application

Other

Application Database

DBMS

User

User

User

METADATA

Database

Management

System

Application Requests

Data

Data

Data

Application Requests

Application Requests

DBMS serves as intermediary

between user and the database by translating

user requests into the complex code required

to fulfill those requests.

Application programs might be written in a programming

Language, such as Visual Basic or C++, or it might

be created through a DBMS utility e.g. Access’s forms wizard.

Page 14: Topic 02 : Database & DBMS

DBMS

DBMS serves as intermediary between user and the database by translating user requests into the complex code required to fulfill those requests.

DBMS stands for data base management system. This is a software system which facilitates the formation, maintenance as well as use of an electronic database. It permits organizations to suitably develop databases for a range of applications by database administrators and certain specialists.

Page 15: Topic 02 : Database & DBMS

Features of the Database Approach

1. Integrated data

2. Reduced data duplication

3. Program/data independence

4. Easier representation of users’ perspectives

Page 16: Topic 02 : Database & DBMS

Common Applications

1. Forms

2. Reports

3. Web-applications

4. Desktop Applications

Page 17: Topic 02 : Database & DBMS

DBMS – Architecture

• The DBMS is the software that handles all the interactions between applications and the database.

• Paul Benyon-Davis provides a useful way of looking at the structure of the DBMS itself i.e. DBMS Architecture.

• 3 layers

1. Kernel

2. Interface

3. Toolkit

Page 18: Topic 02 : Database & DBMS

Kernel, Interface and Toolkit

DBMS Toolkit

Interface

DBMS Kernel

Database

Page 19: Topic 02 : Database & DBMS

Kernel, Interface and Toolkit

1. Kernel Central engine, which operates most of the core data management functions

2. Toolkit The tools and applications that interact with the end-users.

These might be provided as part of the DBMS product or as separate piece of software.

3. Interface It handles the interaction between the toolkit and the kernel

Page 20: Topic 02 : Database & DBMS

DBMS Functions

1. CRUD functions

2. Data dictionary

3. Transaction management

4. Concurrency control

5. Recovery

6. Authorization

7. Data integrity

8. Administration utilities

Page 21: Topic 02 : Database & DBMS

Advantages of DBMS

Control of data redundancy

Improved data integrity or Data consistency

Sharing of data

Improved security

Enforcement of standards

Improved data accessibility and responsiveness

Improved maintenance

Increased concurrency

Improved backup and recovery services

Page 22: Topic 02 : Database & DBMS

Disadvantages of DBMS

Complexity

Size

Cost of DBMSs

Additional hardware costs

Cost of conversion

Performance

Requires skilled manpower

Page 23: Topic 02 : Database & DBMS

Data Models

Hierarchical

Network

Relational

Object-oriented

Deductive

Post-relational

Page 24: Topic 02 : Database & DBMS

References

http://www.ask.com/question/what-is-a-dbms

http://en.wikipedia.org/wiki/Microsoft_SQL_Server

Page 25: Topic 02 : Database & DBMS

ANY QUESTIONS?

http://www.pradipkharbuja.com.np/softwarica/database/