0% found this document useful (0 votes)
9 views

Lecture 01 - Introduction To Database

Uploaded by

talha.farooq6625
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Lecture 01 - Introduction To Database

Uploaded by

talha.farooq6625
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

‫ْ‬ ‫َّ‬ ‫ٰ‬ ‫ْ‬ ‫َّ‬

‫هللا الرحمن الر ِحْ ِم‬ ‫ْ‬


‫ِبس ِم ِ‬
‫ّس ل َأ ْمري َو ْ‬
‫احللْ‬ ‫اش ْح ل َص ْدري َو َي ِّ ْ‬ ‫َر ِّب ْْ َ‬
‫َ ْ َ ُِ ي َْ‬ ‫َ‬ ‫ْ‬ ‫ً‬ ‫ي‬ ‫ِ‬ ‫ُْ َ‬
‫ان يفقهوا قو ِ يل‬ ‫عقدة ِمن ِلس ِ ي‬
Introduction to Database
Management System
Lecture # 01

Course Instructor: Adnan Rafique


Course Details

▰ Assessment
▻ Assignment: 10%
▻ Quiz: 10%
▻ Semester Project: 10%
▻ Class Participation: 05%
▻ Midterm Examination: 25%
▻ Final Examination: 40%

3
Objectives

The course aims to introduce basic database concepts,


different data models, data storage and retrieval techniques
and database design techniques. The course primarily
focuses on relational data model and DBMS concepts.

4
Pre-requisites

▰ Data Structures and Algorithms

5
Course Content – Key Topics

▰ Basic database concepts;


▰ Entity Relationship modelling
▰ Relational data model and algebra,
▰ Structured Query Language
▰ RDBMS and Database design,
▰ Functional dependencies and normal forms;
▰ Transaction processing and optimization concepts
▰ Concurrency control and recovery techniques
▰ Database security and authorization.
6
References

▰ Database Systems 8E, C.J.Date, Addison Wesley Pub.


Co. (2004).

▰ Database Systems: A Practical Approach to Design,


Implementation and Management 5E, R.Connolly and
P.Begg, Addison-Wesley Pub. Co (2009).

▰ Fundamentals of Database Systems, 5E, Elmasri and


Navathe, AddisonWesley, ISBN: 0-201-74153-9.
7
Definitions

▰ Data: Meaningful facts (that can be recorded), text,


graphics, images, sound, video segments

▻ Importance of Data?

▰ Database: An organized collection of logically related


data that represent some real word Entities

▻ If the changes are there in the real word entities


than that changes should be reflected on
database
9
Definitions

▰ Information: Data processed to be useful in decision making


▻ Extract information from data
▰ Metadata: Data that describes data

10
Data

11
Summarized data (Information)

▰ Useful information that managers can use for decision


making and interpretation

12
Metadata

▰ Descriptions of the properties or characteristics of


the data, including data types, field sizes, allowable
values, and documentation

13
What is a Database

▰ Repository of Information/Data
▻ A usually large collection of data organized
▻ especially for rapid search and retrieval (as by a
computer)
▰ What is a Database Management System
▻ A database management system (DBMS),
sometimes just called a database manager, is a
program that lets one or more computer users
create and access data in a database. E.g. MS
SQL Server, Oracle etc.

14
Lets Start with a
common problem

15
A Simple Data Management Problem:

Suppose we want to save Names, Phone Numbers…


▰ Solution 1 (Paper based)
▻ A blank notebook OR a phone/address book
▻ Entries recorded by pen, in time order
▰ Advantages
▻ Cheap, simple, private, reliable, space efficient
▰ Disadvantages
▻ Hard to search, update, share, expand
▻ Hard to add information, e.g. email addresses
16
Another approach

The Traditional File


Processing Environment

▰ Use of Note Pad, Ms. Word, MS Excel

17
The Traditional File Processing
Environment

▰ Refer to your course “C Language”


▻ Files were used to store data.
▻ Information about one Book in book.dat file is
called Record. So one record is one
structure/object with complete information that is
saved in the file.
▻ Group of all the books i.e. the information in the
whole file can be related to keyword Table. i.e.
Many records of same type are contained in a
structure called Table

18
The Traditional File Processing
Environment

▰ Before the advent of database systems, computer-


readable data was usually kept in files stored on
magnetic tape or disk.

▰ In typical file processing system, each department of


an office has its own files, usually made in Note Pad,
Binary format, Text format etc

19
Advantages of File Processing
System

