Structure of Network Database
Define:
A network database model organizes data into
records that are connected by pointers, allowing for more
complex relationships between records than the hierarchical
model. Here's a breakdown of its components:
1. Records:
•A record is the primary unit of data storage in a network
database. It represents an entity or object, such as a customer,
order, or product.
•Each record consists of fields (or attributes), which store specific
pieces of data (e.g., name, ID, address, etc.).
•Records are connected to each other through pointers, which
link one record to another.
Structure of Network Database
2. Nodes:
•In the context of a network database, each node represents a record. These
nodes are the individual data units that contain the actual information for
each entity.
•Nodes can have multiple connections (through pointers) to other nodes,
allowing for complex relationships. This network structure is different from a
hierarchical database where each record has only one parent.
3. Pointers:
•Pointers are used to create relationships between records (nodes). A pointer is
a reference that links one record to another, enabling the establishment of
relationships.
•These pointers allow for many-to-many relationships, meaning one record can
be linked to multiple other records, and vice versa.
•Pointers are bidirectional, meaning that navigating through a pointer can go
both ways, allowing for traversal in both directions (e.g., from one record to
related records and from those records back to the original).
Structure of Network Database
4. Sets:
•A set is a group of records that are logically connected through pointers. It
defines the relationship between the records in the network.
•In a network database, the relationship can be many-to-many, where each
record in the set can have multiple connections to other records.
•Each set typically consists of an owner record (the starting point) and one or
more member records (the related records).
5. Schema:
•The schema of a network database describes the overall structure and
organization of the database, including how records are related and how
pointers are structured.
•It is a blueprint that defines the records, the relationships between them,
and the rules for navigating the pointers.
6. Hierarchical Relationships:
•While the network database supports many-to-many relationships, it also
allows for hierarchical relationships (one-to-many) through sets of records
where one record (the parent) is related to multiple other records (the
children).
Types of Data in a Network Database
1.String:
•A string is a sequence of characters. It is typically used for fields that store text, such as names,
addresses, or descriptions.
2.Integer:
•Integer data types represent whole numbers and are used to store numeric values without decimal
points, such as age, quantity, or ID numbers.
3.Date-Time:
•Date-time data types store date and time information, used for fields that track events, like
timestamps, order dates, or due dates.
•The format can vary depending on the database system, but generally it includes day, month, year,
hour, minute, and second.
Database Operations
1.Select:
•The SELECT operation is used to query the database and retrieve specific data from records based
on certain criteria (e.g., select all customers in a particular city).
•It can be used to fetch one or more records, depending on the query.
2.Insert:
•The INSERT operation adds new records into the database.
•The new records can be inserted into specific positions within the network, and relationships can be
established using pointers.
3.Update:
•The UPDATE operation modifies existing records. It allows for changing the value of one or more
fields in a record.
•It can also be used to modify the pointers or relationships between records.
4.Delete:
•The DELETE operation removes records from the database.
•It can be used to remove entire records or certain elements of a record.
Network Database Querying
Network Database Querying involves the techniques and methods used
to retrieve, manipulate, and manage data stored in a network database.
A network database is structured in a way that records are
interconnected through pointers, allowing for complex relationships
between different types of data.
Data Retrieval (Select):
•Querying in a network database involves using a query language (like SQL or a specialized
network query language) to retrieve data.
•Since the data is stored in a network structure (with records connected by pointers), the
query can specify complex relationships.
•Example: Retrieving all orders related to a specific customer involves following the pointer
from the Customer record to all related Order records.
Example Query:
SELECT * FROM Orders WHERE CustomerID = 123;
2. Data Insertion (Insert):
•Insert operations allow new records to be added to the database.
•The new records can also have pointers that connect them to existing records, forming
relationships.
•This operation involves both creating new records and establishing appropriate connections via
pointers.
Example Query:
INSERT INTO Orders (OrderID, CustomerID, OrderDate) VALUES (12345, 123, '2024-12-19');
Network Database Querying
3. Data Update (Update):
•The Update operation is used to modify existing data in the network database.
•It can be used to change field values within a record or update pointers (to change
relationships between records).
Example Query:
UPDATE Orders SET OrderDate = '2024-12-20' WHERE OrderID = 12345;
Network Database Querying
4. Data Deletion (Delete):
•The Delete operation removes records from the database.
•Deleting a record can also involve removing pointers to that record, ensuring the
relationships are maintained without inconsistencies.
•Care should be taken in network databases to manage the deletion of records with
relationships (avoiding orphaned records).
Example Query:
DELETE FROM Orders WHERE OrderID = 12345;
5. Data Navigation (Pointer Traversal):
•Pointers link records to one another, and navigating through these pointers is key
to retrieving related data.
•Since network databases support many-to-many relationships, queries might
involve traversing multiple levels of relationships to access all related data.
•For example, a query might need to follow pointers from a Customer record to
Order records, and then from those Order records to the related Product records.
Example Traversal:
SELECT Products.ProductName FROM Products INNER JOIN Orders ON
Products.OrderID = Orders.OrderID WHERE Orders.CustomerID = 123;
Network Database Querying
6. Data Recovery and Integrity:
•Network database querying also plays a role in ensuring data integrity and
recovery.
•Querying tools are often used in combination with backup systems to restore
data from transaction logs, ensuring that data remains consistent and
recoverable in the event of failure.
Data Recovery: In case of a database crash or failure, the system can use
transaction logs to restore data to the last known good state. Querying tools
can help locate and restore the affected records.
Data Integrity: Ensuring that all relationships between records (via pointers) are
correctly maintained during updates, deletions, and insertions.
Network Database Querying
7. Optimizing Queries:
•In network databases, especially large ones, querying can become complex and
resource-intensive.
•Query optimization techniques are applied to reduce the amount of time and
resources required to execute queries. This can involve indexing pointers or caching
frequently accessed data.
8. Backup and Restoration of Data:
•Data Backup is crucial for preventing data loss, and querying is used to determine
what data needs to be backed up.
•Data Restoration involves using backup copies to restore the database to a previous
state, often querying through logs or backup versions.
Backup Example:
•A query could be run to identify all records that were modified since the last
backup, ensuring the latest data is backed up.

Structure and Operations of Network Database.pptx

  • 1.
    Structure of NetworkDatabase Define: A network database model organizes data into records that are connected by pointers, allowing for more complex relationships between records than the hierarchical model. Here's a breakdown of its components: 1. Records: •A record is the primary unit of data storage in a network database. It represents an entity or object, such as a customer, order, or product. •Each record consists of fields (or attributes), which store specific pieces of data (e.g., name, ID, address, etc.). •Records are connected to each other through pointers, which link one record to another.
  • 2.
    Structure of NetworkDatabase 2. Nodes: •In the context of a network database, each node represents a record. These nodes are the individual data units that contain the actual information for each entity. •Nodes can have multiple connections (through pointers) to other nodes, allowing for complex relationships. This network structure is different from a hierarchical database where each record has only one parent. 3. Pointers: •Pointers are used to create relationships between records (nodes). A pointer is a reference that links one record to another, enabling the establishment of relationships. •These pointers allow for many-to-many relationships, meaning one record can be linked to multiple other records, and vice versa. •Pointers are bidirectional, meaning that navigating through a pointer can go both ways, allowing for traversal in both directions (e.g., from one record to related records and from those records back to the original).
  • 3.
    Structure of NetworkDatabase 4. Sets: •A set is a group of records that are logically connected through pointers. It defines the relationship between the records in the network. •In a network database, the relationship can be many-to-many, where each record in the set can have multiple connections to other records. •Each set typically consists of an owner record (the starting point) and one or more member records (the related records). 5. Schema: •The schema of a network database describes the overall structure and organization of the database, including how records are related and how pointers are structured. •It is a blueprint that defines the records, the relationships between them, and the rules for navigating the pointers. 6. Hierarchical Relationships: •While the network database supports many-to-many relationships, it also allows for hierarchical relationships (one-to-many) through sets of records where one record (the parent) is related to multiple other records (the children).
  • 4.
    Types of Datain a Network Database 1.String: •A string is a sequence of characters. It is typically used for fields that store text, such as names, addresses, or descriptions. 2.Integer: •Integer data types represent whole numbers and are used to store numeric values without decimal points, such as age, quantity, or ID numbers. 3.Date-Time: •Date-time data types store date and time information, used for fields that track events, like timestamps, order dates, or due dates. •The format can vary depending on the database system, but generally it includes day, month, year, hour, minute, and second.
  • 5.
    Database Operations 1.Select: •The SELECToperation is used to query the database and retrieve specific data from records based on certain criteria (e.g., select all customers in a particular city). •It can be used to fetch one or more records, depending on the query. 2.Insert: •The INSERT operation adds new records into the database. •The new records can be inserted into specific positions within the network, and relationships can be established using pointers. 3.Update: •The UPDATE operation modifies existing records. It allows for changing the value of one or more fields in a record. •It can also be used to modify the pointers or relationships between records. 4.Delete: •The DELETE operation removes records from the database. •It can be used to remove entire records or certain elements of a record.
  • 6.
    Network Database Querying NetworkDatabase Querying involves the techniques and methods used to retrieve, manipulate, and manage data stored in a network database. A network database is structured in a way that records are interconnected through pointers, allowing for complex relationships between different types of data. Data Retrieval (Select): •Querying in a network database involves using a query language (like SQL or a specialized network query language) to retrieve data. •Since the data is stored in a network structure (with records connected by pointers), the query can specify complex relationships. •Example: Retrieving all orders related to a specific customer involves following the pointer from the Customer record to all related Order records. Example Query: SELECT * FROM Orders WHERE CustomerID = 123;
  • 7.
    2. Data Insertion(Insert): •Insert operations allow new records to be added to the database. •The new records can also have pointers that connect them to existing records, forming relationships. •This operation involves both creating new records and establishing appropriate connections via pointers. Example Query: INSERT INTO Orders (OrderID, CustomerID, OrderDate) VALUES (12345, 123, '2024-12-19'); Network Database Querying 3. Data Update (Update): •The Update operation is used to modify existing data in the network database. •It can be used to change field values within a record or update pointers (to change relationships between records). Example Query: UPDATE Orders SET OrderDate = '2024-12-20' WHERE OrderID = 12345;
  • 8.
    Network Database Querying 4.Data Deletion (Delete): •The Delete operation removes records from the database. •Deleting a record can also involve removing pointers to that record, ensuring the relationships are maintained without inconsistencies. •Care should be taken in network databases to manage the deletion of records with relationships (avoiding orphaned records). Example Query: DELETE FROM Orders WHERE OrderID = 12345; 5. Data Navigation (Pointer Traversal): •Pointers link records to one another, and navigating through these pointers is key to retrieving related data. •Since network databases support many-to-many relationships, queries might involve traversing multiple levels of relationships to access all related data. •For example, a query might need to follow pointers from a Customer record to Order records, and then from those Order records to the related Product records. Example Traversal: SELECT Products.ProductName FROM Products INNER JOIN Orders ON Products.OrderID = Orders.OrderID WHERE Orders.CustomerID = 123;
  • 9.
    Network Database Querying 6.Data Recovery and Integrity: •Network database querying also plays a role in ensuring data integrity and recovery. •Querying tools are often used in combination with backup systems to restore data from transaction logs, ensuring that data remains consistent and recoverable in the event of failure. Data Recovery: In case of a database crash or failure, the system can use transaction logs to restore data to the last known good state. Querying tools can help locate and restore the affected records. Data Integrity: Ensuring that all relationships between records (via pointers) are correctly maintained during updates, deletions, and insertions.
  • 10.
    Network Database Querying 7.Optimizing Queries: •In network databases, especially large ones, querying can become complex and resource-intensive. •Query optimization techniques are applied to reduce the amount of time and resources required to execute queries. This can involve indexing pointers or caching frequently accessed data. 8. Backup and Restoration of Data: •Data Backup is crucial for preventing data loss, and querying is used to determine what data needs to be backed up. •Data Restoration involves using backup copies to restore the database to a previous state, often querying through logs or backup versions. Backup Example: •A query could be run to identify all records that were modified since the last backup, ensuring the latest data is backed up.