Database Concepts
Database Concepts
A file can be understood as a container to store data in a computer. Files can be stored on the
storage device of a computer system. Contents of a file can be texts, computer program code,
comma separated values (CSV), etc. Likewise, pictures, audios/videos, web pages are also
files.
2) Data Redundancy - Redundancy means same data are duplicated in different places (files).
Redundancy leads to excess storage use and may cause data inconsistency also. Multiple
Entry of Same Data
3) Data Inconsistency - Data inconsistency occurs when same data maintained in different
places do not match. As the files are being maintained by different people, the changes may
not happen in one of the files.
4) Data Isolation - There is no link or mapping between various files. Where data files are
generated by different person at different times, files being created in isolation may be of
different formats.
5) Data Dependence - Data are stored in a specific format or structure in a file. Updating the
structure of a data file requires modification in all the application programs accessing that
file.
6) Controlled Data Sharing - Ideally, not every user should be able to access all the data. It is
very difficult to enforce this kind of access control in a file system
Key Concepts in DBMS
(Data will be stored in tabular format (rows and columns) known as tables or relation and
with relationship between tables.)
Relational DBMS (RDBMS) is used to store data in related tables. Rows and columns of a
table are called tuples and attributed respectively. A table is referred to as a relation. A
RDBMS uses OOP - Object Oriented Programming Principles in a DBMS.
TERMS IN A RDBMS
Table - Relation
Record/Row - Tuple
Column - Attribute
Domain - Roll - [0,1,2,3,4,5,6,7,8,9]
Name - [a-z]
• Each column in a table represents a feature (attribute) of a record. Table stores the
information for an entity whereas a row represents a record.
• Each row in a table represents a record. A tuple is a collection of attribute values that makes
a record unique.
• A tuple is a unique entity whereas attribute values can be duplicate in the table.
KEY
• Destructions on data stored in a RDBMS is applied by use of keys such as Candidate Key,
Primary Key, Composite Primary Key, and Foreign Key.
Candidate Key - A relation 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 as each of them are candidates for the primary key.
Primary key - Out of one or more candidate keys, the attribute chosen by the database designer
to uniquely identify the tuples in a relation is called the primary key of that relation.
Composite Primary Key - If no single attribute in a relation is able to uniquely distinguish the
tuples, then more than one attribute are taken together as primary key. Such primary key
consisting of more than one attribute is called Composite Primary key.
Foreign key – A foreign key is used to represent the relationship between two relations. A
foreign key is an attribute whose value.