Ques What Is DBMS - Explain The Basic Architecture of DBMS ?
Ques What Is DBMS - Explain The Basic Architecture of DBMS ?
Database
• 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 table, schema, views and reports etc.
• For example: College Database organizes the data about the admin, staff, students and
faculty etc.
• Using the database, you can easily retrieve, insert and delete the information.
• Data Definition:
It is used for creation, modification and removal of definition that defines the
organization of data in database.
• Data Updating:
It is used for 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.
Features of DBMS
1-Tier Architecture
• In the 1-Tier architecture, database is directly available to the user. It means user can
directly sits on the DBMS and uses it.
• The 1-Tier architecture is used for development of local application, where
programmers directly communicate with the database for quick response.
2-Tier Architecture
• 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.
• The user interfaces and application programs are run on client side.
• The server side is responsible to provide the functionalities like: query processing and
transaction management.
• To communicate with the DBMS, client side application establishes a connection with
the server side.
3-Tier Architecture
• The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
• The application on the client-end interacts with an application server which further
communicates with the database system.
• End user has no idea about the existence of the database beyond the application
server. The database also has no idea about any other user beyond the application.
• The 3-Tier architecture is used in case of large web application.
Briefly explain about database system architecture? (2017)
Ques What is Database administrator(DBA)?What are the roles of
DBA.
• Data Base Administrator (DBA) is a person or group in charge for implementing DBMS in an
organization.
• Database Administrator's job requires a high degree of technical expertise and the ability to
understand and interpret management requirements at a senior level. In practice the DBA
may consist of team of people rather than just one person
Roles of DBA :
• Schema definition:
A DBA creates the original database schema by executing a set of data definition statements
in the DDL.
The DBA is responsible for installing SQL Server or upgrading an existing SQL Server.
In the case of upgrading SQL Server, the DBA is responsible for ensuring that if the upgrade
is not successful, the SQL Server can be rolled back to an earlier release until the upgrade
issues can be resolved.
Backup and recovery are the DBA's most critical tasks; they include the following aspects:
It is the DBA's job to decide exactly what information is to be held in the database -in other
words, to identify the' entities of interest to the enterprise and to identify information to be
stored about those entity .
The DBA must also decide how the data is to be represented in the database, and must
specify the representation by writing the storage structure definition (using the internal DDL).
In addition, the associated mapping between the storage structure definition and the
conceptual schema must also be specified.
It is the responsibility of the DBA to provide support to the users, to ensure that the data
they require is available, and to write the\ necessary external schemas (using the
appropriate external data definition language).
In order to understand where the differences and the connections between data,
information and knowledge are, it is necessary to define the terms at first.
Data
• The term ‘information’ is described as the structured, organised and processed data,
presented within context, which makes it relevant and useful to the person who wants it.
• Data means raw facts and figures concerning people, places, or any other thing, which is
expressed in the form of numbers, letters or symbols.
• Information is the data which is transformed and classified into an intelligible form, which
can be used in the process of decision making.
• In short, when data turn out to be meaningful after conversion, it is known as information. It
is something that informs, in essence, it gives an answer to a particular question.
• The main characteristics of information are accuracy, relevance, completeness and
availability. It can be communicated in the form of content of a message or through
observation and can be obtained from various sources such as newspaper, television,
internet, people, books, and so on.
Knowledge
• Knowledge means the familiarity and awareness of a person, place, events, ideas, issues,
ways of doing things or anything else, which is gathered through learning, perceiving or
discovering.
• It is the state of knowing something with cognizance through the understanding of concepts,
study and experience.
• In a nutshell, knowledge connotes the confident theoretical or practical understanding of an
entity along with the capability of using it for a specific purpose.
• Combination of information, experience and intuition leads to knowledge which has the
potential to draw inferences and develop insights, based on our experience and thus it can
assist in decision making and taking actions.
External level
Conceptual level
• It is also called logical level.
• The whole design of the database such as relationship among data, schema of data etc. are
described in this level.
• Database constraints and security are also implemented in this level of architecture.
• This level is maintained by DBA (database administrator).
Internal level
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.
• Logical data independence refers characteristic of being able to change the conceptual
schema without having to change the external schema.
• Logical data independence is used to separate the external level from the conceptual
view.
• If we do any changes in the conceptual view of the data, then the user view of the data
would not be affected.
• Logical data independence occurs at the user interface level.
• Physical data independence can be defined as the capacity to change the internal
schema without having to change the conceptual schema.
• 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.
• Physical data independence is used to separate conceptual levels from the internal
levels.
• Physical data independence occurs at the logical interface level.
Ques Explain these terms or write short note on:
• Database schema
• Data independence
• Aggregation
• Association
• Specialisation
• abstraction
• Generalisation
DBMS Schema
• Definition of schema: Design of a database is called the schema.
• Schema is of three types: Physical schema, logical schema and view schema.
• For example: In the following diagram, we have a schema that shows the
relationship between three tables: Course, Student and Section.
• The diagram only shows the design of the database, it doesn’t show the data
present in those tables.
• Design of database at view level is called view schema. This generally describes
end user interaction with database systems.
Generalization
• Generalization is a process in which the common attributes of more than one
entities form a new entity. This newly formed entity is called generalized entity.
Generalization Example
• Lets say we have two entities Student and Teacher.
• Attributes of Entity Student are: Name, Address & Grade
These two entities have two common attributes: Name and Address, we can make a
generalized entity with these common attributes.
We have created a new generalized entity Person and this entity has the common
attributes of both the entities.
As you can see in the following ER diagram that after the generalization process
the entities Student and Teacher only has the specialized attributes Grade and
Salary respectively and their common attributes (Name & Address) are now
associated with a new entity Person which is in the relationship with both the entities
(Student & Teacher).
Note:
1. Generalization uses bottom-up approach where two or more lower level entities
combine together to form a higher level new entity.
2. The new generalized entity can further combine together with lower level entity to
create a further higher level generalized entity.
Specialization
• Specialization is a process in which an entity is divided into sub-entities. You can
think of it as a reverse process of generalization, in generalization two entities
combine together to form a new higher level entity.
• The idea behind Specialization is to find the subsets of entities that have few
distinguish attributes.
• For example – Consider an entity employee which can be further classified as sub-
entities Technician, Engineer & Accountant because these sub entities have some
distinguish attributes.
Specialization Example
• In the above diagram, we can see that we have a higher level entity “Employee”
which we have divided in sub entities “Technician”, “Engineer” & “Accountant”.
• All of these are just an employee of a company, however their role is completely
different and they have few different attributes. Just for the example, I have shown
that Technician handles service requests, Engineer works on a project and
Accountant handles the credit & debit details.
• All of these three employee types have few attributes common such as name &
salary which we had left associated with the parent entity “Employee” as shown in
the above diagram.
Aggregation
Aggregation is a process in which a single entity alone is not able to make sense in
a relationship so the relationship of two entities acts as one entity. I know it sounds
confusing but don’t worry the example we will take, will clear all the doubts.
Aggregation Example
In real world, we know that a manager not only manages the employee working
under them but he has to manage the project as well.
Abstraction
Database systems are made-up of complex data structures. To ease the user
interaction with database, the developers hide internal irrelevant details from users.
This process of hiding irrelevant details from user is called data abstraction.
We have three levels of abstraction:
Physical level: This is the lowest level of data abstraction. It describes how data is
actually stored in database. You can get the complex data structure details at this
level.
Logical level: This is the middle level of 3-level data abstraction architecture. It
describes what data is stored in database.
View level: Highest level of data abstraction. This level describes the user
interaction with database system.
At the logical level these records can be described as fields and attributes along
with their data types, their relationship among each other can be logically
implemented. The programmers generally work at this level because they are aware
of such things about database systems.
At view level, user just interact with system with the help of GUI and enter the
details at the screen, they are not aware of how the data is stored and what data is
stored; such details are hidden from them.
Ques what are weak entities and strong entities ?how they are represented in ER-
diagram
The main components of E-R model are: entity set and relationship set.
A simple ER Diagram:
In the following diagram we have two entities Student and College and their
relationship.
The relationship between Student and College is many to one as a college can have
many students however a student cannot study in multiple colleges at the same
time.
Student entity has attributes such as Stu_Id, Stu_Name & Stu_Addr and College
entity has attributes such as Col_ID & Col_Name.
Here are the geometric shapes and their meaning in an E-R Diagram. We will
discuss these terms in detail in the next section(Components of a ER Diagram) of
this guide so don’t worry too much about these terms now, just go through them
once.
Ellipses: Attributes
Lines: They link attributes to Entity Sets and Entity sets to Relationship Set
Components of a ER Diagram
As shown in the above diagram, an ER diagram has three main components:
1. Entity
2. Attribute
3. Relationship
Let's take an example to explain everything. For a School Management Software, we will
have to store Student information, Teacher information, Classes, Subjects taught in each
class etc.
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.
• The collection of the same type of entities together forms the entity set.
• Here, we will discuss two types of entities Strong entity and Weak entity. The weak
entity always depends on the strong entity for its existence.
2. Attribute
An attribute describes the property of an entity. An attribute is represented as Oval
in an ER diagram. There are four types of attributes:
1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
1. 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.
2. Composite attribute:
An attribute that is a combination of other attributes is known as composite attribute.
For example, In student entity, the student address is a composite attribute as an
address is composed of other attributes such as pin code, state, country.
3. Multivalued attribute:
An attribute that can hold multiple values is known as multivalued attribute. It is
represented with double ovals in an ER Diagram. For example – A person can
have more than one phone numbers so the phone number attribute is multivalued.
4. Derived attribute:
A derived attribute is one whose value is dynamic and derived from another
attribute. It is represented by dashed oval in an ER Diagram. For example – Person
age is a derived attribute as it changes over time and can be derived from another
attribute (Date of birth).
1. One to One
2. One to Many
3. Many to One
4. Many to Many
• Object based logical Models – Describe data at the conceptual and view levels.
1. E-R Model
2. Object oriented Model ()
• Record based logical Models – Like Object based model, they also describe data
at the conceptual and view levels. These models specify logical structure of
database with records, fields and attributes.
1. Relational Model
In this model, data is organised in two-dimensional tables and the relationship is maintained by
storing a common field.
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.
Hence, tables are also known as relations in relational model.
• Hierarchical Model
This database model organises data into a tree-like-structure, with a single root, to which
all the other data is linked.
The hierarchy starts from the Root data, and expands like a tree, adding child nodes to
the parent nodes.
In this model, a child node will only have a single parent node.
This model efficiently describes many real-world relationships like index of a book, recipes
etc.
In hierarchical model, data is organised into tree-like structure with one one-to-many
relationship between two different types of data, for example, one department can have
many courses, many professors and of-course many students.
3. Network Model
This is an extension of the Hierarchical model. In this model data is organised more like a
graph, and are allowed to have more than one parent node.
In this 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 was used to map many-to-many data relationships.
This was the most widely used database model, before Relational Model was introduced.
ER Diagram: Relationship
A Relationship describes relation between entities. Relationship is represented using
diamonds or rhombus.
8. Binary Relationship
9. Recursive Relationship
10. Ternary Relationship
The above example describes that one student can enroll only for one course and a course will
also have only one Student. This is not what you will usually see in real-world relationships.
One to Many Relationship
The below example showcases this relationship, which means that 1 student can opt for many
courses, but a course can only have 1 student. Sounds weird! This is how it is.
Participation constraints :