0% found this document useful (0 votes)
20 views

RDBMS Unit-1

1. #DBMSIntroduction: Introduction to the Database Management System (DBMS) concept and its significance. 2. #DatabaseManagementSystem: A system for managing databases, facilitating storage, retrieval, and manipulation of data. 3. #DBMSCharacteristics: Characteristics that define the nature and functionality of a DBMS. 4. #DBMSAdvantages: Benefits and advantages of using a DBMS for data management. 5. #ThreeSchemaArchitecture: The architectural framework consisting of external, conceptual
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

RDBMS Unit-1

1. #DBMSIntroduction: Introduction to the Database Management System (DBMS) concept and its significance. 2. #DatabaseManagementSystem: A system for managing databases, facilitating storage, retrieval, and manipulation of data. 3. #DBMSCharacteristics: Characteristics that define the nature and functionality of a DBMS. 4. #DBMSAdvantages: Benefits and advantages of using a DBMS for data management. 5. #ThreeSchemaArchitecture: The architectural framework consisting of external, conceptual
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….

Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103


UNIT-1

RDBMS
 Introduction to Database Management System
 Characteristics of database approach
 Advantages of DBMS
 Schemas: Three schema architecture - The external level, the conceptual level
and the internal level.
 Data Independence
 Database languages and Interfaces
 Roles of Database Administrator
 Introduction to Data Models (Hierarchical, Network and Relation)
 Entity type, Entity sets, Attributes and keys.
 The ER Model: `

# INTRODUCTION TO DBMS
The database is a collection of inter-related data which is used to retrieve, insert and delete the data
efficiently. It is also used to organize the data in the form of a table, schema, views, and reports, etc.
Some Other Definitions are-
 Database management system is a software which is used to manage the database. For
example: MySQL, Oracle, etc are a very popular commercial database which is used in
different applications.
 DBMS provides an interface to perform various operations like database creation,
storing data in it, updating data, creating a table in the database and a lot more.
 It provides protection and security to the database. In the case of multiple users, it also
maintains data consistency.

DBMS allows users the following tasks:


 Data Definition: It is used for creation, modification, and removal of definition that
defines the organization of data in the database.
 Data Updation: It is used for the insertion, modification, and deletion of the actual
data in the database.
 Data Retrieval: It is used to retrieve the data from the database which can be used
by applications for various purposes.
 User Administration: It is used for registering and monitoring users, maintain data
integrity, enforcing data security, dealing with concurrency control, monitoring
performance and recovering information corrupted by unexpected failure.

1
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Characteristics of DBMS
1. It uses a digital repository established on a server to store and manage the
information.
2. It can provide a clear and logical view of the process that manipulates data.
3. DBMS contains automatic backup and recovery procedures.
4. It contains ACID properties which maintain data in a healthy state in case of failure.
5. It can reduce the complex relationship between data.
6. It is used to support manipulation and processing of data.
7. It is used to provide security of data.
8. It can view the database from different viewpoints according to the requirements of
the user.

Advantages of DBMS
1. Controls database redundancy: It can control data redundancy because it stores all
the data in one single database file and that recorded data is placed in the database.
2. Data sharing: In DBMS, the authorized users of an organization can share the data
among multiple users.
3. Easily Maintenance: It can be easily maintainable due to the centralized nature of
the database system.
4. Reduce time: It reduces development time and maintenance need.
5. Backup: It provides backup and recovery subsystems which create automatic
backup of data from hardware and software failures and restores the data if
required.
6. multiple user interface: It provides different types of user interfaces like graphical
user interfaces, application program interfaces

Disadvantages of DBMS
1. Cost of Hardware and Software: It requires a high speed of data processor and
large memory size to run DBMS software.
2. Size: It occupies a large space of disks and large memory to run them efficiently.
3. Complexity: Database system creates additional complexity and requirements.
4. Higher impact of failure: Failure is highly impacted the database because in most
of the organization, all the data stored in a single database and if the database is
damaged due to electric failure or database corruption then the data may be lost
forever.

2
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

#TYPES OF DATABASES
There are various types of databases used for storing different varieties of data:

1) Centralized Database
It is the type of database that stores data at a centralized database system. It comforts the users to
access the stored data from different locations through several applications. These applications
contain the authentication process to let users access data securely. An example of a Centralized
database can be Central Library that carries a central database of each library in a
college/university.
Advantages of Centralized Database
 It has decreased the risk of data management, i.e., manipulation of data will not affect the
core data.
 Data consistency is maintained as it manages data in a central repository.
 It provides better data quality, which enables organizations to establish data standards.
 It is less costly because fewer vendors are required to handle the data sets.
Disadvantages of Centralized Database
 The size of the centralized database is large, which increases the response time for fetching
the data.
 It is not easy to update such an extensive database system.
 If any server failure occurs, entire data will be lost, which could be a huge loss.
2) Distributed Database
Unlike a centralized database system, in distributed systems,
data is distributed among different database systems of an
organization. These database systems are connected via
communication links. Such links help the end-users to access
the data easily. Examples of the Distributed database are
Apache Cassandra, HBase, Ignite, etc.
1. Homogeneous DDB: Those database systems which
execute on the same operating system and use the same
application process and carry the same hardware devices.
2. Heterogeneous DDB: Those database systems which
execute on different operating systems under different
application procedures, and carries different hardware
devices.

3
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Advantages of Distributed Database


 Modular development is possible in a distributed database, i.e., the system can be expanded
by including new computers and connecting them to the distributed system.
 One server failure will not affect the entire data set.

3) Relational Database
This database is based on the relational data model, which stores data in the form of rows(tuple) and
columns(attributes), and together forms a table(relation). A relational database uses SQL for storing,
manipulating, as well as maintaining the data. E.F. Codd invented the database in 1970. Each table
in the database carries a key that makes the data unique from others. Examples of Relational
databases are MySQL, Microsoft SQL Server, Oracle, etc.
Properties of Relational Database
There are following four commonly known properties of a relational model known as ACID
properties, where:
 A means Atomicity: This ensures the data operation will complete either with success or
with failure. It follows the 'all or nothing' strategy. For example, a transaction will either be
committed or will abort.
 C means Consistency: If we perform any operation over the data, its value before and after
the operation should be preserved. For example, the account balance before and after the
transaction should be correct, i.e., it should remain conserved.
 I means Isolation: There can be concurrent users for accessing data at the same time from
the database. Thus, isolation between the data should remain isolated. For example, when
multiple transactions occur at the same time, one transaction effects should not be visible to
the other transactions in the database.
 D means Durability: It ensures that once it completes the operation and commits the data,
data changes should remain permanent.

4) NoSQL Database
Non-SQL/Not Only SQL is a type of database that is used for
storing a wide range of data sets. It is not a relational database as it
stores data not only in tabular form but in several different ways. It
came into existence when the demand for building modern
applications increased. Thus, NoSQL presented a wide variety of
database technologies in response to the demands.

We can further divide a NoSQL database into the following four


types:
a) Key-value storage: It is the simplest type of database storage where it stores every single item as
a key (or attribute name) holding its value, together.
b) Document-oriented Database: A type of database used to store data as JSON-like document. It
helps developers in storing data by using the same document-model format as used in the
application code.
c) Graph Databases: It is used for storing vast amounts of data in a graph-like structure. Most
commonly, social networking websites use the graph database.
d) Wide-column stores: It is similar to the data represented in relational databases. Here, data is
stored in large columns together, instead of storing in rows.

4
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Advantages of NoSQL Database


 It enables good productivity in the application development as it is not required to store data
in a structured format.
 It is a better option for managing and handling large data sets.
 It provides high scalability.
 Users can quickly access data from the database through key-value.

5) Cloud Database
A type of database where data is stored in a virtual environment and executes over the cloud
computing platform. It provides users with various cloud computing services (SaaS, PaaS, IaaS, etc.)
for accessing the database. There are numerous cloud platforms, but the best options are:
 Amazon Web Services(AWS)
 Microsoft Azure
 Kamatera
 PhonixNAP
 ScienceSoft
 Google Cloud SQL, etc.

6) Object-oriented Databases
The type of database that uses the object-based data model approach for storing data in the
database system. The data is represented and stored as objects which are similar to the objects used
in the object-oriented programming language.

7) Hierarchical Databases
It is the type of database that stores data in the form of
parent-children relationship nodes. Here, it organizes
data in a tree-like structure.

Data get stored in the form of records that are connected


via links. Each child record in the tree will contain only
one parent. On the other hand, each parent record can
have multiple child records.

8) Network Databases
It is the database that typically follows the network data model. Here, the representation of data is in
the form of nodes connected via links between them. Unlike the hierarchical database, it allows each
record to have multiple children and parent nodes to form a generalized graph structure.

9) Personal Database
Collecting and storing data on the user's system defines a Personal Database. This database is
basically designed for a single user.
Advantage of Personal Database
 It is simple and easy to handle.
 It occupies less storage space as it is small in size.

5
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

10) Operational Database


The type of database which creates and updates the database in real-time. It is basically designed for
executing and handling the daily data operations in several businesses. For example, An
organization uses operational databases for managing per day transactions.

#DATABASE SCHEMA
 A database schema is the logical representation of a database, which shows how the data is
stored logically in the entire database. It contains list of attributes and instruction that
informs the database engine that how the data is organized and how the elements are related
to each other.
 A database schema contains schema objects that may include tables, fields, packages,
views, relationships, primary key, foreign key,
 In actual, the data is physically stored in files that may be in unstructured form, but to
retrieve it and use it, we need to put it in a structured form. To do this, a database schema is
used. It provides knowledge about how the data is organized in a database and how it is
associated with other data.
 The schema does not physically contain the data itself; instead, it gives information
about the shape of data and how it can be related to other tables or models.
 A database schema object includes the following:
 Consistent formatting for all data entries.
 Database objects and unique keys for all data entries.
 Tables with multiple columns, and each column contains its name and datatype.
 The complexity & the size of the schema vary as per the size of the project. It helps developers
to easily manage and structure the database before coding it.

Types of Database Schema


The database schema is divided into three types, which
are:
1. Logical Schema
2. Physical Schema
3. View Schema

1. Physical Database Schema


A physical database schema specifies how the data is stored physically on storage system or disk
storage in the form of Files and Indices. Designing a database at the physical level is called
a physical schema.

6
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

2. Logical Database Schema


The Logical database schema specifies all the logical constraints that need to be applied to the stored
data. It defines the views, integrity constraints, and table. Here the term integrity
constraints define the set of rules that are used by DBMS (Database Management System) to
maintain the quality for insertion & update the data. The logical schema represents how the data is
stored in the form of tables and how the attributes of a table are linked together.

At this level, programmers and administrators work, and the implementation of the data structure is
hidden at this level. Various tools are used to create a logical database schema, and these tools
demonstrate the relationships between the component of your data; this process is called ER
modelling. The ER modelling stands for entity-relationship modelling, which specifies the
relationships between different entities.

3. View Schema
The view level design of a database is known as view schema. This schema generally describes the
end-user interaction with the database systems. User is able to interact with the database with the
help of the interface without knowing much about the stored mechanism of data in database.

Difference between the Physical and Logical Database Schema

Physical database schema Logical Database schema

It does not include the attributes. It includes the attributes.

It contains both primary & secondary Keys. It also contains both primary & secondary keys.

It contains the table name. It contains the names of the tables.

It contains the column names and their data It does not contain any column name or
types. datatype.

# DATA INDEPENDENCE

Data Independence is mainly defined as a property of DBMS that helps you to change the database
schema at one level of a system without requiring changing the schema at the next level. It helps to
keep the data separated from all programs that makes use of it.
We have namely two levels of data independence arising from these levels of abstraction:
 Physical level data independence
 Logical level data independence

Physical Level Data Independence


It refers to the characteristic of being able to modify the physical schema without any alterations to
the conceptual or logical schema, done for optimization purposes, e.g., the Conceptual structure of
the database would not be affected by any change in storage size of the database system server.

7
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Changing from sequential to random access files is one such example. These alterations or
modifications to the physical structure may include:
 Utilizing new storage devices.
 Modifying data structures used for storage.
 Altering indexes or using alternative file organization techniques etc.

Logical Level Data Independence


It refers characteristic of being able to modify the logical schema without affecting the external
schema or application program. The user view of the data would not be affected by any changes to
the conceptual view of the data. These changes may include insertion or deletion of attributes,
altering table structures entities or relationships to the logical schema, etc.

# INTERFACES IN DBMS
A database management system (DBMS) interface is a user interface that allows for the ability to
input queries to a database without using the query language itself. User-friendly interfaces provided
by DBMS may include the following:
a) Menu-Based Interfaces
b) Forms-Based Interfaces
c) Graphical User Interfaces
d) Natural Language Interfaces
e) Speech Input and Output Interfaces
f) Interfaces for Parametric Users
g) Interfaces for the Database Administrator (DBA)

a) Menu-Based Interfaces
These interfaces present the user with lists of options (called menus) that lead the user through the
formation of a request. The basic advantage of using menus is that they remove the tension of
remembering specific commands and syntax of any query language. The query is basically composed
step by step by collecting or picking options from a menu that is shown by the system. Pull-down
menus are a very popular technique in Web-based interfaces. They are also often used in browsing
interfaces which allow a user to look through the contents of a database in an exploratory and
unstructured manner.

b) Forms-Based Interfaces
A forms-based interface displays a form to each user. Users can fill out all of the form entries to
insert new data, or they can fill out only certain entries, in which case the DBMS will redeem the
same type of data for other remaining entries. These types of forms are usually designed or created
and programmed for users that have no expertise in operating systems. Many DBMS’s have form
specification languages which are special languages that help specify such forms.

c) Graphical User Interface


A GUI typically displays a schema to the user in diagrammatic form. The user then can specify a
query by manipulating the diagram. In many cases, GUI utilise both menus and forms. Most GUI use
a pointing device such as a mouse, to pick a certain part of the displayed schema diagram.

8
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

d) Natural Language Interfaces


These interfaces accept requests written in English or some other language and attempt to
understand them. A Natural language interface has its own schema, which is similar to the database
conceptual schema as well as a dictionary of important words.

e) Speech Input and Output Interfaces


There is limited use of speech be it for a query or an answer to a question or being a result of a
request it is becoming commonplace. Applications with limited vocabulary such as inquiries for
telephone directory, flight arrival/departure, and bank account information are allowed speech for
input and output to enable ordinary folks to access this information.

f) Interface for Parametric Users


Interfaces for Parametric Users contain some commands that can be handled with a minimum of
keystrokes. It is generally used in bank transactions for transferring money. These operations are
performed repeatedly.

g) Interfaces for Database Administrators (DBA)


Most database system contains privileged commands that can be used only by the DBA’s staff. These
include commands for creating accounts, setting system parameters, granting account authorization,
changing a schema, and reorganizing the storage structures of databases.

#DATABASE LANGUAGES
Database Language is a particular type of programming language used to define and manipulate a
database. Based on their application, database languages are classified into four types: DDL, DML,
DCL, and TCL. Database languages are used to perform various critical tasks that help a database
management system function correctly.

SQL (Structured Query Language)


SQL (Structured Query Language) is a language to operate databases; it includes Database Creation,
Database Deletion, Fetching Data Rows, Modifying & Deleting Data rows, etc. SQL was first
developed in the early 1970s at IBM by a team led by Donald D. Chamberlin and Raymond F. Boyce
and became a standard of the American National Standards Institute (ANSI) in 1986, and the
International Organization for Standardization (ISO) in 1987. The original name of the language was
SEQUEL, which stood for "Structured English Query Language." SEQUEL was designed to be a
simple and intuitive way to access and manipulate data stored in IBM's System R relational database
management system.

Why SQL?
SQL is widely popular because it offers the following advantages −
 Allows users to access data in the relational database management systems.
 Allows users to describe the data.
 Allows users to define the data in a database and manipulate that data.
 Allows to embed within other languages using SQL modules, libraries & pre-compilers.
 Allows users to create and drop databases and tables.
 Allows users to create view, stored procedure, functions in a database.
 Allows users to set permissions on tables, procedures and views.

9
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

A Brief History of SQL


 1970 − Dr. Edgar F. "Ted" Codd of IBM is known as the father of relational databases. He
described a relational model for databases.
 1974 − Structured Query Language (SQL) appeared.
 1978 − IBM worked to develop Codd's ideas and released a product named System/R.
 1986 − IBM developed the first prototype of relational database and standardized by ANSI.
The first relational database was released by Relational Software which later came to be
known as Oracle.
 1987 − SQL became the part of the International Organization for Standardization (ISO).

Types of Database Languages


The Data Languages are categorized into four different types based upon the various operations
performed by the language. These include:

1. Data Definition Language (DDL)


DDL stands for Data Definition Language. It is used to define database structure or pattern. It is
used to create schema, tables, indexes, constraints, etc. in the database. Using the DDL statements,
you can create the skeleton of the database. Data definition language is used to store the information
of metadata like the number of tables and schemas, their names, indexes, columns in each table,
constraints, etc. Here are some tasks that come under DDL:
 Create: It is used to create objects in the database.
 Alter: It is used to alter the structure of the database.
 Drop: It is used to delete objects from the database.
 Truncate: It is used to remove all records from a table.
 Rename: It is used to rename an object.

2. Data Manipulation Language (DML)


DML stands for Data Manipulation Language. It is used for accessing and manipulating data in a
database. It handles user requests.
Here are some tasks that come under DML:

10
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103
 Select: It is used to retrieve data from a database.
 Insert: It is used to insert data into a table.
 Update: It is used to update existing data within a table.
 Delete: It is used to delete all records from a table.

3. Data Control Language (DCL)


DCL stands for Data Control Language. It is used to retrieve the stored or saved data. The DCL
execution is transactional. It also has rollback parameters. Here are some tasks that come under
DCL:
 Grant: It is used to give user access privileges to a database.
 Revoke: It is used to take back permissions from the user.

4. Transaction Control Language (TCL)


TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical
transaction.
Here are some tasks that come under TCL:
 Commit: It is used to save the transaction on the database.
 Rollback: It is used to restore the database to original since the last Commit.

# ROLES OF DATABASE ADMINISTRATOR

A Database Administrator (DBA) is an individual or person responsible for controlling, maintaining,


coordinating, and operating a database management system. Managing, securing, and taking care of
the database systems is a prime responsibility. They are responsible and in charge of authorizing
access to the database, coordinating, capacity, planning, installation, and monitoring uses, and
acquiring and gathering software and hardware resources as and when needed. Their role also varies
from configuration, database design, migration, security, troubleshooting, backup, and data
recovery. Database administration is a major and key function in any firm or organization that is
relying on one or more databases. They are overall commanders of the Database system.

Importance of Database Administrator (DBA) :


 Database Administrator manages and controls three levels of database internal level,
conceptual level, and external level of Database management system architecture and in
discussion with the comprehensive user community, gives a definition of the world view of the
database. It then provides an external view of different users and applications.
 Database Administrator ensures held responsible to maintain integrity and security of
database restricting from unauthorized users. It grants permission to users of the database
and contains a profile of each and every user in the database.
 Database Administrators are also held accountable that the database is protected and
secured and that any chance of data loss keeps at a minimum.
 Database Administrator is solely responsible for reducing the risk of data loss as it backup
the data at regular intervals.

11
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Role and Duties of Database Administrator (DBA) :


 Decides hardware – They decide on economical hardware, based on cost, performance, and
efficiency of hardware, and best suits the organization. It is hardware that is an interface
between end users and the database.
 Manages data integrity and security – Data integrity needs to be checked and managed
accurately as it protects and restricts data from unauthorized use. DBA eyes on relationships
within data to maintain data integrity.
 Database Accessibility – Database Administrator is solely responsible for giving permission
to access data available in the database. It also makes sure who has the right to change the
content.
 Database design – DBA is held responsible and accountable for logical, physical design,
external model design, and integrity and security control.
 Database implementation – DBA implements DBMS and checks database loading at the
time of its implementation.
 Query processing performance – DBA enhances query processing by improving speed,
performance, and accuracy.
 Tuning Database Performance – If the user is not able to get data speedily and accurately
then it may lose organization’s business. So by tuning SQL commands DBA can enhance the
performance of the database.

Various responsibilities of Database Administrator (DBA) :


 Responsible for designing overall database schema (tables & fields).
 To select and install database software and hardware.
 Responsible for deciding on access methods and data storage.
 DBA selects appropriate DBMS software like oracle, SQL server or MySQL.
 Used in designing recovery procedures.
 DBA decides the user access level and security checks for accessing, modifying or
manipulating data.
 DBA is responsible for specifying various techniques for monitoring the database
performance.
 DBA is responsible for operation managements.

Types of Database Administrator (DBA) :


 Administrative DBA – Their job is to maintain the server and keep it functional. They are
concerned with data backups, security, troubleshooting, replication, migration, etc.
 Data Warehouse DBA – Assigned earlier roles, but held accountable for merging data from
various sources into the data warehouse. They also design the warehouse, with cleaning and
scrubs data prior to loading.
 Cloud DBA – Nowadays companies are preferring to save their workpiece on cloud storage.
As it reduces the chance of data loss and provides an extra layer of data security and
integrity.
 Development DBA – They build and develop queries, stores procedure, etc. that meets firm
or organization needs. They are par at programming.

12
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

 Application DBA – They particularly manage all requirements of application components


that interact with the database and accomplish activities such as application installation and
coordination, application upgrades, database cloning, data load process management, etc.
 Architect – They are held responsible for designing schemas like building tables. They work
to build a structure that meets organizational needs. The design is further used by developers
and development DBAs to design and implement real applications.
 Task-Oriented DBA –To concentrate on a specific DBA task, large businesses may hire
highly specialised DBAs. They are quite uncommon outside of big corporations. Recovery and
backup DBA, whose responsibility it is to guarantee that the databases of businesses can be
recovered, is an example of a task-oriented DBA. However, this specialism is not present in
the majority of firms. These task-oriented DBAs will make sure that highly qualified
professionals are working on crucial DBA tasks when it is possible.
 Database Analyst –This position doesn’t actually have a set definition. Junior DBAs may
occasionally be referred to as database analysts. A database analyst occasionally performs
functions that are comparable to those of a database architect. The term “Data
Administrator” is also used to describe database analysts and data analysts. Additionally,
some businesses occasionally refer to database administrators as data analysts.

# DATA MODELS
Data models define how the logical structure of a database is modelled. Data models define how data
is connected to each other and how they are processed inside the system. It defines how data will be
stored, accessed, and updated in a database management system. It's like creating a blueprint of
your Database. It defines the data elements and the relationships between the data elements.

Why use Data Models?


Data Models are extremely useful for any organization as it lets business users directly define core
business rules. As a result, fewer revisions are required during implementation. It also leads to
significant reductions in the development time, allowing businesses to deliver new businesses and
projects faster.
Overall, the advantages of using data models can be summed up briefly in the following way:
1. Helps to cut costs and deliver products faster
2. It improves business processes significantly
3. Reduces complexity and risks in data handling

Advantages of Data Models


1. Data Models help us in representing data accurately.
2. It helps us in finding the missing data and also in minimizing Data Redundancy.
3. Data Model provides data security in a better way.
4. The data model should be detailed enough to be used for building the physical database.
5. The information in the data model can be used for defining the relationship between tables,
primary and foreign keys, and stored procedures.

Disadvantages of Data Models


1. In the case of a vast database, sometimes it becomes difficult to understand the data model.
2. You must have the proper knowledge of SQL to use physical models.
3. Even smaller change made in structure require modification in the entire application.
4. There is no set data manipulation language in DBMS.
5. To develop Data model one should know physical data stored characteristics.

13
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Types of Data Model

1. Object Based Data Model

2. Record Based Data Model

3. Physical Data Model

1. Object Based Data Model


In object based data models, the focus is on how data is represented. The data is divided into
multiple entities each of which have some defining characteristics. Moreover, these data entities are
connected with each other through some relationships. So, in object based data models the entities
are based on real world models, and how the data is in real life. There is not as much concern over
what the data is as compared to how it is visualised and connected.
Types object based data models are
 Entity Relationship Data Model
 Object Oriented Data Model
 Semantic Data Model
 Functional Data Model

2. Record-Based Data Model


When the database is organized in some fixed format of records of several than the model is known
as Record-Based Data Model. It has a fixed number of fields or attributes in each record type and
each field is usually of a fixed length.
Types Record based data models are
 Hierarchical Data Model
 Network Data Model
 Relational Data Model

3. Physical Data model


A physical data model is a database-specific model that represents relational data objects (for
example, tables, columns, primary and foreign keys) and their relationships. A physical data model
can be used to generate DDL statements which can then be deployed to a database server. The
physical Data Model is used to practically implement Relational Data Model. Ultimately, all data in a
database is stored physically on a secondary storage device such as discs and tapes. This is stored in
the form of files, records, and certain other data structures. It has all the information on the format
in which the files are present and the structure of the databases, the presence of external data
structures, and their relation to each other. Physical Data Model is not used much nowadays.

14
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

#HIERARCHICAL MODEL
The hierarchical Model is one of the oldest models in the data model which was developed by IBM, in
the 1950s. In a hierarchical model, data are viewed as a collection of tables, or we can say segments
that form a hierarchical relation. In this, the data is organized into a tree-like structure where each
record consists of one parent record and many children. Even if the segments are connected as a
chain-like structure by logical associations, then the instant structure can be a fan structure with
multiple branches. We call the illogical associations as directional associations.

Advantages of Hierarchical data model


 Since the database is based on the hierarchical structure the relationships between the
various layers are logically simple.
 The hierarchical data model was the first database that offered the data security that is
provided by DBMS.
 The Hierarchical database model is based on the parent-child relationships.
 It is very efficient one when the database contains a large number of one-to-many
relationships.

#NETWORK MODEL
The Network 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. In this model, data is organized more like a graph, and allowed to have more than one
parent node. In the network database model, data is more related as more relationships are
established in this database model. Also, as the data is more related, hence accessing the data is
also easier and fast. This database model uses many-to-many data relationships. Integrated Data
Store (IDS) is based on this database model. This was the most widely used database model before
Relational Model was introduced. The implementation of the Network model is complex, and it's very
difficult to maintain it.

15
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Advantages of Network data model


 The Network data model is also conceptually simple and easy to design.
 In the network data model relationships like one-to-one and many-to-many are exist.
 In the network data model without the owner, no member exists.
 In the network database terminology, a relationship is a set. Each set comprises two types of
record an owner record and a member record.

# RELATIONAL MODEL
Relational Data Model uses tables to represent the data and the relationship among these data. Each
table has multiple columns and each column is identified by a unique name. It is a low-level model.
This model was introduced by E.F Codd in 1970, and since then it has been the most widely used
database model. The basic structure of data in the relational model is tables. All the information
related to a particular type is stored in rows of that table. You can design tables, normalize them to
reduce data redundancy, and use Structured Query language or SQL to access data from the tables.
Some of the most popular databases are based on this database model. For example Oracle, MySQL
etc.

16
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Advantages of relational data model


 It is the simplest model at the conceptual level.
 The relational data model makes it easy to design, implement, maintain, uses the database.
 It does not affect the DBMS’s capability to access the data.
 The main reason for the popularity of relational model is the presence of powerful query
capability.

# ENTITY RELATIONSHIP DATA MODEL


An Entity–relationship model (ER model) describes the structure of a database with the help of a
diagram, which is known as Entity Relationship Diagram (ER Diagram). An ER model is a design or
blueprint of a database that can later be implemented as a database. The main components of E-R
model are: entity set and relationship set. An Entity Relationship Diagram (ER Diagram) pictorially
explains the relationship between entities to be stored in a database. Fundamentally, the ER
Diagram is a structural design of the database. It acts as a framework created with specialized
symbols for the purpose of defining the relationship between the database entities. ER diagram is
created based on three principal components:
 Entities
 Attributes
 Relationships.

Entities
An entity can be a real-world object, either animate or inanimate, that can be easily identifiable. For
example, in a school database, students, teachers, classes, and courses offered can be considered as
entities. All these entities have some attributes or properties that give them their identity. An entity
set is a collection of similar types of entities. An entity set may contain entities with attribute sharing
similar values.
For example: In the following ER diagram we have two entities Student and College and these two
entities have many to one relationship as many students study in a single college. We will read more
about relationships later, for now focus on entities.

Weak Entity:
An entity that cannot be uniquely identified by its own attributes and relies on the relationship with
other entity is called weak entity. The weak entity is represented by a double rectangle. For example
– a bank account cannot be uniquely identified without knowing the bank to which the account
belongs, so bank account is a weak entity.

17
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

Attributes
Entities are represented by means of their properties, called attributes. All attributes have values.
For example, a student entity may have name, class, and age as attributes.
There exists a domain or range of values that can be assigned to attributes. For example, a student's
name cannot be a numeric value. It has to be alphabetic. A student's age cannot be negative, etc.
Types of Attributes
 Simple attribute − Simple attributes are atomic values, which cannot be divided further. For
example, a student's phone number is an atomic value of 10 digits.

 Key attribute- A key attribute can uniquely identify an entity from an entity set. For
example, student roll number can uniquely identify a student from a set of students. Key
attribute is represented by oval same as other attributes however the text of key attribute is
underlined.

 Composite attribute − Composite attributes are made of more than one simple attribute. For
example, a student's complete name may have first_name, middle_name and last_name.

 Derived attribute − Derived attributes are the attributes that do not exist in the physical
database, but their values are derived from other attributes present in the database. For
example, average_salary in a department should not be saved directly in the database,
instead it can be derived. For another example, age can be derived from data_of_birth.

18
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

 Multi-value attribute − Multi-value attributes may contain more than one values. For
example, a person can have more than one phone number, email_address, etc.

Relationship
Relationships are represented by diamond-shaped box. Name of the relationship is written inside the
diamond-box. All the entities (rectangles) participating in a relationship, are connected to it by a line.
Binary Relationship and Cardinality
A relationship where two entities are participating is called a binary relationship. Cardinality is the
number of instance of an entity from a relation that can be associated with the relation.
 One-to-one − When only one instance of an entity is associated with the relationship, it is
marked as '1:1'. The following image reflects that only one instance of each entity should be
associated with the relationship. It depicts one-to-one relationship.

 One-to-many − When more than one instance of an entity is associated with a relationship, it
is marked as '1:N'. The following image reflects that only one instance of entity on the left and
more than one instance of an entity on the right can be associated with the relationship. It
depicts one-to-many relationship.

19
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

 Many-to-one − When more than one instance of entity is associated with the relationship, it
is marked as 'N:1'. The following image reflects that more than one instance of an entity on
the left and only one instance of an entity on the right can be associated with the
relationship. It depicts many-to-one relationship.

 Many-to-many − The following image reflects that more than one instance of an entity on the
left and more than one instance of an entity on the right can be associated with the
relationship. It depicts many-to-many relationship.

20
Faculty of : FCE. Program: BTech Class/Section: 4 F / J Date: ……………………….
Name of Faculty: Dr. S.K.Kapoor Name of Course: RDBMS Code: BCECCE4103

21

You might also like