DBMS Unit - 1
DBMS Unit - 1
DBMS Unit - 1
Schema :
Schema is the overall description of the database. The basic
structure of how the data will be stored in the database is
called schema.
Schema is of three types: Logical Schema, Physical Schema
and view Schema.
1. Logical Schema – It describes the database designed
at logical level.
2. Physical Schema – It describes the database
designed at physical level.
3. View Schema – It defines the design of the database
at the view level.
Example –
Let’s say a table teacher in our database name school, the
teacher table require the name, dob, doj in their table so we
design a structure as :
Teacher table
name: String
doj: date
dob: date
3. System Analyst :
System Analyst is a user who analyses the requirements of
parametric end users. They check whether all the
requirements of end users are satisfied.
1. Real-world entity
2. Relational databases
For example:
If you want to keep track of your personal details then you will
need three different attributes namely name, address, phone
number. All of these attributes together form a single row in a
table. This means that every time we add new information into
our database, we must insert multiple rows into the same
table.
5. ACID properties
8. Transactional processing
9. Data mining
Data abstraction is the method of hiding the unimportant details that are present in the
database from the end users to make the accessing of data easy and secure.
Scope
Data abstraction is present in our daily lives. Let us take a small example. Say, someone,
asks you to switch on the fans in a room. All you will need to do is simply walk to the
switchboard and turn on the switch for the fan, that’s it! Do you need to know where the
electricity is coming from, how the poles of the switch are connected, or exactly what the
internal working of a fan is? The answer to all this is NO! That is what data abstraction is,
all these background details are hidden from you inside the switchboard!
All the databases have complex data structures which are, in fact, of no use to an end user.
Thus, these internal irrelevant details are hidden from the user, making the accessing of
data simple and increasing the security of the data as well. This is what Data Abstraction
is.
The data
abstraction
in DBMS is
implemented
in 3 layers:
Physical
or
Internal
Level
Logical
or
Conceptual Level
View or External Level
The following diagram will give you a clear view of how the implementation is done.
Starting from the very bottom, we have the physical or internal layer, then we have
the middle layer, the logical or conceptual layer, and finally, we have the view or external
layer.
This is the layer of data abstraction where the raw data is physically stored as files. This
layer contains all the complex data structures and the data accessing methods defined.
The physical layer is the lowest level of data abstraction in a DBMS. It is the database
administrator who decides how the data is to be stored in these physical hard drives.
Example:
When we access data we may get a single data or a table of data. Moreover, by the term
"relational database" we visualize a table of rows and columns. But at a physical level,
these tables are stored in hard drives which are located at a very secure data centre.
After taking the raw data from the physical or internal level, the structure of the data is
defined at the logical or conceptual level. This is like a blueprint of the raw data. This layer
does not have any information about how the end user will view the data.
Example:
We have data of a few products like product id, product name, and manufacturing date,
and we have another set of data of customers containing customer id, customer name,
and customer address. Now, we need to frame this data in proper tables of products and
customers. After that, we can even frame a join to show which product has been ordered
by which customer.
This is what an end-user gets to see. He/she does not get the entire database, but
depending on the queries made from the front-end the user gets to see the data. It may be
a single data from the entire database or a collection of data in tabular format. Multiple
views of the same data are available to the user, the representation can be a table, a
graph, or a pie chart. View Level is the highest level of data abstraction in DBMS.
Example:
Concerning the example in the logical level section, let us say a customer wants to view
the order history, he gets to see only the orders he had made in the past. Now, let us say a
shop owner needs to see the products that are on the order list. He gets to see a table
containing all the info about the products and the customers to whom they need to be
delivered.
Conclusion
Data abstraction in DBMS means hiding unnecessary background details from the end user
to make the accessing of data easy and secure.
In DBMS, there are 3 levels of data abstraction:
o Physical Level or Internal Level: This is the layer where the raw data is stored in
file format on physical hard drives.
o Logical Level or Conceptual Level: In this layer, the raw data is taken from the
physical layer and organized in a proper structure, like in tabular format.
o View Level or External Level: At this level, the end users get the data depending
on the queries. The same data can be viewed in multiple ways, like tables, graphs,
or pie charts.
It mainly concern about how the data is It mainly concerned about the structure
stored into the system. or the changing data definition.
The modifications made at the internal The modifications made at the logical
level may or may not be needed to level is significant whenever the logical
improve the performance of the structure of the database is to be
structure. changed.
a database. The data model includes entities, attributes, constraints, relationships, etc. The
data models are used to represent the data and how it is stored in the database, how data is
accessible and updated in the database management system. There are four types of data
These models have further categories which are used according to a different use case.
1. Hierarchical Model
In this type of data model, the data is organized into a tree-like structure that has a
single root and the data is linked to the root. In this model, the main hierarchy
begins from the root and it expands like a tree that has child nodes and further
expands in the same manner. In this model the child node has one single parent
node but one parent can have multiple child nodes. As the data is stored like tree
structure in this data model when data is retrieved the whole tree is traversed from
the root node. The hierarchical data model contains a one-to-many relationship
between various types of data. The data is stored in the form of a record and is
information of its employees. The table contains the following attributes: employee
name, employee code, department name, and last name. And the organization
store employee code, serial number, and type. According to the hierarchical data
model, the employee table can be considered as a parent table and a computer table
2. Network model
The network model is a type of database model which is designed based on a
flexible approach for representing objects and the relationship exist among objects.
The schema is very important in the network data model which can be represented
in the form of a graph where a relationship is represented using edges and the
nodes are used to represent objects. The basic difference between the hierarchical
model and network model is that data is represented in the form of hierarchy in a
hierarchical data model whereas in network model the data is represented in the
form of a graph. One of the advantages of a network model is that the basic
connections are also represented in this data model. There are different types of
relationship can exist in this data model like one to one, many to many, etc. The
data access becomes simple to compare to other data model like the hierarchical
model. The parent node and child node are always connected as there is always a
relationship exist among parent-child node. And the data is not dependent on the
other node. One of the key drawbacks of this model is that this system is not
modification of system it requires to change the whole system which takes a lot of
effort. And to maintain data is difficult to part in this model as every record is
connected via some pointers which makes it difficult to maintain and make the
system complex.
3. E-R model
The ER model is used to describe the database structure using the entity-
relationship diagram. The E-R model is just like the blueprint of a database which
is used to implement the database. In the entity set, the relationship exists which
can be shown using the ER diagram. The entity set consists of a similar type of
The components of the ER model are relationship set and entity set and attributes.
diagram. For example, there are two entities college and student and there exist one
too many relationships as there can be more than one student who can go to
college.
The entity which cannot be identified by attributes and which require a relationship
is called a weak entity. For representing a weak entity the entity is represented in a
double rectangle. For example, there is a bank account but it cannot relate until the
bank name is not known to the bank account is termed as a weak entity.
The attributes are used to represent the property of the entity. In the ER diagram,
the attribute is represented as an oval. There are different types of attributes like
key attribute, composite attribute, multivalued attribute and derived attribute. For
example, a student is an entity and the related attributes for student entity are
student name, student age, student roll number, student address, etc.
The relationship is represented in a diamond shape in the ER diagram. The
relationships exist among entities. There are multiple types of relationships like
4. Relational model
In this data model, the data tables are used to collect a group of elements into the
relations. In this model, the relationships and data are represented using
interrelated tables. And in the table, there are multiple rows and multiple columns
in which column represents the attribute of the entity and the rows are used to
represent records. In this data model there exist different primary key which issued
to distinguish each record in the table. And for retrieving the data elements the
SQL (Structured Query Language) is used. For using the relational data model the
primary key issued as the fundamental tool. And for each entry in the data set, it
needs to be unique. The data table should not contain any type of inconsistency as
it can create a problem at the time of data retrieval. The other problem with the
relational data model is data duplicacy, incomplete data and inappropriate links
Conclusion
For representing the database there is a different type of data models which are
used for representing database structure. Each data model has its advantage and
disadvantage and the use of a data model is dependent on the use cases.