▰ Free format
▰ Shareable [as a unit]
▰ Cost friendly – There is a very minimal to no set up and
usage fee for File Processing System. (In most cases, free
tools are inbuilt in computers.)
▰ Easy to use – File systems require very basic learning
and understanding, hence, can be easily used.
▰ High scalability – One can very easily switch from
smaller to larger files as per his needs. Unlimited size
(Depending on the o/s)

20
Disadvantages of File Processing
System

▰ Unstructured Data
▰ User Responsible to Store Data
▰ Slow access time
▻ Direct access of files is very difficult and one needs to
know the entire hierarchy of folders to get to a specific
file. This involves a lot of time.
▰ Presence of redundant data
▻ The same data can be present in two or more files
which takes up more disc space.
▰ It allow pre-determined access to data (Compiled Program)
▻ For each query write a whole program
21
Disadvantages of File Processing
System

▰ Inconsistent Data
▻ Due to data redundancy, same data stored at different
places might not match to each other.
▰ Data Integrity Problems
▻ Integrity means reliability and accuracy of data.
▻ The data present in the database should be consistent
and correct. To achieve this, the data should must satisfy
certain constraints.
▰ Difficulty in recovery of corrupt data
▻ Recovery or backup of lost and corrupt data is nearly
impossible in case of File Processing System.
22
Disadvantages of File Processing
System

▰ Lack of Atomicity
▻ Operations performed in the database must be
atomic i.e. either the operation takes place as a
whole or does not take place at all.
▰ Problem in Concurrent Access
▻ When a number of users operates on a common
data in database at the same time then anomalies
arise, due to lack of concurrency control.
▰ Unauthorized Access
▻ Anyone who gets access to the file can read or
modify the data.
23
Disadvantages of File Processing
System

▰ Each department working with its own data processing


staff, which sets policies or standards for the format
and maintenance of its files.

▰ If the information comes in the form of a printed report,


all the data about each new student must be reentered.

24
Examples of Database

▰ If we look around, we can find database applications


(software) for the following:
▻ Library system (NIIT Library)
▻ Plane seat reservation (PIA Reservation System)
▻ Medical records (Hospital Management System)
▻ Employment Records (ERP Systems)
▻ Student Records (Student Grades etc)
▻ Cricket Database

25
The Integrated Database Environment

▰ The Integrated Database Environment has a single


large repository of data, called the database.

▰ All data for each department is stored in a single


database.

▰A database can handle any kind of records, like text,


number, images, date, sounds etc.

26
Database

▰ A database is an organized collection of data, so that it


can be easily accessed and managed.
▻ Database, often abbreviated DB, is a collection of
data organized so that you can access, retrieve,
and use it
▻ Databases are designed to offer an organized
mechanism for storing, managing, and retrieving
information

27
The Integrated Database Environment

▰ The database in not owned by a single department, but it


is owned by the whole organization and is managed by a
single person called Database Administrator (DBA).

▰ Responsibilities of DBA
▻ Designing a database
▻ Creating a database
▻ Maintenance and updating of data

28
The Integrated Database Environment

▰ Connection/Access to the database is controlled and to


manage the data by a software package called
DATABASE MANAGEMENT SYSTEM (DBMS).

▻ e.g. Oracle , SQL Server , MySQL

29
The Integrated Database Environment

▰ Some basic features of a Database Environment


▻ A DBMS can contain multiple databases.
▻ Multiple users can access a single database.
▻ There can be multiple tables in a database.
▻ A table can contain multiple columns and rows.

30
Advantages of Integrated Database
Approach

▰ Sharing of Data
▻ Files owned by single user – DB is owned by organization
▰ Control of Redundancy
▻ Different users may have same data (Names of
UMT students)
▻ DB contains only one occurrence of same data
▰ Data Consistency
▻ Effect of eliminating redundancy. Data needs to be
updated only once at one place. Files are distributed and
data needs to be updated in all of the files.
31
Advantages of Integrated Database
Approach

▰ Improved Data Standards


▻ DBA defines organization-wide standards on how to
represent data in a database. (format, conventions)
▰ Better Data Security
▻ Files are not secure. DB can give security to the very
basic level.
▻ Remember you could not enter evaluation information
for teacher in your evaluation database after time
expired…

32
Advantages of Integrated Database
Approach

▰ Improved data Integrity


▻ DB gives DBA the power to define integrity
constraints. E.g BSCS-4 student cannot study a
course offered to BSCS-3
▻ Constraints can be within the records (Intra-
Record) or between the records (Inter-record)
▰ Balancing of Conflicting Requirements
▻ Each department has different conflicting
requirements. DB can be designed in a manner to
avoid conflicts.

33
Advantages of Integrated Database
Approach

▰ Faster Development of New Applications


