DATABASE
A database is a. collection of interrelated data.
It not only allows to store but also allows us
modification of data, as per requirements.
DBMS
• DBMS refers to Database Management System
• Tt is a. software that can be used for creating,
storing, manipulating, maintaining and retrieving
data from database by users or application
programs.
• Some examples of open source and
commercial DBMS include MySQL, Oracle,
PostgreSQL, SQL Server, Microsoft Access,
MongoDB.
NEED OF DBMS
n
Database reduces redundancy
Redundancy means same data are duplicated in different
places (files). It removes redundancy as the
the data are stored at one place and all the application
refers to the centrally maintained database.
n
Database controls inconsistency
Data inconsistency occurs when same data
maintained in different places do not match. By
controlling redundancy, the inconsistency is also
controlled.
n Database facilitates sharing of data
Data stored in the database can be shared among several
users.
NEED OF DBMS
n Database ensures security
Data, are protected against,
accidental or
intentional disclosure to
unauthorized person or unauthorized
modification.
n Database maintains
integrity
Tt enforces certain integrity rules to
ensure the validity or correctness of
data.
n Database enforces standard
COMPONENTS COMPRISING A TABEL
Data. Ttem: smallest, unit, of named data. Tt
represent, one tvne of information and often
referred to as a. field or column information
Record: collection of data, items or fields which
represent a. complete unit of information
Table: collection of all Rows and Columns.
COMMONLY USED TERMINOLOGIES
TN RELATIONAL DATA MODEL
n
Domain
It is a set of values from which an attribute can take a value
in each row. Usually, a data type is used to specify domain
for an attribute.
n Tnnle / Entity / Record
Each row of data in a relation (table) is called a tuple.
n
Attribute / Field
The columns of a relation are the attributes which are also
referred as fields
n
Degree
The number of attributes or fields in a relation is called the
Degree of the relation
n
Cardinality
The number of tuples or records in a relation is called the
cardinality of the relation
KEYS IN A RELATIONAL DATABASE
n Primary Key uniquely identify a. record in the relation is " A set of
one or more attribute(s) that can
called Primary Key
■ There can be only one primary key in a table.
■ A primary key accepts only distinct (non duplicate) values and
cannot be left blank.
KEYS IN A RELATIONAL DATABASE
n Candidate Key
■ A table can have one or more attributes that takes distinct
values. Any of these attributes can be used to uniquely
identify the tuples in the relation. Such attributes are called
candidate keys.
■ A Primary Kev is one of the candidate keys.
■ A table may have more than one candidate keys but
definitely has one and only one primary key.
KEYS IN A RELATIONAL DATABASE
n Alternate Keys
■ Only one of the Candidate keys is selected as the
primary key of a. table. All other candidate keys are
called Alternate keys.
KEYS IN A RELATIONAL DATABASE
n Foreign Key
■ A foreign key is used to represent, the relationship between
two tables.
REFERENTIAL INTEGRITY
The property of a relational database which ensures that no
entry in a. foreign key column of a table can be made
unless it matches a primary key value in the
corresponding column of the related table is called
referential integrity.
THANK