Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 25

Database Management

(Basic Concepts)
What is Data-items/Fields?
● A data-item is a single fact about something that
interests us.

● A fact can be any characteristic of an object.


Entities

● Entity - a “thing” or “object” in our environment that


we want to keep track of or for which relevant
information is stored.

● Entity set - A collection of entities of the same type


(e.g., all of the company’s employees).
Attributes/Fields

● Attribute - a property of, a characteristic of, or a fact


that we know about an entity.

● Some attributes have unique values within an entity


set.
Records and Files

key
fiel
d

● Records /Tuples- each row of a structure like above

● Fields/Attributes - the columns, representing the facts

● File/Relation/Table - the entire structure


Records and Tables

● Record type - a structural description of each and every


record in the Table
● Record occurrence / Record instance - a specific
record of the salesperson file
What is a database ?
A database is a collection of related information
stored so that it is available to many users for
different purposes

What is a DBMS?

A DBMS is a combination of hardware and software


that can be used to set up and monitor a database, and
can manage the updating and retrieval of database
that has been stored in it.
DBMS as an interface between
physical database and Users’ Requests

Queries

Operating Database
DBMS
System

COBOL/C
DBMS facilities
● Creating a Table addition to data, deletion of data, modification of data;
creation, addition and deletion of entire tables

● Retrieving data collectively or selectively

● The data stored can be stored or indexed at the user’s discretion and
direction

● Various reports can be produced from the system. These may be either
standardized report or that may be specifically generated according to
specific user definition.

● Mathematical functions can be performed and the data stored in the


database can be manipulated with these functions to perform the desired
calculations

● To maintain data integrity and database use


Advantages of DBMS

1. Reduction of Redundancies
2. Sharing Data
3. Data Integrity
4. Data Security
5. Conflict Resolution
6. Data Independence
Disadvantages of DBMS
● Cost

● Backup and recovery operations are fairly


complex in a DBMS environment

● Centralization of data increases the potential


severity of security breaches and disruption
due to downtimes and failures
ACID Properties in DBMS

1. Atomicity : Atomicity ensures that each transaction is treated as a


single "unit", which either succeeds completely, or fails completely.

2. Consistency : It ensures that a transaction can only bring the database


from one valid state to another, maintaining database invariant.

3. Isolation : Transactions are often executed concurrently (e.g.,


reading and writing to multiple tables at the same time). Isolation
ensures that concurrent execution of transactions leaves the database in
the same state that would have been obtained if the transactions were
executed sequentially.

4. Durability : Durability ensures that once a transaction has been


committed, it will remain committed even in the case of a system failure
(e.g., power outage or crash). This usually means that completed
transactions (or their effects) are recorded in non-volatile memory.
KEY Concepts
Classification of Data Models

Data Models

Object- Record –
based based
logical logical
models models

The E/R The The The The The


Model Binary Semantic Hierarchical Network Relational
Model Model Model Model Model
Relational Model
• In 1970, E. F. Codd published “A Relational Model of Data for
Large Shared Data Banks” in CACM.

• In the early 1980s, commercially viable relational database


management systems became available.

• While relational database was very tempting in concept in the


1970s, it was not easily applicable in a real-world environment
for reasons related to performance.

• The earlier hierarchical and network database management


systems were just coming onto the commercial scene and were
the focus of intense marketing efforts by the software and
hardware vendors.
Relational Terminology
• Relations - what we have been referring to as
simple linear files. Also called tables.

• Row = record = tuple

• Column = field = attribute


Relational Database Terminology
File / Relation: Differences
• The columns of a relation can be arranged in
any order without affecting the meaning of the
data. This is not true of a file.

• The rows of a relation can be arranged in any


order, which is not true of a file.
File / Relation: Differences
• Every row/column position (a cell) can have
only a single value, which is not necessarily
true in a file.

• No two rows of a relation are identical, which


is not necessarily true in a file.
Primary Key
• A relation always has a unique primary key.

• A primary key (also called “the key”) is an


attribute or a group of attributes whose values
are unique throughout all of the rows of the
relation.
Primary Key
Primary Key
• The number of attributes involved in the
primary key is always the minimum number of
attributes that provide the uniqueness quality.

• In the worst case, all of the relation’s attributes


combined could serve as the primary key.
Candidate Key
• If a relation has more than one attribute or
minimum group of attributes that represents a
way of uniquely identifying the entities, then
they are each called a candidate key.

• When there is more than one candidate key,


one of them must be chosen to be the primary
key of the relation.
Candidate Key

• Which candidate key to


pick depends on the
application using the
database.

• Alternate key is a
candidate key that was
not chosen to be the
primary key of the
relation.
Foreign Key

• An attribute or group of attributes that serves as the primary


key of one relation and also appears in another relation
(foreign key in this relation).

You might also like