Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 42

Lecture 2 & 3

Database Systems I
COMSATS UNIVERSITY ISLAMABAD, WAH CAMPUS
In this
lecture
Introduction to Data
Database Management System (DBMS)
Data Application Programs

2
Introduction to
Data
“Data is facts and statistics collected together for reference or
analysis. ”
- Oxford Dictionary

3
Forms of
Data
Data can exist in a variety of forms — as numbers or text on pieces of
paper, as bits and bytes stored in electronic memory, or as facts
stored in a person's mind

4
Data vs
Information
Data requires interpretation(explaination) to become
information
Data becomes information when it is viewed in context or in
post-analysis
Data is arranged relationally to become information, which
is much more useful to users

5
Data in
Database
Refers to all the single items that are stored in a database,
either individually or as a set
Data in a database is primarily stored in database tables
It is organized into columns that dictate the data types
stored therein

6
Databas
e
A shared collection of logically related data and its
description, designed to meet the information needs of an
organization.

7
Database Management
System
A software system that enables users to define,
create, maintain, and control access to the database

8
Database Example
(Netflix)
launched on April 14, 1998, as the world's first online DVD
rental store
Provides subscription-based streaming
As of January 2019, Netflix had over 139 million paid
subscriptions worldwide
Netflix Media DataBase (NMDB) — a highly queryable data
system
9
Database Example
(Facebook)
Social Networking site
World’s 3rd most visited website
Has 80 million business pages
2.32 billion monthly active users
220 million new photos per week
Multiple databases: MYSQL, MEMCHACHED, HAYSTACK,
CASSANDRA, SCRIBE, HIPHOP
10
Examples of
Database
Google: BigTable
Youtube: Vitess
Amazon: DynamoDB
Instagram: Postgre SQL, Cassandra
FlipKart: NOSQL

11
Traditional Approach of storing
data
File Based Systems
A collection of application programs that perform services for
the end-users, such as the production of reports. Each program
defines and manages its own data

12
Example of Traditional
Database
The Sales Department fo a real estate office is responsible
for the selling and renting of properties
The Contracts Department is responsible for handling the
lease agreements associated with properties for rent

13
Files of Sales
Department

14
Files of Contracts
Department

15
Limitations of file-Based
-System
Separation and isolation of data
Duplication of data
Data dependence
Incompatible file formats
Fixed queries

16
Drawbacks of File-Based
-System
The definition of the data is embedded in the application
programs, rather than being stored separately and
independently
There is no control over the access and manipulation of
data beyond that imposed by the application programs.

17
Solutio
n
Using Database appraoch instead of File Based System
Database Management System for its management
Database Applications to help users

18
Databases for storing
data
Self-describing collection of integrated records
A single, possibly large repository of data
All data items are integrated with a minimum amount of
duplication

19
Logical Relations in
Database
Entities: a distinct object in the organization that is to be
represented in the database
Attribute: a property that describes some aspect of the
object that we wish to record
 Relationships: an association between entities

20
ERD (Entity Relationship
Diagram)

21
Shared Approach of
Database
Can be used simultaneously by many departments and
users
Holds not only the organization’s operational data, but also
a description of this data

22
System
Catalog
Data Dictionary or Metadata
Data about data and data descriptions
Self-describing nature of a database that provides program–
data independence

23
Data Separation in
Database
The database approach separates the structure of the data
from the application programs
New data structures can be added or existing structures can
be modified
The application programs are unaffected, provided that they
do not directly depend upon what has been modified

24
Database Management
System
DBMS is used to manage and control the access of the
database
The DBMS is the software that interacts with the
users’
application programs and the database

25
Database Management
System
Facilities provided by the DBMS
- Data Definition Language (DDL)
- Data Manipulation Language (DML)
- Data Control Language (DCL)
- Transaction Control Language (TCL)

26
Data Definition Language
(DDL)
used to create and modify the structure of database objects
in database
- CREATE – Creates objects in the database
- ALTER – Alters objects of the database
- DROP – Deletes objects of the database
-TRUNCATE – Deletes all records from a table and resets
table identity to initial value.

27
Data Manipulation Language
(DML)
used to retrieve, store, modify, delete, insert and update
data in database
- SELECT – Retrieves data from a table
- INSERT – Inserts data into a table
- UPDATE – Updates existing data into a table
- DELETE – Deletes all records from a table

28
Data Control Language
(DCL)
used to create roles, permissions, and referential integrity
as well it is used to control access to database by securing it
- GRANT – Gives user’s access privileges to database
- REVOKE – Withdraws user’s access privileges to database
given with the GRANT command

29
Transaction Control Language
(TCL)
used to manage different transactions occurring within a
database
- COMMIT – Saves work done in transactions
-ROLLBACK – Restores database to original state since the
last COMMIT command in transactions
- SAVE TRANSACTION – Sets a savepoint within a
transaction
30
Advantages of access control in
DBMS
Provides a
◦Security system
◦Integrity system
◦Concurrency control
system
◦Recovery control system
◦User-accessible catalog

31
Database Application
Programs
A computer program that interacts with the database by
issuing an appropriate request (typically an SQL statement)
to the DBMS

32
Database Processing
Overview

33
View
s
View is some subset of the database
Reduces complexity by letting users see the data in the way
they want to see

34
View
s
Views provide a level of security
Views provide a mechanism to customize the appearance of
the database
View can present a consistent, unchanging picture of the
structure of the database

35
DBMS
Environment
Components of DBMS Environment

36
Roles in DBMS
Environment
Data and Database Administrators
Database Designers
Application Developers
End-Users

37
Logical Vs. Physical Database
designers
1.Logical database modeling is mainly for gathering information
about business needs and does not involve designing a
database; whereas physical database modeling is mainly
required for actual designing of the database.
2.Logical database modeling does not include indexes and
constraints; the logical database model for an application can be
used across various database software and implementations;
whereas physical database modeling is software and hardware
specific and has indexes and constraints.
3.Logical database modeling includes; ERD, business process
diagrams, and user feedback documentation; whereas physical
database modeling includes; server model diagram, database
design documentation, and user feedback documentation.
38
Advantages of
DBMSof data redundancy
Control
Data consistency
More information from the same amount of data
Sharing of data
Improved data integrity
Improved security
Enforcement of standards
39
Advantages of
DBMS of scale
Economy
Balance of conflicting requirements
Improved data accessibility and responsiveness
Increased productivity
Improved maintenance through data
independence
Increased concurrency
Improved backup and recovery services
40
Disadvantages of
DBMS
Complexity
Size
Cost of
DBMSs
Additional hardware costs
Cost of conversion
Performance
Greater impact of a
41
Database
System
Collection of application programs that interact with the
database along with the DBMS and the data itself

42

You might also like