DATABASE CONCEPTS
A database is a collection of DATA/INFORMATION that is organized so that it can be easily accessed,
managed and updated.
In Database, Data is organized into rows, columns and tables, and it is indexed to make it easier to find
relevant information. It works like a container which contains various objects like Tables, Queries,
Reports etc. in an organized way.
Why Do We Need Database
• To manage large chunks of data: if the size of data increases into thousands of records, it will
simply create a problem to manage. The database can manage large amounts of data.
• Accuracy: Through validation rule in the database, data
• accuracy can be maintained.
• Ease of updating data: With the database, we can flexibly update the data according to our
convenience. Moreover, multiple people can also edit data at the same time.
• Security of data: With databases, we have security groups and privileges to restrict access.
• Data integrity: In databases, we can be assured of the accuracy and consistency of data due to
the built-in integrity checks and access controls.
Database Management System(DBMS)
• A DBMS refers to software that is responsible for storing, maintaining and efficiently utilizing
the database.
• A Database along with DBMS software is called a Database System.
• Examples of DBMS software are Oracle, MS SQL Server, MS Access, Paradox, DB2 MySQL etc.
• MySQL is open source and freeware DBMS.
Advantages of Database System
• Databases reduce Redundancy: It removes duplication of data because data are kept in one
place and all the application refers to the centrally maintained database.
• Database controls Inconsistency: When two copies of the same data do not agree with each
other, then it is called Inconsistency. By controlling redundancy, the inconsistency is also
controlled.
• Database facilitates Sharing of Data: Data stored in the database can be shared among
several users.
• Database ensures Security: Data are protected against accidental or intentional disclosure to
unauthorized persons or unauthorized modification.
• Database maintains Integrity: It enforces certain integrity rules to ensure the validity or
correctness of data. For ex. A date can’t be like 31/31/2000.
Data Model- Way of data representation
The data model is a model or presentation which shows How data is organized ? or stored in the
database. The data is modelled by one of the following given-
Relational Data Model: In this model, data is organized into Relations or Tables (i.e. Rows and
Columns). A row in a table represents a relationship of data to each other and is also called a Tuple or
Record. A column is called an Attribute or Field.
Network Data Model: In this model, data is represented by a collection of records and
relationship among data is shown by Links.
Hierarchical Data Model: In this model, Records are organized as Trees. Records at the top level are
called Root records and this may contain multiple directly linked children records.
Object-Oriented Data Model: In this model, records are represented as objects. The collection of
similar types of objects is called class.
RELATIONAL DATABASE
A relational database is a collective set of multiple data sets organized by tables, records and columns.
Relational databases establish a well-defined relationship between database tables. Tables
communicate and share information, which facilitates data searchability, organization and reporting.
A Relational database uses Structured Query Language (SQL), which is a standard user application
that provides an easy programming interface for database interaction.
Relational Database Terms
Relation (Table): A Relation or Table is a matrix-like structure arranged in Rows
and Columns. It has the following properties-
• Atomicity: Each column is assigned a unique name and must have an atomic(indivisible) value
i.e. a value that can not be further subdivided.
• No duplicity: No two rows of relation will be identical i.e. in any two rows value in at least one
column must be different.
• All items in a column are homogeneous with the same data type.
• Ordering of rows and columns is immaterial.
Domain: It is a collection of values from which the value is derived for a column.
Tuple / Entity / Record - The rows of a table are called Tuple or Record.
Attribute/ Field- The column of a table is called an Attribute or Field.
Degree - Number of columns (attributes) in a table.
Cardinality - Number of rows (Records) in a table
Keys In A Database
Key plays an important role in a relational database; it is used for identifying unique rows from the
table & establishes relationships among tables on need.
Types of keys in DBMS
Primary Key – A primary is a column or set of columns in a table that uniquely identifies tuples
(rows) in that table.
Candidate Key –It is an attribute or a set of attributes or keys participating for Primary Key, to
uniquely identify each record in that table.
Alternate Key – Out of all candidate keys, only one gets selected as primary key, remaining keys are
known as alternate or secondary keys.
Foreign Key – Foreign keys are the columns of a table that point to the primary key of another table.
They act as a cross-reference between tables.