fokiget.blogg.se

Database part 2
Database part 2











database part 2
  1. DATABASE PART 2 HOW TO
  2. DATABASE PART 2 SERIES

Or an employee might report to one manager but actually work for another, that is, the employee is managed by someone different from whom the employee reports to.Ī hierarchy that reflects real-world situations will likely be a lot less straightforward that the one shown in the previous figure. For example, an employee might work part time in two positions, which means reporting to two different managers. Unfortunately, not all hierarchies are this simple. Ben, Barb, Chen, Gus, and Ane report to Nalini.Īs with the above figure, a hierarchy is often represented as an inverted tree structure in which all branches lead to a common root, in this case, Dora.For example, the data type makes it possible to represent how employees are organized within a company’s hierarchical structure, such as the one shown in the following figure.Īlthough this is a very simple example, it demonstrates the types of relationships that typically make up a basic hierarchy: Since the release of SQL Server 2008, you’ve been able to use the hierarchyid data type to represent a record’s hierarchical position by defining values that reflect the relationships between a table’s rows. In this way, you were able to represent the parent-child relationships that existed within the data set. Since the product’s early days, you could represent a hierarchical structure by including a foreign key in a table that pointed to the primary key in the same table. Working with hierarchical data is certainly not new in SQL Server.

DATABASE PART 2 HOW TO

The article first provides an overview of how to create and populate the tables necessary to support a hierarchy and then focuses on how to query hierarchical data that contains multiple types of relationships. This article digs deeper into the topic of hierarchies, particularly those that contain more complex relationships than what you saw in the examples.

database part 2

One of the topics that the articles touched upon was how to work with hierarchical data and their relationships, as they applied to the FishGraph database used in the examples.

DATABASE PART 2 SERIES

This first three articles in this series focused on using SQL Server graph databases to work with data sets that contained relationships not easily handled in a typical relational structure, the types of relationships you might find in a social network site or product recommendation engine.

  • SQL Server Graph Databases - Part 5: Importing Relational Data into a Graph Database.
  • SQL Server Graph Databases - Part 4: Working with hierarchical data in a graph database.
  • SQL Server Graph Databases - Part 3: Modifying Data in a Graph Database.
  • SQL Server Graph Databases - Part 2: Querying Data in a Graph Database.
  • SQL Server Graph Databases - Part 1: Introduction.
  • SQL Server Graph Databases – Part 4: Working with Hierarchical Data in a Graph Database - Simple Talk Skip to content













    Database part 2