UNIT 1 Final
UNIT 1 Final
What is Data?
Data is a real-world entity or an object. Data is a distinct piece of information or facts
that need to be processed. It can be in any form like text, number, picture,
measurements, and bytes
What is Information?
When data are processed, organized, structured, and interpreted in a given context, so
as to make them useful and meaningful, they are called information.
Example: Name - Ankit, City - Delhi, Class – 12, Marks – 80.
DBMS:
Database management system or DBMS is collection of inter-related data and set
programs which helps in insertion, deletion, and retrieval of those data efficiently. The
database is also used to organize the data or information in the form of tables, views,
schemas, reports, etc.
A database management system or DBMS is a software used for creating and
managing the data in the database easily and effectively.
Example: MySQL, MS SQL Server, Oracle, SQL, DB2, Microsoft Access, etc. are
different types of database management system.
1
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Data Details of data storage are Provides an abstract view of data,
Abstraction visible to users. hiding storage details.
2
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Simpler to understand and More complex due to advanced
Complexity use for basic storage features but provides better data
needs. management.
Database Users:
A Database User is defined as a person who interacts with data daily, 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. Database Administrator (DBA)
A Database Administrator (DBA) is a person/team who defines the schema and also
controls the 3 levels of the database.
The DBA will then create a new account ID and password for the user if he/she needs
to access the database.
DBA is also responsible for providing security to the database and he allows only
authorized users to access/modify the database. DBA is responsible for problems such
as security breaches and poor system response time.
o DBA also monitors the recovery and backup and provides technical support.
o The DBA has a DBA account in the DBMS which is called a system or super-
user account.
o DBA repairs damage caused due to hardware and/or software failures.
3
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
o DBA is the one having privileges to perform DCL (Data Control Language) operations
such as GRANT and REVOKE, to allow/restrict a particular user from accessing the
database.
4
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Characteristics of DBMS
There are various characteristics of a database management system, but following are
some important characteristics:
Advantage of DBMS:
1. Data Security: The more accessible and usable the database, the more it is prone to
security issues. As the number of users increases, the data transferring or data sharing
rate also increases thus increasing the risk of data security. It is widely used in the
corporate world where companies invest large amounts of money, time, and effort to
ensure data is secure and used properly. A Database Management System (DBMS)
provides a better platform for data privacy and security policies thus, helping
companies to improve Data Security.
2. Data integration: Due to the Database Management System we have access to well-
managed and synchronized forms of data thus it makes data handling very easy and
gives an integrated view of how a particular organization is working and also helps to
keep track of how one segment of the company affects another segment.
3. Data abstraction: The major purpose of a database system is to provide users with an
abstract view of the data. Since many complex algorithms are used by the developers
to increase the efficiency of databases that are being hidden by the users through
various data abstraction levels to allow users to easily interact with the system.
4. Reduction in data Redundancy: When working with a structured database, DBMS
provides the feature to prevent the input of duplicate items in the database. for e.g. – If
there are two same students in different rows, then one of the duplicate data will be
deleted.
5
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
5. Data sharing: A DBMS provides a platform for sharing data across multiple
applications and users, which can increase productivity and collaboration.
6. Data consistency and accuracy: DBMS ensures that data is consistent and accurate
by enforcing data integrity constraints and preventing data duplication. This helps to
eliminate data discrepancies and errors that can occur when data is stored and managed
manually.
7. Data organization: A DBMS provides a systematic approach to organizing data in a
structured way, which makes it easier to retrieve and manage data efficiently.
8. Efficient data access and retrieval: DBMS allows for efficient data access and
retrieval by providing indexing and query optimization techniques that speed up data
retrieval. This reduces the time required to process large volumes of data and increases
the overall performance of the system.
9. Concurrency and maintained Atomicity: That means, if some operation
is performed on one particular table of the database, then the change must be
reflected for the entire database. The DBMS allows concurrent access to multiple users
by using the synchronization technique.
10.Scalability and flexibility: DBMS is highly scalable and can easily accommodate
changes in data volumes and user requirements. DBMS can easily handle large
volumes of data, and can scale up or down depending on the needs of the organization.
It provides flexibility in data storage, retrieval, and manipulation, allowing users to
easily modify the structure and content of the database as needed.
Applications of DBMS:
There are various fields where a database management system is used. Following are some
applications which make use of the database management system:
1. Railway Reservation System: In the railway reservation system, the database is required
to store the record or data of ticket bookings, status about train’s arrival, and departure. Also
if trains get late, people get to know it through database update.
2. Library Management System: There are lots of books in the library so; it is tough to store
the record of all the books in a register or copy. So, the database management system
(DBMS) is used to maintain all the information related to the name of the book, issue date,
availability of the book, and its author.
3. Banking: Database management system is used to store the transaction information of
the customer in the database.
4. Education Sector: Presently, examinations are conducted online by many colleges and
universities. They manage all examination data through the database management system
(DBMS). Inspite that student’s registrations details, grades, courses, fee, attendance, results,
etc. all the information is stored in the database
5. Credit card transactions: Database Management system is used for purchasing on credit
cards and generation of monthly statements.
6. Social Media Sites: We all use of social media websites to connect with friends and to
share our views with the world. Daily, millions of peoples sign up for these social media
accounts like Facebook, Twitter, and Google plus. By the use of the database management
6
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
system, all the information of users are stored in the database and, we become able to
connect with other people.
7. Telecommunications: The Database management system is necessary for these
companies to store the call details and monthly postpaid bills in the database.
8. Finance: The database management system is used for storing information about sales,
holding and purchases of financial instruments such as stocks and bonds in a database
9. Online Shopping: These days, online shopping has become a big trend. No one wants
to visit the shop and waste their time. Everyone wants to shop through online shopping
websites (such as Amazon, Flipkart, snapdeal) from home. So all the products are sold and
added only with the help of the database management system (DBMS). Invoice bills,
payments, purchase information all of these are done with the help of DBMS.
10. Human Resource Management: Big firms or companies have many workers or
employees working under them. They store information about employee’s salary, tax, and
work with the help of database management system (DBMS).
11. Manufacturing: Manufacturing companies make different types of products and sale
them on a daily basis. In order to keep the information about their products like bills, purchase
of the product, quantity, supply chain management, database management system (DBMS)
is used.
12. Airline Reservation System: This system is the same as the railway reservation system.
This system also uses a database management system to store the records of flights
departure, arrival, and delay status
Definition of schema: Design of a database is called the schema. Schema is of three types:
Physical schema, logical schema and view schema.
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. Schema is only a structural view (design) of a database as
shown in the diagram below.
7
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
1. Physical schema:
In the physical schema, the database is designed at the physical level. At this level, the schema
describes how the data block is stored and how the storage is managed.
2. Logical schema:
In the logical schema, the database is designed at a logical level. At this level, the programmer
and data administrator perform their work. Also, at this level, a certain amount of data is stored
in a structured way. But the internal implementation data are hidden in the physical layer for
the security proposed.
3. View schema:
In view schema, the database is designed at the view level. This schema describes the user
interaction with the database system.
Moreover, Data Definition Language (DDL) statements help to denote the schema of a database.
The schema represents the name of the table, the name of attributes, and their types; constraints
of the tables are related to the schema. Therefore, if users want to modify the schema, they can
write DDL statements.
Definition of instance: The data stored in database at a particular moment of time is called instance
of database. Database schema defines the variable declarations in tables that belong to a particular
database; the value of these variables at a moment of time is called the instance of that database.
Example:- lets say we have a single table student in the database, today the table has 100 records,
so today the instance of the database has 100 records. Lets say we are going to add another 100
records in this table by tomorrow so the instance of database tomorrow will have 200 records in
table. In short, at a particular moment the data stored in database is called the instance, that changes
over time when we add or delete data from the database.
8
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
DATA MODEL:
A Database model defines the logical design and structure of a database and defines how data
will be stored, accessed and updated in a database management system.
Data Model is a logical structure of Database. It describes the design of database to reflect
entities, attributes, relationship among data, constrains etc.
The structure of the database is called data model
A data model is a model that defines in which format the data are represented and accessed.
Some of the types of Data Model: -
Hierachical Model
Network Model
Entity-Relational Model
Relational Model
Object-Oriented 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 heirarchy 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.
9
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Advantages of Hierarchical Data Model:
When we want to add a new level (parent/child) to an existing Structure then the user has to
reconstruct the entire structure so that it leads to time-consuming.
When we want to access data from this model then we need to Travel from root level to child
level which will time taken process.
This model was designed based on a “one–many” relation i.e. every child is having only one
parent so that there is a chance to occur Data duplicate.
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.
10
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Advantages:
Disadvantages :
Entity-relationship Model
In this database model, relationships are created by dividing object of interest into entity
and its characteristics into attributes.
Different entities are related using relationships.
E-R Models are defined to represent the relationships into pictorial form to make it
easier for different stakeholders to understand.
This model is good to design a database, which can then be turned into tables in
relational model
Example:- If we have to design a School Database, then Student will be
an entity with attributes name, age, address etc. As Address is generally complex, it
11
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
can be another entity with attributes street name, pincode, city etc, and there will be a
relationship between them.
Advantages:
Disadvantages:
Relational Model
12
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Object oriented data model is based upon real world situations. These situations are
represented as objects, with different attributes. All these object have multiple
relationships between them.
Advantages:
Disadvantages:
Relational model requires powerful hardware and large data storage devices.
May lead to slower processing time.
Poorly designed systems lead to poor implementation of database systems.
Shape, Circle, Rectangle and Triangle are all objects in this model.
Circle has the attributes Center and Radius.
Rectangle has the attributes Length and Breath
Triangle has the attributes Base and Height.
The objects Circle, Rectangle and Triangle inherit from the object Shape
Advantages:
• Reduced Maintenance
• Real-World Modeling
• Improved Reliability and Flexibility
• High Code Reusability
Disadvantages:
The semi-structured data model permits the specification of data where individual
data items of same type may have different sets of attributes. The Extensible
Markup Language (XML) is widely used to represent semi-structured data model.
14
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Advantages:
Disadvantage:
DBMS STRUCTURE:
Query Processor:
The Query Processor receives the queries (requests) from the user and interprets them in the
form of instructions. It also executes the instructions received from the DML Compiler. It has
the following four components:
DDL Interpreter: It interprets the DDL (Data Definition Language) Instructions
and stores the record in a data dictionary (in a table containing meta-data)
DML compiler and Organizer:
It translates DML statements in a query language to low level instructions that the
query evaluation engine understands. Also DML compiler transform a users request
into an equivalent but more efficient form of low level instructions
Compiler and Linker:
SQL commands can be embedded in host language application programs like JAVA
or COBOL. These are converter into DML statements by this compiler
Query Evaluation Engine:
It executes low-level instructions generated by DML compiler.
Application program Object Code:
It is low level instruction of the program written by naïve users which the query
evolution engine understands and executes them.
Storage Manager:
Storage manager acts as the interface between the data stored in the database and the
queries received from the end-user. This component in the Structure of DBMS is
responsible for the constraints applied to the data so that it remains consistent. It also
executes the DCL (Data Control Language). It encapsulates the following modules:
Authorization and Integrity Manager: It checks the authority of various users who
access data and the Integrity Constraints of the database.
Transaction Manager: Its job is to assure the system remains in a proper state during
the transaction process. It also ensures that concurrent transactions are executed without
any conflict.
File Manager: It manages the space allocation of files in disk and data structures which
stores information in the database.
Buffer Manager: It manages the transfer of data between the secondary and main
15
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
memory. It also decides what data should be cached in the memory.
Disk Storage
The Disk Storage in the Structure of DBMS represents the space where data is stored. It
has the following components:
Files: These are responsible for storing the data.
Data Dictionary: It is the repository that maintains the information of the database object
and maintains the metadata.
Indices: These are the keys that are used for faster retrieval of data.
Statistical data: It stores statistical information about the data in the database.
This information is used by the query processor to select efficient ways to execute a query.
Thus, the Structure of DBMS represents the functional modules that are employed to
process the queries received from the user, retrieve the data, maintain the changes in the
database and optimize the data retrieval.
Data Independence:
The ability to modify a schema in one level without affecting a schema in the next higher
level is called as data independence. The data changes in one level are independent from the
data changes in next higher level.
Data independence is of two types
1) Physical Data Independence
2) Logical Data Independence
16
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
1. Logical Data Independence
o Changing the logical schema (Conceptual or Logical Level) without changing the external
schema (External or View Level) is called logical data independence.
o It is used to keep the external schema separate from the logical schema.
o If we make any changes at the conceptual level of data, it does not affect the view level.
o This happens at the user interface level.
o For example, it is possible to add or delete new entities, attributes to the conceptual schema
without making any changes to the external schema.
o Example: With Logical Data Independence, they can do this without affecting the user
interface. Imagine adding a “Reviews” section to a “Products” table. This change won’t
disrupt the shopping experience for customers
17
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Fig: Data Independence
o The DBMS design depends upon its architecture. The basic client/server architecture is used
to deal with a large number of PCs, web servers, database servers and other components that
are connected with networks.
o The client/server architecture consists of many PCs and a workstation which are connected via
the network.
o DBMS architecture depends upon how users are connected to the database to get their request
done.
Database architecture can be seen as a single tier or multi-tier. But logically, database
architecture is of two types like: 2-tier architecture and 3-tier architecture.
18
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
1-TIER ARCHITECTURE
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.
2-TIER ARCHITECTURE
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.
3-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.
19
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
o The application on the client-end interacts with an application server which further
communicates with the database system.
o 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.
o The 3-Tier architecture is used in case of large web application.
Database Environment:
One of the primary aims of a database is to supply users with an abstract view of data,
hiding a certain element of how data is stored and manipulated.
Therefore, the starting point for the design of a database should be an abstract and
general description of the information needs of the organization that is to be represented
in the database. And hence you will require an environment to store data and make it
work as a database.
A database environment is a collective system of components that comprise and
regulates the group of data, management, and use of data, which consist of software,
hardware, people, techniques of handling database, and the data also.
Here, the hardware in a database environment means the computers and computer
peripherals that are being used to manage a database, and the software means the whole
thing right from the operating system (OS) to the application programs that include
database management software like M.S. Access or SQL Server. Again the people in a
database environment include those people who administrate and use the system. The
techniques are the rules, concepts, and instructions given to both the people and the
software along with the data with the group of facts and information positioned within
the database environment.
20
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Centralized and Client Server Architecture for DBMS:
Centralized Architecture:
A centralized architecture for DBMS is one in which all data is stored on a single
server, and all clients connect to that server in order to access and manipulate the
data. This type of architecture is also known as a monolithic architecture. One of
the main advantages of a centralized architecture is its simplicity - there is only one
server to manage, and all clients use the same data.
However, there are also some drawbacks to this type of architecture. One of the
main downsides is that, because all data is stored on a single server, that server can
become a bottleneck as the number of clients and/or the amount of data increases.
Additionally, if the server goes down for any reason, all clients lose access to the
data.
21
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Client-server Architecture of DBMS
A client-server architecture for DBMS is one in which data is stored on a central
server, but clients connect to that server in order to access and manipulate the data.
This type of architecture is more complex than a centralized architecture, but it
offers several advantages over the latter.
One of the main benefits of a client-server architecture is that it is more scalable
than a centralized architecture. As the number of clients and/or the amount of data
increases, the server can be upgraded or additional servers can be added to handle
the load. This allows the system to continue functioning smoothly even as it grows
in size.
Another advantage of a client-server architecture is that it is more fault-tolerant than
a centralized architecture. If a single server goes down, other servers can take over
its responsibilities, and clients can still access the data. This makes the system less
likely to experience downtime, which is a crucial factor in many business
environments. On this underlying client/server framework, Two-tier and Three-
tier fundamental DBMS architectures were developed.
Here, the term "two-tier" refers to our architecture's two layers-the Client layer and
the Data layer. There are a number of client computers in the client layer that can
contact the database server. The API on the client computer will use JDBC or some
other method to link the computer to the database server. This is due to the
possibility of various physical locations for clients and database servers.
The Business Logic Layer is an additional layer that serves as a link between the
Client layer and the Data layer in this instance. The layer where the application
programs are processed is the business logic layer, unlike a Two-tier architecture,
where queries are performed in the database server. Here, the application programs
are processed in the application server itself.
22
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Introduction of Entity Relationship Model
The Entity Relationship Model is a model for identifying entities to be represented
in the database and representation of how those entities are related. The ER data
model specifies enterprise schema that represents the overall logical structure of a
database graphically.
Components of a ER Diagram
23
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
As shown in the above diagram, an ER diagram has three main components:
1. Entity
2. Attribute
3. Relationship
1. Entity
Types of Entity:
Weak Entity:
A Weak Entity in DBMS does not have a Key Attribute. It depends on some other Strong
Entity to be identified uniquely. For example, if Installment is an Entity, then it can exist
only if a Loan exists as an Entity. It is represented by a double rectangle in ER Diagram.
Strong Entity:
If an Entity has a key attribute (uniquely identifiable feature), then it is called a Strong
Entity. A simple example of a Strong Entity is the Employee which has the key attribute
‘Employee ID,’ using which a record of that Entity Type is uniquely identified. In ER
Diagram, it is represented using a single rectangle.
24
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
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:
25
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
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).
Entity Set is a collection or a group of ‘entities’ sharing exactly the ‘same set of attributes’.
26
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Types of Entity Sets-
An entity set may be of the following two types-
27
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
In this ER diagram,
Two strong entity sets “Student” and “Course” are related to each other.
Student ID and Student name are the attributes of entity set “Student”.
Student ID is the primary key using which any student can be identified uniquely.
Course ID and Course name are the attributes of entity set “Course”.
Course ID is the primary key using which any course can be identified uniquely.
Double line between Student and relationship set signifies total participation.
It suggests that each student must be enrolled in at least one course.
Single line between Course and relationship set signifies partial participation.
It suggests that there might exist some courses for which no enrollments are made.
2. Weak Entity Set-
A weak entity set is an entity set that does not contain sufficient attributes to uniquely
identify its entities.
In other words, a primary key does not exist for a weak entity set.
However, it contains a partial key called as a discriminator.
Discriminator can identify a group of entities from the entity set.
Discriminator is represented by underlining with a dashed line.
In this ER diagram,
One strong entity set “Building” and one weak entity set “Apartment” are related to
each other.
Strong entity set “Building” has building number as its primary key.
Door number is the discriminator of the weak entity set “Apartment”.
This is because door number alone can not identify an apartment uniquely as there
may be several other buildings having the same door number.
Double line between Apartment and relationship set signifies total participation.
It suggests that each apartment must be present in at least one building.
Single line between Building and relationship set signifies partial participation.
It suggests that there might exist some buildings which has no apartment.
28
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
3. Relationship
When a single instance of an entity is associated with a single instance of another entity then it
is called one to one relationship. For example, a person has only one passport and a passport is
given to one person.
When a single instance of an entity is associated with more than one instances of another
entity then it is called one to many relationship. For example – a customer can place many
orders but a order cannot be placed by many customers.
29
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
When more than one instances of an entity is associated with a single instance of another
entity then it is called many to one relationship. For example – many students can study in a
single college but a student cannot study in many colleges at the same time.
When more than one instances of an entity is associated with more than one instances of
another entity then it is called many to many relationship. For example, a can be assigned to
many projects and a project can be assigned to many students.
A Total participation of an entity set represents that each entity in entity set must have at least
one relationship in a relationship set. For example: In the below diagram each college must
have at-least one associated Student.
RELATIONSHIP SET
30
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Degree of a Relationship Set-
The number of entity sets that participate in a relationship set is termed as the degree of
that relationship set. Thus,\
31
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
2. Binary Relationship Set-
Binary relationship set is a relationship set where two entity sets participate in a
relationship set.
Example- Student is enrolled in a Course
Participation Constraints
32
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Total participation is represented by double lines.
Subclasses:
A subclass is a class derived from the superclass. It inherits the properties of the
superclass and also contains attributes of its own. An example is:
33
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Car, Truck and Motorcycle are all subclasses of the superclass Vehicle. They all inherit
common attributes from vehicle such as speed, colour etc. while they have different
attributes also i.e Number of wheels in Car is 4 while in Motorcycle is 2.
Super classes:
A superclass is the class from which many subclasses can be created. The subclasses
inherit the characteristics of a superclass. The superclass is also known as the parent
class or base class.
In the above example, Vehicle is the Superclass and its subclasses are Car, Truck and
Motorcycle.
Inheritance
Inheritance is basically the process of basing a class on another class i.e to build a
class on a existing class. The new class contains all the features and functionalities
of the old class in addition to its own.
The class which is newly created is known as the subclass or child class and the
original class is the parent class or the superclass.
Inheritance helps avoid redundancy by centralizing common attributes in a
superclass and allowing subclasses to inherit these attributes without duplicating
them.
Generalization
35
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Specialization
o 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.
o Specialization is used to identify the subset of an entity set that shares some
distinguishing characteristics.
o 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.
36
PREPARED BY A.RAMESH DEPT OF CSE,RGMCET
Object-Relational Database:
Definition: An Object-Relational Database (ORD) is a database
management system (DBMS) that integrates object-oriented database
model features into relational databases. ORDs aim to bridge the gap
between relational databases and the object-oriented modeling techniques
that are commonly used in programming languages. This type of database
supports data types, structures, and behaviors directly in the database
schema and query language.
GRAPH DATABASE:
A graph database is a type of NoSQL database that is designed to handle
data with complex relationships and interconnections. In a graph
database, data is stored as nodes and edges, where nodes represent
entities and edges represent the relationships between those entities.
1. Graph databases are particularly well-suited for applications that
require deep and complex queries, such as social networks,
recommendation engines, and fraud detection systems. They can also
be used for other types of applications, such as supply chain
management, network and infrastructure management, and
bioinformatics.
2. One of the main advantages of graph databases is their ability to
handle and represent relationships between entities. This is because
the relationships between entities are as important as the entities
themselves, and often cannot be easily represented in a traditional
relational database.
Distributed Database:
Homogenous
Heterogenous
A.RAMESH DEPT OF CSE RGMCET 9
Homogeneous
Replication
Fragmentation
Replication
The prerequisite for fragmentation is to make sure that the fragments can
later be reconstructed into the original relation without losing data.
Advantages
Disadvantages
NEWSQL Database: