DBMS 1
DBMS 1
SQL
BY
MANJUSHA WADEKAR
ORACLE SQL
Organized in a neat
structured manner
Relational
Hierarchical
NAMES OF POPULAR DATABASES
Oracle
Sybase
Informix
Postgres
MySQL / MariaDB
MSSQL
* MongoDB
STRUCTURED vs UNSTRUCTURED
DATA
DBMS: DATA MODELS
Data Model gives us an idea that how the final data system will look like after
its complete implementation
Data model defines the data elements and the relationships between the
data elements
Data Models are used to show how data is stored, connected, accessed and
updated in the database management system
DBMS: DATA MODELS
Hierarchical Model Object-Relational Data Model
Network Model Flat Data Model
Entity-Relationship Model Semi-Structured Data Model
Relational Model Associative Data Model
Object-Oriented Data Model Context Data Model
DBMS: Hierarchical Model
Hierarchical Model was the first DBMS model.
The hierarchy starts from the root which has root data and then it expands in
the form of a tree adding child node to the parent node
This model easily represents some of the real-world relationships like food
recipes, sitemap of a website etc.
DBMS: Hierarchical Model
DBMS: Hierarchical Model
Features of a hierarchical model:
1.One-to-many relationship: The data here is organized in a tree-like structure where the
one-to-many relationship is between the datatypes. Also, there can be only one path from
parent to any node. Example: In the above example, if we want to go to the
node sneakers we only have one path to reach there i.e through men's shoes node.
2.Parent-Child Relationship: Each child node has a parent node but a parent node can have
more than one child node. Multiple parents are not allowed.
3.Deletion Problem: If a parent node is deleted then the child node is automatically deleted.
4.Pointers: Pointers are used to link the parent node with the child node and are used to
navigate between the stored data. Example: In the above example the 'shoes' node points to
the two other nodes 'women shoes' node and 'men's shoes' node.
DBMS: Hierarchical Model
Advantages of hierarchical model
• It is very simple and fast to traverse through a tree-like structure.
• Any change in the parent node is automatically reflected in the child node so, the
integrity of data is maintained.
This model is the same as the hierarchical model, the only difference is that a
record can have more than one parent
2.Many paths: As there are more relationships so there can be more than
one path to the same record. This makes data access fast and simple.
3.Circular Linked List: The operations on the network model are done with
the help of the circular linked list. The current position is maintained with the
help of a program and this position navigates through the records according
to the relationship.
DBMS: Network Model
Advantages of network model
• The data can be accessed faster as compared to the hierarchical model. This is
because the data is more related in the network model and there can be more than
one path to reach a particular node. So the data can be accessed in many ways.
• As there is a parent-child relationship so data integrity is present. Any change in
parent record is reflected in the child record.
It is also very easy for the developers to understand the system by just
looking at the ER diagram
•Database Design: This model helps the database designers to build the
database and is widely used in database design.
DBMS: Entity-Relationship Model
Advantages of ER model
• Simple: Conceptually ER Model is very easy to build. If we know the relationship between
the attributes and the entities we can easily build the ER Diagram for the model.
• Effective Communication Tool: This model is used widely by the database designers for
communicating their ideas.
• Easy Conversion to any Model: This model maps well to the relational model and can
be easily converted relational model by converting the ER model to the table. This model
can also be converted to any other model like network model, hierarchical model etc.
Disadvantages of ER model
• No industry standard for notation: There is no industry standard for developing an ER
model. So one developer might use notations which are not understood by other
developers.
• Hidden information: Some information might be lost or hidden in the ER model. As it is a
high-level view so there are chances that some details of information might be hidden.
DBMS: Relational Model
Relational Model is the most widely used model
The basic structure of a relational model is tables; so, the tables are also
called relations in the relational model
DBMS: Relational Model
DBMS: Relational Model
Features of relational model
•Tuples: Each row in the table is called tuple. A row contains all the
information about any instance of the object. In the above example, each row
has all the information about any specific individual like the first row has
information about John.
•Attribute or field: Attributes are the property which defines the table or
relation. The values of the attribute should be from the same domain. In the
above example, we have different attributes of the employee like Salary,
Mobile_no, etc.
DBMS: Relational Model
Advantages of relational model
• Simple: This model is simpler as compared to the network and hierarchical model.
• Scalable: This model can be easily scaled as we can add as many rows and columns we
want.
• Structural Independence: We can make changes in database structure without
changing the way to access the data. When we can make changes to the database
structure without affecting the capability to DBMS to access the data we can say that
structural independence has been achieved.
Disadvantages of relational model
• Hardware Overheads: For hiding the complexities and making things easier for the
user this model requires more powerful hardware computers and data storage devices.
• Bad Design: As the relational model is very easy to design and use. So the users don't
need to know how the data is stored in order to access it. This ease of design can lead to
the development of a poor database which would slow down if the database grows.
DBMS: Object-Oriented Data
Model
The real-world problems are more closely represented through the object-
oriented data model
In this model, both the data and relationship are present in a single structure
known as an object
Audio, video, images, etc can be stored in the database which was not
possible in the relational model (although you can store audio and video in
relational database, it is adviced not to store in the relational database)
In this model, two are more objects are connected through links. This link can
be used to relate one object to other objects.
DBMS: Object-Oriented Data
Model
DBMS: Object Relational Model
As the name suggests it is a combination of both the relational model and the
object-oriented model.
This model was built to fill the gap between object-oriented model and the
relational model
We can have many advanced features like we can make complex data types
according to our requirements using the existing data types
The problem with this model is that this can get complex and difficult to
handle. So, proper understanding of this model is required
DBMS: Flat Data Model
It is a simple model in which the database is represented as a table
consisting of rows and columns
To access any data, the computer has to read the entire table
In this model, some entities may have missing attributes while others may
have an extra attribute.
This model gives flexibility in storing the data. It also gives flexibility to the
attributes
Example: If we are storing any value in any attribute then that value can be
either atomic value or a collection of values.
DBMS: Associative Data Model
Associative Data Model is a model in which the data is divided into two parts
The data divided into two parts are called items and links.
•Item: Items contain the name and the identifier(some numeric value).
Example: “The world cup is being hosted by London from 30th March 2020”
DBMS: Associative Data Model
DBMS: Context Data Model
Context Data Model is a collection of several models
Using this model we can do various types of tasks which are not possible
using any model alone