Database Systems
Database Systems
What is Database?
A database is an organized collection of data, so that it can be easily
accessed and managed.
Database organize data into tables, rows, columns, and index to make it
easier to find relevant information.
Software
This is a set of programs used to manage and control the overall database. This includes
the database software itself, the Operating System, the network software used to share
the data among users, and the application programs for accessing data in the database.
Data
Data is a raw and unorganized fact that is required to be processed to make it
meaningful. Data can be simple at the same time unorganized unless it is organized.
Generally, data comprises facts, observations, perceptions, numbers, characters,
symbols, images, etc.
Procedure
Procedure are a set of instructions and rules that help you to use the
DBMS. It is designing and running the database using documented
methods, which allows you to guide the users who operate and manage
it.
Data Warehousing (DW) is process for collecting and managing data from varied
sources to provide meaningful business insights.
Data warehouse is typically used to connect and analyze business data from
heterogeneous sources. The data warehouse is the core of the BI system which is
built for data analysis and reporting.
How Data warehouse works?
A Data Warehouse works as a central repository where information arrives from one or more data
sources. Data flows into a data warehouse from the transactional system and other relational
databases.
Data may be:
I. Structured
II. Semi-structured
III. Unstructured data
• The data is processed, transformed, and ingested so that users can access the processed data in
the Data Warehouse through Business Intelligence tools, SQL clients, and spreadsheets. A data
warehouse merges information coming from different sources into one comprehensive database.
• By merging all of this information in one place, an organization can analyze its customers more
holistically. This helps to ensure that it has considered all the information available. Data
warehousing makes data mining possible. Data mining is looking for patterns in the data that may
lead to higher sales and profits.
What Is a Data Warehouse Used For?
Airline:
In the Airline system, it is used for operation purpose like crew assignment, analyses of route profitability, frequent
flyer program promotions, etc.
Banking:
It is widely used in the banking sector to manage the resources available on desk effectively. Few banks also used for
the market research, performance analysis of the product and operations.
Healthcare:
Healthcare sector also used Data warehouse to strategize and predict outcomes, generate patient’s treatment reports,
share data with tie-in insurance companies, medical aid services, etc.
Public sector:
In the public sector, data warehouse is used for intelligence gathering. It helps government agencies to maintain and
analyze tax records, health policy records, for every individual.
Investment and Insurance sector:
In this sector, the warehouses are primarily used to analyze data
patterns, customer trends, and to track market movements.
Telecommunication:
A data warehouse is used in this sector for product promotions, sales
decisions and to make distribution decisions.
Hospitality Industry:
This Industry utilizes warehouse services to design as well as estimate
their advertising and promotion campaigns where they want to target
clients based on their feedback and travel patterns.
Database Vs Data Structures
Database Management System
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
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.
DBMS
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.
ACID Properties in DBMS
DBMS is the management of data that should remain integrated when any changes
are done in it. It is because if the integrity of the data is affected, whole data will
get disturbed and corrupted. Therefore, to maintain the integrity of the data, there
are four properties described in the database management system, which are
known as the ACID properties. The ACID properties are meant for the transaction
that goes through a different group of tasks, and there we come to see the role of
the ACID properties.
Atomicity
The term atomicity defines that the data remains atomic. It means if any operation is
performed on the data, either it should be performed or executed completely or should not
be executed at all. It further means that the operation should not break in between or
execute partially. In the case of executing operations on the transaction, the operation
should be completely executed and not partially.
Example: If Remo has account A having $30 in his account from which he wishes to send
$10 to Sheero's account, which is B. In account B, a sum of $ 100 is already present. When
$10 will be transferred to account B, the sum will become $110. Now, there will be two
operations that will take place. One is the amount of $10 that Remo wants to transfer will
be debited from his account A, and the same amount will get credited to account B, i.e.,
into Sheero's account. Now, what happens - the first operation of debit executes
successfully, but the credit operation, however, fails. Thus, in Remo's account A, the value
becomes $20, and to that of Sheero's account, it remains $100 as it was previously present.
Atomicity
2. Conceptual Level
• The conceptual schema describes the design of a database at the conceptual level. Conceptual level is also
known as logical level.
• The conceptual schema describes the structure of the whole database.
• The conceptual level describes what data are to be stored in the database and also describes what relationship
exists among those data.
• In the conceptual level, internal details such as an implementation of the data structure are hidden.
• Programmers and database administrators work at this level.
Three schema Architecture
3. External Level
• At the external level, a database contains several schemas that
sometimes called as subschema. The subschema is used to describe the
different view of the database.
• An external schema is also known as view schema.
• Each view schema describes the database part that a particular user
group is interested and hides the remaining database from that user
group.
• The view schema describes the end user interaction with database
systems.
Data Independence
Data independence can be explained using the three-schema architecture.
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:
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.
2. Attribute
• The attribute is used to describe the property of an entity. Eclipse is
used to represent an attribute.
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.
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.
example, A person's age changes over time and can be derived from another attribute like Date of
birth.
3. Relationship
A relationship is used to describe the relation between entities.
Diamond or rhombus is used to represent the relationship.
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.
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.
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.
example, Employee can assign by many projects and project can have many
employees.
Notation of ER diagram
ER Design Issues
Here, we will discuss the basic design issues of an ER database schema
in the following points:
One-to-one
• In a one-to-one relationship, one occurrence of an entity relates to only one occurrence in another entity.
• A one-to-one relationship rarely exists in practice.
For example: if an employee is allocated a company car then that car can only be driven by that employee.
Therefore, employee and company car have a one-to-one relationship.
Relationship of higher degree
One-to-many
• In a one-to-many relationship, one occurrence in an entity relates to many occurrences in another entity.
For example: An employee works in one department, but a department has many employees.
• Therefore, department and employee have a one-to-many relationship.
Many-to-many
• In a many-to-many relationship, many occurrences in an entity relate to many occurrences in another entity.
• Same as a one-to-one relationship, the many-to-many relationship rarely exists in practice.
For example: At the same time, an employee can work on several projects, and a project has a team of many
employees.
• Therefore, employee and project have a many-to-many relationship.
Generalization
• Generalization is like a bottom-up approach in which two or more entities of lower level combine to form a higher level
entity if they have some attributes in common.
• In generalization, an entity of a higher level can also combine with the entities of the lower level to form a further higher
level entity.
• Generalization is more like subclass and superclass system, but the only difference is the approach. Generalization uses the
bottom-up approach.
In generalization, entities are combined to form a more
generalized entity, i.e., subclasses are combined to make a superclass.
For example, Faculty and Student entities
can be generalized and create a higher level entity Person.
Specialization
• Specialization is a top-down approach, and it is opposite to Generalization. In specialization, one higher level entity can be
broken down into two lower level entities.
• Specialization is used to identify the subset of an entity set that shares some distinguishing characteristics.
• Normally, the superclass is defined first, the subclass and its related attributes are defined next, and relationship set are
then added.
For example: In an Employee management system,
EMPLOYEE entity can be specialized as TESTER or DEVELOPER
based on what role they play in the company.
Aggregation
In aggregation, the relation between two entities is treated as a single entity. In aggregation, relationship with
its corresponding entities is aggregated into a higher level entity.
For example: Center entity offers the Course entity act as a single entity in the relationship which is in a
relationship with another entity visitor. In the real world, if a visitor visits a coaching center then he will never
enquiry about the Course only or just about the Center instead he will ask the enquiry about both.