You are on page 1of 39

Database Management System

IT 108
Database Management System (DBMS)
• Data - the foundation of technological activity

• Database - a highly organized collection of assembled


data

• Database Management System - sophisticated software


that controls the database and the database environment
What is Data?
• Data- refers to all the single items that are stored in a
database, either individually or as a set.
• A single piece of data is a single fact about something.
What is Data (Cont.)

 Shepherds kept track of their flocks with pebbles.


 A primitive but legitimate example of data storage and
retrieval.
Using Data for Competitive Advantage
• Datahas become necessary for every kind of modern business
and government organization.
• Datais a corporate resource, possibly the most important
corporate resource.
• Data can give a company a crucial competitive advantage.
Problems in Storing and Accessing Data
• Difficult
to store and provide efficient,
accurate access to a company’s data.
What is Database?
• A database
is an organized collection of structured
information, or data, typically stored in a computer
system
• They support electronic storage and manipulation of
data.
• Databases make data management easy.
Data Accuracy
• Refersto error-free records that can be used as a
reliable source of information.
Backup and Recovery
• Theability to reconstruct data if it is lost or
corrupted.
Data Security and Privacy
• Involvesa company in protecting its data from theft,
malicious destruction, and deliberate attempts at making
phony changes to the data.
What is Database Management System?
• is
defined as a software system that allows the user to
define, create and maintain the database and provide
control access to the data.
• It
is a collection of programs used for managing data
and simultaneously it supports different types of users to
create, manage, retrieve, update, and store information.
Purpose of DBMS
• Data into information.
• Information into knowledge.
• Knowledge to action.

DATA KNOWLEDGE

INFORMATION ACTION
School Management System
• Application program examples
 Add new students, instructors, and courses
 Register students for courses, and generate class
rosters
 Assign grades to students, compute grade point
averages (GPA) and generate transcripts
Relational Model
Relational Model (RM) represents the database as a collection of
relations. A relation is a table of values.

Every row in the table represents a collection of related data values.


These rows in the table denote a real-world entity or relationship.
Some popular Relational Database management systems are:
• DB2 and Informix Dynamic Server – IBM
• Oracle and RDB – Oracle
• SQL Server and Access – Microsoft
Relational Model
Relational Model
1. Attribute - Attributes are the properties that define a relation. e.g., SID,
SName,etc.

2. Tables(Relation) – In the Relational model the, relations are saved in


the table format. It is stored along with its entities. A table has two
properties rows and columns. Rows represent records and columns
represent attributes.

3. Tuple – It is nothing but a single row of a table, which contains a single


record.

4. Column: The column represents the set of values for a specific attribute.
Database Management Keys
Different Types of Keys in the Relational Model
1.Candidate Key
2.Primary Key
3.Super Key
4.Alternate Key
5.Foreign Key
6.Composite Key
Candidate Key

The minimal set of attributes that can uniquely identify a tuple is known as a
candidate key.

• It is a super key with no repeated data is called a candidate key.


• The minimal set of attributes that can uniquely identify a record.
• It must contain unique values but it can contain NULL values.
• Every table must have at least a single candidate key.
• A table can have multiple candidate keys but only one primary key (the
primary key cannot have a NULL value, so the candidate key with a NULL
value can’t be the primary key).
• The value of the Candidate Key is unique and may be null for a tuple.
• There can be more than one candidate key in a relationship.
Primary Key

There can be more than one candidate key in relation


out of which one can be chosen as the primary key.

• It is a unique key.
• It can identify only one tuple (a record) at a time.
• It has no duplicate values, it has unique values.
• It cannot be NULL.
Super Key

The set of attributes that can uniquely identify a tuple is


known as Super Key. A super key is a group of single or
multiple keys that identifies rows in a table. It supports
NULL values.

• Adding zero or more attributes to the candidate key


generates the super key.
•A candidate key is a super key but vice versa is not
true.
Levels of Abstraction
Alternate Key

The candidate key other than the primary key is called


an alternate key.

• All the keys which are not primary keys are called
alternate keys.
• It is a secondary key.
• It
contains two or more fields to identify two or more
records.
• These values are repeated.
Foreign Key

is a set of attribute(s) in a table that refers to


the primary key of another table

• It links two or more relations (tables) at a time.


• They act as a cross-reference between the tables.
Foreign Key
Composite Key
Sometimes, a table might not have a single column/attribute that
uniquely identifies all the records of a table. To uniquely identify
rows of a table, a combination of two or more columns/attributes
can be used. It still can give duplicate values in rare cases. So, we
need to find the optimal set of attributes that can uniquely identify
rows in a table.

• It acts as a primary key if there is no primary key in a table


• Two or more attributes are used together to make a composite
key.
• Different combinations of attributes may give different accuracy
in terms of identifying the rows uniquely.
Levels of Abstraction

• Physical level

• Logical level

• View level
Physical or Internal Level

Defines how the data is actually


stored, it defines data structures to
store data and access methods used
by the database.
Logical or Conceptual Level

It describes what data is stored in


the database and what relationship
exists among those data.
View or External Level

In view level, there are different


levels of views and every view only
defines a part of the entire data. It
also simplifies user interaction and
provides many views or multiple
views of the same database.
Drawbacks of using file systems to store
data
• Data redundancy and inconsistency
• Difficulty in accessing data
• Data isolation
• Integrity problems
Drawbacks of using file systems to store
data (Cont.)
• Atomicity of updates
• Concurrent access by multiple users
• Security problems
Advantages of DBMS over File system
• Data redundancy and inconsistency: Redundancy is the concept of repetition
of data i.e. each data may have more than a single copy.
• Data sharing: The file system does not allow sharing of data or sharing is too
complex. Whereas in DBMS, data can be shared easily due to a centralized
system.
• Data concurrency: Concurrent access to data means more than one user is
accessing the same data at the same time.
• Data searching: A different application program must be written for every
search operation performed on the file system. While DBMS provides inbuilt
searching operations. The user only has to write a small query to retrieve data
from the database.
• Data integrity: There may be cases when some constraints need to be applied
to the data before inserting it into the database.
Advantages of DBMS over File system
• System crashing: In some cases, systems might have crashed due to
various reasons.
• Data security: A file system provides a password mechanism to
protect the database but how long can the password be protected? No
one can guarantee that. This doesn’t happen in the case of DBMS.
• Backup: It creates a backup subsystem to restore the data if required.
• Interfaces: It provides different multiple user interfaces like
graphical user interface and application program interface.
• Easy Maintenance: It is easily maintainable due to its centralized
nature.
Uses of DBMS
• Data independence and efficient access of data.
• Application Development time reduces.
• Security and data integrity.
• Uniform data administration.
• Concurrent access and recovery from crashes.
Impact of Databases and Database
System
Click icon to add picture

You might also like