▻ A well-designed DB is always modular.
▻ When a new application is purposed DB mostly
contains data for such a DB application.
▰ Better Data Accessibility
▻ Query Language support allows any user to get data
required anytime. No need for a programmer.

34
Advantages of Integrated Database
Approach

▰ More Control of Concurrency


▻ Simultaneous access by two or more users is
allowed.
▰ Better Backup and Recovery Procedures
▻ Simple backup. Imagine backing up all the files of
all the departments.

35
Disadvantages of Integrated
Database Approach

▰ High Cost of DBMS


▻ A complete database management system is very
large and sophisticated software. It is expensive to
purchase database management software.
▻ SQL Server is costs around 4,000 USD for 10 Users
▰ Higher Hardware Costs
▻ Database management systems are complicated and
heavy software's. Additional memory and processing
power may be required to run the DBMS. It may
require more powerful hardware.
▻ Cost of high end servers is more than 100K USD
36
Disadvantages of Integrated
Database Approach

▰ Higher Programming Cost


▻ DBMS is complex software with many features. The
programmers need a thorough knowledge of system to
use it to best advantage. If the organization hires
experienced database programmers, it has to pay extra
cost for this expertise.
▻ You guys wont work for FREE!

37
Disadvantages of Integrated
Database Approach

▰ High Conversion Cost


▻ If an organization converts its records to database, data
has to be converted from files to database system.
Because of the different formats used by different
systems, it may be a difficult and time-consuming
process. Moreover, the structure and data may also have
to be modified according to the requirements of DBMS.
▻ Data to be removed from files and filled into the DB
▰ More Chance of Failure
▻ In database management system, all resources and
components are centralized. If any of these components
fails, the whole system stops.
38
Disadvantages of Integrated
Database Approach

▰ Complexity & Performance


▻ Database management system is general-purpose
software. A complete DBMS has to perform many
tasks that make it complex and complicated
software. In some applications, DBMS may run less
efficiently as compared to file processing system.
▰ Slower Processing of Some Applications
▻ Sequence of records might not be there and you
may need to arrange it.

39
Disadvantages of Integrated
Database Approach

▰ Increased Vulnerability
▻ HACKERS!!!
▰ More Difficult Recovery
▻ Unlike files there are certain rules by which DB is
recovered.

40
Roles in the Integrated Database
Environment

End Users
Application
Naïve Casual Programmers DBA
Users Users

Applications Commands To
Prewritten SQL In C/C++ Create, Maintain,
Program Interface VB, Java, ASP, JSP etc modify DB

DBMS

DB
41
Roles in the Integrated Database
Environment

▰ Many people are involved in the operation of database


system.
▰ Each individual plays its own role.
▰ There are three main types.
▻ End Users
▻ Application Programmers
▻ Database Administrator (DBA)

42
Roles in the Integrated Database
Environment

End Users
▰ End users are the people who use database
application to perform their jobs.
▰ Database is created and designed for the end
users.
▰ End Users can be divided into two categories.
▻ Sophisticated users
▻ Naive users

43
Roles in the Integrated Database
Environment

▰ Sophisticated users
▻ Also called casual users.
▻ They are trained to use query language in order to access
data.
▻ We can define there access limit by creating views.
▰ Example:
▻ In the registrar office, clerks may be Naïve users, while
registrar is may be a casual user.
▻ As clerks will use application program like for printing
reports, data entry etc. Where as registrar can use query
language to ask questions like “How many new students
are registered in year 2002” 44
Roles in the Integrated Database
Environment

▰ Naive users
▻ Access data through application programs
that have been written for them.
▻ They do not required to know Query
language.

45
Roles in the Integrated Database
Environment

▰ Application Programmer
▻ Application programmer is a professional who
writes computer programs in a high level language.
These programs can be used to interact with
databases.
▻ Application programmer designs application
programs according to the requirements of the
users.
▻ He works according to the specification provided by
the system analyst.

46
Roles in the Integrated Database
Environment

▰ Database administrator
Database administrator is the most technical user. He is
responsible for managing the whole database system. He
designs, creates and maintains the database. He manages the
users who can access this database and controls integrity
issues. Some important functions of a DBA are as follows:
▻ Installation of software
▻ Monitoring of database system
▻ Solution of any problem that occurs in the database system
▻ Assigning permission to different users to use database
system
▻ Taking regular backups of database
▻ Restoring the system in case of any problem or system crash
47
Roles in the Integrated Database
Environment

▰ Database designers
▻ They design the database
▰ Database developers
▻ They create the database
▰ Database programmers
▻ They write programs needed to access the
database or tie the database to other programs
▰ Database administrators
▻ They are responsible for managing the databases
within an organization

48
JAZAK ALLAH!
Any Question?

You might also like