Database Concepts
Database Concepts
(a) Data
Data is a collection of raw facts that are stored and used inside a database in order to form
meaningful information. Data can also be described as facts, and figures that we store or use.
They can be represented in form of numbers, text strings, sound video, document, etc. example is
a report. In computing, data can be described as information that has been translated into a form
that is move convenient to move or process.
(b) Character
These are digits, letters or special symbols. They do not make any meaning until they are brought
together. Example “F” ”A” ”M” ”I” ”L” ”Y”. The word “family” has six characters.
(c) Field
Fields are consecutive columns of positions reserved for a specific kind of data. Example:
(d) Record
A record is a collection of fields possibly of different data types typically in fixed number and
sequence. Records are composed of fields each of which contains one item of information.
Example: the employee table above contains three fields which are the last name field, the first
name field, and the phone number field. It also has three records.
(e) File
A file is a collection of related records. It is a major grouping of data that contains information of
specific types. Examples of file in database management system include students file, subject file,
result file, e.t.c. different types of files store different types of information. E.g program files
store programs whereas text files store text.
(f) Database
A database is an integral collection of data, records, files, and other objects. It is a collection of
data, information that is specifically organized for rapid search, and retrieval by a computer. The
tables in a database are linked with primary and foreign keys. These keys are used to establish
relationships among the tables.
Example of a database
Structured query language (SQL) which is the only language the database understands is used to query
the database. It is used to insert, update, delete, and perform other operations on the database.
(g) Database Management System
A database management system is a software package with computer programs that controls the
creation, maintenance, and use of a database.
Goals of Database Management System
The goals of DBMS are:
(a) Provide for mass storage of relevant data
(h) Protect the data from physical harm and unauthorized access.
(a) Hierarchical
Hierarchical database is the oldest and simplest kind of database. It arranges data in a "tree like"
structure, which is similar to folders and files on a computer. Just as related files on a computer are
grouped in folders, every record in the hierarchical database has one "parent". Hierarchical Database
Model defines hierarchically-arranged data. In this tree, a single tree acts as the "root" of the database
from which other trees "branch" out. Relationships in such a system are thought of in terms of
children and parents such that a child may only have one parent but a parent can have multiple
children. Parents and children are tied together by links called "pointers" (perhaps physical addresses
inside the file system). A parent will have a list of pointers to each of their children.
Applications of hierarchical model :
(a) Hierarchical models are generally used as semantic models in practice as many real-world
occurrences of events are hierarchical in nature like biological structures, political, or social
structures.
(b) Hierarchical models are also commonly used as physical models because of the inherent
hierarchical structure of the disk storage system like tracks, cylinders, etc. There are various
examples such as Information Management System (IMS) by IBM, NOMAD by NCSS, etc.
Example 1: Consider the below Student database system hierarchical model.
In the above-given figure, we have few students and few course-enroll and a course can be assigned
to a single student only, but a student can enroll in any number of courses and with this the
relationship becomes one-to-many. We can represent the given hierarchical model like the below
relational tables:
FACULTY Table
Name Dep Course-taught
John CSE CA
Jake CSE SE
STUDENT Table
Gami CA 2.0
Mary SE 3.0
Maye
n SE 4.0
Example 2: Consider the below cricket database system hierarchical model scheme.
This database model can have one-to-one (1:1) or many-to-one (m:1) relationship.
This model was formalized by the Database Task group in the 1960s. This model is the
generalization of the hierarchical model. This model can consist of multiple parent segments and
these segments are grouped as levels but there exists a logical association between the segments
belonging to any level. Mostly, there exists a many-to-many logical association between any of
the two segments. We called graphs the logical associations between the segments. Therefore,
this model replaces the hierarchical tree with a graph-like structure, and with that, there can more
general connections among different nodes. It can have m:m relations i.e, many-to-many which
allows a record to have more than one parent segment.
Here, a relationship is called a set, and each set is made up of at least 2 types of record which are
given below:
In the above figure, member TWO has only one owner ‘ONE’ whereas member FIVE has two
owners i.e, TWO and THREE. Here, each link between the two record types represents 1 : M
relationship between them. This model consists of both lateral and top-down connections between
the nodes. Therefore, it allows 1: 1, 1 : M, M : N relationships among the given entities which
helps in avoiding data redundancy problems as it supports multiple paths to the same record.
There are various examples such as TOTAL by Cincom Systems Inc., EDMS by Xerox Corp.,
etc.
Example : Network model for a Finance Department.
(a) This model is very simple and easy to design like the hierarchical data model.
(b) This model is capable of handling multiple types of relationships which can help in modeling
real-life applications, for example, 1: 1, 1: M, M: M relationships.
(c) In this model, we can access the data easily, and also there is a chance that the application can
access the owner’s and the member’s records within a set.
(d) This network does not allow a member to exist without an owner which leads to the concept of
data integrity.
(e) Like a hierarchical model, this model also does not have any database standard,
(a) The schema or the structure of this database is very complex in nature as all the records are
maintained by the use of pointers.
(b) There’s an existence of operational anomalies as there is a use of pointers for navigation which
further leads to complex implementation.
(c) The design or the structure of this model is not user-friendly.
(d) This model does not have any scope of automated query optimization.
(e) This model fails in achieving structural independence even though the network database model is
capable of achieving data independence.
Network Database model was designed to solve some of the more serious problems with the
Hierarchical Database Model. Specifically, the Network model solves the problem of data
redundancy by representing relationships in terms of sets rather than hierarchy. The network model is
very similar to the hierarchical model actually. In fact, the hierarchical model is a subset of the
network model. However, instead of using a single-parent tree hierarchy, the network model uses set
theory to provide a tree-like hierarchy with the exception that child tables were allowed to have more
than one parent. This allowed the network model to support many-to-many (m:m) relationships.
Visually, a Network Database looks like a hierarchical Database in that you can see it as a type of
tree. However, in the case of a Network Database, the look is more like several trees which share
branches. Thus, children can have multiple parents and parents can have multiple children.
The relational model represents how data is stored in Relational Databases. A relational database
stores data in the form of relations (tables). Consider a relation STUDENT with attributes
ROLL_NO, NAME, ADDRESS, PHONE, and AGE shown in Table 1.
STUDENT
4 SURESH DELHI 18
IMPORTANT TERMINOLOGIES
(a) Attribute: Attributes are the properties that define a relation. e.g.; ROLL_NO, NAME
(b) Relation Schema: A relation schema represents the name of the relation with its attributes. e.g.;
STUDENT (ROLL_NO, NAME, ADDRESS, PHONE, and AGE) is the relation schema for
STUDENT. If a schema has more than 1 relation, it is called Relational Schema.
(c) Tuple: Each row in the relation is known as a tuple. The above relation contains 4 tuples, one of
which is shown as: