0% found this document useful (0 votes)
9 views37 pages

Unit - 1

A Database Management System (DBMS) is a software system that provides an efficient way to store, retrieve, and manage data in a structured format, facilitating access for multiple users and applications. It offers advantages such as data integrity, security, and reduced redundancy, while also having disadvantages like centralization issues and costs. The document also discusses the architecture of DBMS, types of database languages, user categories, and the role of a Database Administrator (DBA).
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views37 pages

Unit - 1

A Database Management System (DBMS) is a software system that provides an efficient way to store, retrieve, and manage data in a structured format, facilitating access for multiple users and applications. It offers advantages such as data integrity, security, and reduced redundancy, while also having disadvantages like centralization issues and costs. The document also discusses the architecture of DBMS, types of database languages, user categories, and the role of a Database Administrator (DBA).
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to DBMS

1. AN OVERVIEW OF DATABASE MANAGEMENT SYSTEM

A Database Management System (DBMS) is a collection of interrelated data and a set ofprograms
to access those data. The collection of data, usually referred to as the database, contains
information relevant to an enterprise.

The primary goal of a DBMS is to provide a way to store and retrieve database information that
is both convenient and efficient.

Database is the combination of two words

Database + Management System = DBMS

A database is a collection of related information stored, so that it is available to many users for
different purposes.

Management system is a collection of programs that enables users to create and maintain the
database.

DBMS can also be defined as an interface between the application program and the operating
system to access or manipulate the database.

Application DBMS O.S.


DAtabas
e

DBMS is a software system that allows access to data contained in the [Link] objective is to
provide a convenient and effective method of defining, storing and retrieving the information
contained in the database.

The DBMS interfaces with application programs so that the data contained in the database can be
used by multiple application programs and users.

The primary goal of a DBMS is to provide an environment that is congenial and efficient to
retrieve and store [Link] allows users to store, update and retrieve data in abstract terms.
APPLICATIONS OF DBMS

1. Banking – Maintaining customer information, accounts, loans and transactions.

2. Universities – Student records, course registration and grades.

3. Railway Reservation – Reservation availability and ticketing.

4. Airlines – Reservation and schedule information.

5. Telecommunication – Call records and billing.

6. Finance – Holdings, sales and purchase of financial instruments.

7. Sales – Customer, product and purchase information.

----------------------------------------------------------------

1.5 ADVANTAGES OF DBMS

1. Reduction in Data Redundancy

2. Reduction in Inconsistency

3. Sharing of Data

4. Enforcement of Standards

5. Improvement in Data Security

6. Maintenance of Data Integrity

7. Better Interaction with Users

8. Efficient System

----------------------------------------------------------------
1.6 DISADVANTAGES OF DBMS

1. Problems associated with Centralization

2. Cost of Software

3. Cost of Hardware

4. Complexity of Backup and Recovery

----------------------------------------------------------------

Key features:

 Data Integrity: Ensures the accuracy and consistency of data.


 Data Security: Protects data from unauthorized access.
 Reduces Redundancy: Minimizes duplicate data by centralizing control.
 Concurrency: Allows multiple users to access data simultaneously without
issues.
 Transaction Management: Ensures that database operations are completed
correctly.
 Automatic Backups: Protects data by creating backups regularly

What is a File System

A File System is a method of storing and organizing files on a computer or


storage device. It works by storing data as individual files, each with its name,
format, and storage location. File systems are used for basic file storage on
devices like hard drives, SSDs, or network storage.

Key Features of a File System:

 Simple Data Storage: Data is stored in files, and you access it by opening the
file.
 File Organization: Files are organized into folders (directories), making it easy to
store and retrieve them.
 File Formats: Data is saved in different formats like text, images, or documents.

Examples: NTFS (Windows), HFS+ (Mac), ext4 (Linux).

What is a Database Management System (DBMS)

A Database Management System (DBMS) is a software system that provides an


interface for managing and organizing data in a structured format. A DBMS
allows users to interact with databases using commands like SQL for storing,
retrieving, and manipulating data.

Key Features of a DBMS:

 Structured Data Storage: Data is stored in tables, rows, and columns, making it
easy to organize and access.
 Data Integrity: DBMS ensures consistency and accuracy of data across tables
and records.
 Advanced Querying: You can use SQL (Structured Query Language) to perform
complex queries and retrieve specific data.
 Multi-User Access: DBMS supports concurrent access from multiple users,
ensuring smooth data handling in large organizations.

Examples: MySQL, Oracle, Microsoft SQL Server,

File System vs DBMS: Key Differences


Feature File System DBMS

Data is stored as files in Data is stored in tables with rows and


Data Organization
folders columns

Ensures strong data integrity and


Data Integrity Minimal integrity checks
consistency

No complex querying; manual


Querying Supports complex queries using SQL
file search

Reduces redundancy by normalizing


Data Redundancy Higher risk of redundancy
data

Advanced security features, including


Security Basic file-level security
access control

Supports multiple users with proper


Multi-User Access Limited or not supported
access controls

Backup and Automatic backups and recovery


Manual backup required
Recovery options

Highly scalable, designed for large


Scalability Limited scalability
datasets

Supports transactions to maintain


Transactions No support for transactions
data consistency
Advantages of Using a File System

 Simplicity: File systems are easy to use and understand. They are great for
simple data storage and retrieval tasks, especially when no complex queries are
required.
 Low Cost: Setting up and using a file system is relatively inexpensive, as no
specialized software (other than the operating system) is needed.
 Flexibility: You can store any type of file in a file system, from text files to
multimedia.

Advantages of Using a DBMS

 Data Integrity: A DBMS ensures data accuracy and consistency through


constraints and relationships between tables.
 Efficient Querying: With SQL, you can quickly retrieve specific data, even from
large datasets.
 Multi-User Support: DBMS allows multiple users to access and modify the
database simultaneously while maintaining data security and consistency.
 Data Redundancy Reduction: By using normalization techniques, DBMS
minimizes data duplication.
 Security: DBMS comes with advanced features like user access control,
encryption, and auditing to protect sensitive data.
 Backup and Recovery: Automatic backup and recovery features in DBMS
ensure that data is not lost even in the event of system failure.

Three Schema Architecture of DBMS

The three-schema architecture of DBMS hides the details of the database from
the user. Its other name is Three Levels of Abstraction. The database
administrator should be able to change the structure of the database according to
need without affecting the user’s view. This effective three-schema architecture
has three layers, which are given below

1. External level (front-end developer, user level)


2. Conceptual level (database designer, logical level)
3. Internal level (administrator, physical level)
1. External or View level

This is the highest level of database abstraction. The View / External level of
database abstraction refers to how data is presented to specific users or groups
of users. Instead of showing the entire database, it provides tailored views that
display only the information relevant to the user.

2. Conceptual or Logical level

The Conceptual or Logical level is the middle layer of database abstraction. It


provides the schema or structure of the database, showing what data is stored
and how it is related. This level focuses on the logical organization of data
without dealing with how the data is physically stored or how individual users
access it.

 It describes the structure of the data, such as tables, relationships, constraints,


and other logical components, without concerning itself with the physical storage
details or user-specific views. This level is typically used for designing the
database structure, ensuring that the data is logically organized and related in a
way that supports the database’s overall function.

This level is typically designed using Entity-Relationship (ER) diagrams or other


similar tools to represent the structure of the database logically.
3. Internal or Physical level

The Internal or Physical level is the lowest level of database abstraction. It


defines how the data is actually stored in the database, focusing on the physical
storage structures and the efficiency of data retrieval and storage. This level
deals with the organization of data on disk, such as the use of indexes, file
systems, and access paths that optimize the performance of the database.

Database Languages In DBMS

Database Languages are specialized languages used to define, manipulate,


control, and manage data in a Database Management System (DBMS). They
help users create database structures, insert data, retrieve information, and
control database access.

In simple words:

Database Languages = Tools to talk to and control a database.

Types of Database Language

1. Data Definition Language (DDL)

DDL stands for Data Definition Language. It is used to create and update the
schema in the database. It is used to update the database schema.

DDL performs the following tasks

 Create: This command is used to create the structure of new objects in the
database.
 Alter: Alter command is used to change the structure of the database.
 Drop: The drop command is used to delete objects from the database.
 Truncate: Truncate command is used to remove all records from a table.
 Rename: Rename command is used to rename an object.
2. Data Manipulation Language (DML)

DML stands for Data Manipulation Language. DML is used for


retrieving/accessing, and manipulating data in a database. It handles user
requests.

DML performs the following tasks

 Select: This command is used to access the data from a database.


 Insert: This command is used to insert data into a table.
 Update: This command is used to update the database.
 Delete: This command is used to remove all records from a database table.
 Lock Table: This command controls concurrency.
 Call: This command is used to call a structured query language or a Java
subprogram.

3. Data Control Language (DCL)

DCL stands for Data Control Language. DCL is used to retrieve the saved data.
The DCL execution is transactional. It also has rollback parameters.

DCL performs the following tasks

 Grant: This command is used to give user access privileges to a database.


 Revoke: This command is used to take back permissions from the user.

4. Transaction Control Language (TCL)

Transaction control language is used to update the changes made by the data
manipulation (DML) statement.

TCL performs the following tasks

 Commit: This command is used to save the committed transaction on the


database.
 Rollback: This command is used to restore the database to the original since the
last Commit.

Different Types of Database Users

A Database User is defined as a person who interacts with data daily for updating,
reading, and modifying the given data. Database users can access and retrieve data from
the database through the Database Management System (DBMS) applications and
interfaces.

Types of Database Users

Database users are categorized based on their interaction with the database. There are
seven types of database users in DBMS. Below mentioned are the types of database
users:

1. Naïve Users (End Users)

 Naïve users are normal users who do not have knowledge of database operations.
 They use the database through predefined applications.
 They do not write SQL queries.

Examples:

 Bank teller
 Railway reservation clerk
 ATM user

Characteristics:

 Limited access
 Easy user interface
 Perform routine tasks

2. Application Programmers

 Application programmers develop programs that interact with the database.


 They use programming languages like C, Java, Python along with SQL.
 They create forms, reports and database applications.

Examples:

 Software developers
 Web application developers

Responsibilities:

 Writing application code


 Connecting applications with the database
3. Sophisticated Users

 These users have good knowledge of DBMS and SQL.


 They directly access the database using queries.
 They perform complex data analysis.

Examples:

 Data analysts
 Engineers
 Researchers

4. Specialized Users

 Specialized users develop special-purpose database applications.


 These applications are not traditional DBMS applications.

Examples:

 CAD (Computer Aided Design) systems


 Artificial Intelligence systems
 Multimedia database systems

2. DATABASE ADMINISTRATOR (DBA)

The Database Administrator (DBA) is the person who has complete control over the
database system.

Definition:

A Database Administrator is responsible for managing, controlling and maintaining


the database system.

Responsibilities of DBA

1. Database Design

 Defines database schema


 Creates tables, relationships and constraints
2. Security and Authorization

 Grants access permissions to users


 Protects data from unauthorized access
 Manages user accounts and passwords

3. Data Integrity

 Ensures accuracy and consistency of data


 Applies integrity constraints

4. Backup and Recovery

 Takes regular backups of the database


 Restores data in case of system failure

5. Performance Monitoring

 Monitors database performance


 Optimizes queries
 Manages storage space

6. Concurrency Control

 Handles multiple users accessing data at the same time


 Prevents data inconsistency and deadlocks

7. Database Maintenance

 Updates database software


 Performs regular maintenance and tuning
Transaction Management in DBMS
A transaction is a set of logically related operations. For example, you are transferring
money from your bank account to your friend’s account; the set of operations would be
like this:

Simple Transaction Example

1. Read your account balance


2. Deduct the amount from your balance
3. Write the remaining balance to your account
4. Read your friend’s account balance
5. Add the amount to his account balance
6. Write the new updated balance to his account

This whole set of operations can be called a transaction.

In DBMS, we write the above 6 steps transaction like this:

Lets say your account is A and your friend’s account is B, you are transferring 10000
from A to B, the steps of the transaction are:

Transaction Operations

1. Read Operation – Fetches data from the database.


2. Write Operation – Modifies data in the database.
3. Commit Operation – If all the operations in a transaction are completed
successfully then commit those changes to the database permanently.
4. Rollback Operation – If any of the operation fails then rollback all the changes
done by previous operations.
Desirable Properties of Transaction (ACID Properties)

Transaction management in a Database Management System (DBMS) ensures that


database transactions are executed reliably and follow ACID properties: Atomicity,
Consistency, Isolation, and Durability. These principles help maintain data integrity,
even during failures or concurrent user interactions, ensuring that all transactions are
either fully completed or rolled back if errors occur.

For a transaction to be performed in DBMS, it must possess several properties often


called ACID properties.

 A - Atomicity

 C - Consistency

 I - Isolation

 D - Durability

Transaction States

Types Of Transaction States

There are six major types of Transaction states, which are given below

1. Active – Transaction is executing.


2. Partially Committed – All operations done, waiting for final commit.
3. Committed – Transaction changes are permanent.
4. Failed – Error occurred; transaction cannot proceed.
5. Aborted – Transaction rolled back, database restored to consistent state.
Components of DBMS (Database Management System)

A Database Management System (DBMS) is a collection of software tools that enables


users to define, create, store, retrieve, and manage data efficiently. A DBMS works
properly because of several interrelated components. These components together ensure
data security, consistency, and reliability.

1. Hardware

Hardware refers to the physical devices on which the DBMS operates.

It includes:

 Computer systems (servers, desktops, laptops)


 Storage devices (hard disks, SSDs)
 Input/output devices
 Network devices (in case of distributed databases)

2. Software

Software is the most important component of a DBMS.

It includes:
 DBMS software (e.g., MySQL, Oracle, PostgreSQL, SQL Server)
 Operating System (Windows, Linux, UNIX)
 Application programs that interact with the database
 Utility programs for backup, recovery, and performance tuning

3. Data

Data is the core component of any DBMS. It represents real-world information stored in
the database.

Data includes:
 User data (actual stored information like student records, employee details)
 Metadata (data about data, such as table structure, data types, constraints)
 Indexes for fast data access
Without data, a DBMS has no purpose.
4. Procedures

Procedures are the rules and instructions that guide users and administrators on how to
use and manage the database.
They include:

 Database design rules


 Backup and recovery procedures
 Security policies
 Data access and modification rules

Procedures help maintain consistency, security, and smooth operation of the DBMS.

5. Database Access Language

A DBMS uses special languages to interact with the database.

Main types include:

 DDL (Data Definition Language) – used to define database structure (CREATE,


ALTER, DROP)
 DML (Data Manipulation Language) – used to insert, update, delete data
(INSERT, UPDATE, DELETE)
 DQL (Data Query Language) – used to retrieve data (SELECT)
 DCL (Data Control Language) – used for access control (GRANT, REVOKE)
 TCL (Transaction Control Language) – used to manage transactions
(COMMIT, ROLLBACK)

These languages allow users to communicate with the DBMS effectively.

6. Database Users

Different types of users interact with the DBMS for different purposes.

(a) Database Administrator (DBA)

 Manages the entire database system


 Controls security and authorization
 Handles backup and recovery
 Monitors performance

(b) Application Programmers

 Write programs to interact with the database


 Use programming languages like Java, Python, PHP, etc.

(c) End Users

 Use the database to retrieve or update data


 Examples: students, teachers, bank employees
7. Database Engine

The database engine is the core service of the DBMS.

Functions:

 Stores and retrieves data


 Enforces constraints
 Handles transactions and concurrency
 Ensures data consistency and integrity

It acts as a bridge between stored data and user requests.


o In this architecture, the database is directly available to the user. It means the
user can directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't
provide a handy tool for end users.
o The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.

o The 2-Tier architecture is same as basic client-server. In the two-tier architecture,


applications on the client end can directly communicate with the database at the
server side. For this interaction, API's like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-side.
o The server side is responsible to provide the functionalities like: query processing
and transaction management.
o To communicate with the DBMS, client-side application establishes a connection
with the server side.
Fig: 2-tier Architecture

o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
o The 3-Tier architecture is used in case of large web application.

Fig: 3-tier Architecture


Attributes of a DSS
Adaptability and flexibility
High level of Interactivity
Ease of use
Efficiency and effectiveness
Complete control by decision-makers
Ease of development
Extendibility
Support for modeling and analysis
Support for data access
Standalone, integrated, and Web-based

Components of a DSS
Database Management System (DBMS)
data may come from internal or external database.
Model Management System
use to make decisions. Such models are used for designing manufacturing
facility, analyzing the financial health of an organization, forecasting demand of
a product or service, etc.
Support Tools
interfaces, graphical analysis, error correction mechanism, facilitates the user
interactions with the system.

o ER model stands for an Entity-Relationship model. It is a high-level data model. This


model is used to define the data elements and relationship for a specified system.
o It develops a conceptual design for the database. It also develops a very simple and easy
to design view of data.
o In ER modeling, the database structure is portrayed as a diagram called an entity-
relationship
diagram.
An entity may be any object, class, person or place. In the ER diagram, an entity can be
represented as rectangles.

a. Weak Entity
An entity that depends on another entity called a weak entity. The weak entity
doesn't contain any key attribute of its own. The weak entity is represented by a
double rectangle.

The attribute is used to describe the property of an entity. Eclipse is used to


represent an attribute.
For example, id, age, contact number, name, etc. can be attributes of a student.
a. Key Attribute
The key attribute is used to represent the main characteristics of an entity. It
represents a primary key. The key attribute is represented by an ellipse with the
text underlined.

b. Composite Attribute

An attribute that composed of many other attributes is known as a composite


attribute. The composite attribute is represented by an ellipse, and those ellipses
are connected with an ellipse.

c. Multivalued Attribute

An attribute can have more than one value. These attributes are known as a
multivalued attribute. The double oval is used to represent multivalued attribute.
For example, a student can have more than one phone number.
d. Derived Attribute

An attribute that can be derived from other attribute is known as a derived


attribute. It can be represented by a dashed ellipse.
For example, A person's age changes over time and can be derived from another
attribute like Date of birth.

A relationship is used to describe the relation between entities. Diamond or


rhombus is used to represent the relationship.

Types of relationship are as follows:

a. One-to-One Relationship

When only one instance of an entity is associated with the relationship, then it is
known as one to one relationship.
For example, A female can marry to one male, and a male can marry to one
female

b. One-to-many relationship

When only one instance of the entity on the left, and more than one instance of
an entity on the right associates with the relationship then this is known as a one-
to-many relationship.
For example, Scientist can invent many inventions, but the invention is done by
the only specific scientist.

c. Many-to-one relationship

When more than one instance of the entity on the left, and only one instance of
an entity on the right associates with the relationship then it is known as a many-
to-one relationship.
For example, Student enrolls for only one course, but a course can have many
students.

d. Many-to-many relationship

When more than one instance of the entity on the left, and more than one
instance of an entity on the right associates with the relationship then it is known
as a many-to-many relationship.
For example, Employee can assign by many projects and project can have many
employees.

o A mapping constraint is a data constraint that expresses the number of entities to which
another entity can be related via a relationship set.
o It is most useful in describing the relationship sets that involve more than two entity sets.
o For binary relationship set R on an entity set A and B, there are four possible mapping
cardinalities. These are as follows:
1. One to one (1:1)
2. One to many (1:M)
3. Many to one (M:1)
4. Many to many (M:M)

In one-to-one mapping, an entity in E1 is associated with at most one entity in E2, and
an entity in E2 is associated with at most one entity in E1.

In one-to-many mapping, an entity in E1 is associated with any number of entities in E2,


and an entity in E2 is associated with at most one entity in E1.

In one-to-many mapping, an entity in E1 is associated with at most one entity in E2, and
an entity in E2 is associated with any number of entities in E1.
In many-to-many mapping, an entity in E1 is associated with any number of entities in
E2, and an entity in E2 is associated with any number of entities in E1.

Participation Constraints
Total Participation
participation is represented by double lines.
Partial participation
participation is represented by single lines.
However, users often mislead the concept of the elements and the design process of the
ER diagram. Thus, it leads to a complex structure of the ER diagram and certain issues
that does not meet the characteristics of the real-world enterprise model.

Here, we will discuss the basic design issues of an ER database schema in the following
points:

The use of an entity set or attribute depends on the structure of the real-world
enterprise that is being modelled and the semantics associated with its attributes. It
leads to a mistake when the user use the primary key of an entity set as an attribute of
another entity set. Instead, he should use the relationship to do so. Also, the primary key
attributes are implicit in the relationship set, but we designate it in the relationship sets.

It is difficult to examine if an object can be best expressed by an entity set or relationship set. To
understand and determine the right use, the user need to designate a relationship set for
describing an action that occurs in-between the entities. If there is a requirement of
representing the object as a relationship set, then its better not to mix it with the entity set.

Generally, the relationships described in the databases are binary relationships. However, non-
binary relationships can be represented by several binary relationships. For example, we can
create and represent a ternary relationship 'parent' that may relate to a child, his father, as well
as his mother. Thus, it is possible to represent a non-binary relationship by a set of distinct
binary relationships.

The cardinality ratios can become an affective measure in the placement of the
relationship attributes. So, it is better to associate the attributes of one-to-one or one-
to-many relationship sets with any participating entity sets, instead of any relationship
set.
o Keys play an important role in the relational database.
o It is used to uniquely identify any record or row of data from the table. It is also used to
establish and identify relationships between tables.

For example, ID is used as a key in the Student table because it is unique for each
student. In the PERSON table, passport_number, license_number, SSN are keys since
they are unique for each person.

Super key is an attribute set that can uniquely identify a tuple. A super key is a superset
of a candidate key.

For example: In the above EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME), the


name of two employees can be the same, but their EMPLYEE_ID can't be the same.
Hence, this combination can also be a key.

The super key would be EMPLOYEE-ID (EMPLOYEE_ID, EMPLOYEE-NAME), etc.

o A candidate key is an attribute or set of attributes that can uniquely identify a tuple.
o Except for the primary key, the remaining attributes are considered a candidate key. The
candidate keys are as strong as the primary key.
For example: In the EMPLOYEE table, id is best suited for the primary key. The rest of
the attributes, like SSN, Passport_Number, License_Number, etc., are considered a
candidate key.

o It is the key used to identify one and only one instance of an entity uniquely. An entity
can contain multiple keys, as we saw in the PERSON table. The key which is most suitable
from those lists becomes a primary key.
o In the EMPLOYEE table, ID can be the primary key since it is unique for each employee. In
the EMPLOYEE table, we can even select License_Number and Passport_Number as
primary keys since they are also unique.

o For each entity, the primary key selection is based on requirements and developers.
o Foreign keys are the column of the table used to point to the primary key of another
table.
o Every employee works in a specific department in a company, and employee and
department are two different entities. So we can't store the department's information in
the employee table. That's why we link these two tables through the primary key of one
table.
o We add the primary key of the DEPARTMENT table, Department_Id, as a new attribute in
the EMPLOYEE table.
o In the EMPLOYEE table, Department_Id is the foreign key, and both the tables are
related.

There may be one or more attributes or a combination of attributes that uniquely


identify each tuple in a relation. These attributes or combinations of the attributes are
called the candidate keys. One key is chosen as the primary key from these candidate
keys, and the remaining candidate key, if it exists, is termed the alternate key. In other
words, the total number of the alternate keys is the total number of candidate keys
minus the primary key. The alternate key may or may not exist. If there is only one
candidate key in a relation, it does not have an alternate key.

For example, employee relation has two attributes, Employee_Id and PAN_No, that act
as candidate keys. In this relation, Employee_Id is chosen as the primary key, so the
other candidate key, PAN_No, acts as the Alternate key.
Whenever a primary key consists of more than one attribute, it is known as a composite
key. This key is also known as Concatenated Key.

For example, in employee relations, we assume that an employee may be assigned


multiple roles, and an employee may work on multiple projects simultaneously. So the
primary key will be composed of all three attributes, namely Emp_ID, Emp_role, and
Proj_ID in combination. So these attributes act as a composite key since the primary key
comprises more than one attribute.
The key created using arbitrarily assigned data are known as artificial keys. These1 keys
are created when a primary key is large and complex and has no relationship with many
other relations. The data values of the artificial keys are usually numbered in a serial
order.

For example, the primary key, which is composed of Emp_ID, Emp_role, and Proj_ID, is
large in employee relations. So it would be better to add a new virtual attribute to
identify each tuple in the relation uniquely.

E-R Diagram:
Data Model is the modeling of the data description, data semantics, and consistency
constraints of the data. It provides the conceptual tools for describing the design of a
database at each level of data abstraction. Therefore, there are following four data
models used for understanding the structure of the database:
1) Relational Data Model: This type of model designs the data in the form of rows and
columns within a table. Thus, a relational model uses tables for representing data and
in-between relationships. Tables are also called relations. This model was initially
described by Edgar F. Codd, in 1969. The relational data model is the widely used model
which is primarily used by commercial data processing applications.

2) Entity-Relationship Data Model: An ER model is the logical representation of data


as objects and relationships among them. These objects are known as entities, and
relationship is an association among these entities. This model was designed by Peter
Chen and published in 1976 papers. It was widely used in database designing. A set of
attributes describe the entities. For example, student_name, student_id describes the
'student' entity. A set of the same type of entities is known as an 'Entity set', and the set
of the same type of relationships is known as 'relationship set'.

3) Object-based Data Model: An extension of the ER model with notions of functions,


encapsulation, and object identity, as well. This model supports a rich type system that
includes structured and collection types. Thus, in 1980s, various database systems
following the object-oriented approach were developed. Here, the objects are nothing
but the data carrying its properties.

4) Semistructured Data Model: This type of data model is different from the other
three data models (explained above). The semistructured data model allows the data
specifications at places where the individual data items of the same type may have
different attributes sets. The Extensible Markup Language, also known as XML, is widely
used for representing the semistructured data. Although XML was initially designed for
including the markup information to the text document, it gains importance because of
its application in the exchange of data.

Database Schema
A database schema is the skeleton structure that represents the logical view of the
entire database. It defines how the data is organized and how the relations among
them are associated. It formulates all the constraints that are to be applied on the data.
A database schema defines its entities and the relationship among them. It contains a
descriptive detail of the database, which can be depicted by means of schema

understand the database and make it useful.

Physical Database Schema schema pertains to the actual storage of


data and its form of storage like files, indices, etc. It defines how the data will be
stored in a secondary storage.
Logical Database Schema
need to be applied on the data stored. It defines tables, views, and integrity
constraints.

Database Instance
It is important that we distinguish these two terms individually. Database schema is the
skeleton of database. It is designed when the database doesn't exist at all. Once the
database is operational, it is very difficult to make any changes to it. A database
schema does not contain any data or information.
A database instance is a state of operational database with data at any given time. It
contains a snapshot of the database. Database instances tend to change with time. A
DBMS ensures that its every instance (state) is in a valid state, by diligently following
all the validations, constraints, and conditions that the database designers have
imposed

o Data independence can be explained using the three-schema architecture.


o Data independence refers characteristic of being able to modify the schema at one level
of the database system without altering the schema at the next higher level.

There are two types of data independence:

o Logical data independence refers characteristic of being able to change the conceptual
schema without having to change the external schema.
o Logical data independence is used to separate the external level from the conceptual
view.
o If we do any changes in the conceptual view of the data, then the user view of the data
would not be affected.

o Logical data independence occurs at the user interface level.

o Physical data independence can be defined as the capacity to change the internal
schema without having to change the conceptual schema.
o If we do any changes in the storage size of the database system server, then the
Conceptual structure of the database will not be affected.
o Physical data independence is used to separate conceptual levels from the internal levels.
o Physical data independence occurs at the logical interface level.

o A DBMS has appropriate languages and interfaces to express database queries and
updates.
o Database languages can be used to read, store and update the data in the database.

You might also like