Property Graph Queries (PGQ) let you ask relationship questions about your Data 360 objects in SQL. Instead of joining customers to orders to products again and again, you define those connections once as a graph and then match paths.
For an ecommerce site, the usual questions look like this.
Which products did Avery order?
Which customers ordered the same product?
Which path connects a customer to a product through an order?
A property graph has three parts.
Vertices are the records: customers, orders, and products.
Edges are the connections: a customer placed an order, and an order includes a product.
Properties are the fields you want to filter or return, such as a first name or quantity.
Define the graph in a WITH clause, then query it with GRAPH_TABLE. The COLUMNS clause turns matched properties into ordinary result columns.
When to Use PGQ
Use PGQ when the question is about a path among records. Use ordinary SQL joins when you need one table’s rows plus a few lookup fields.
The commerce examples in this section use the Individual, Sales Order, Sales Order Product, and Goods Product DMOs. A customer places an order, and the order line item points to the product.
Supported and Unsupported Features
Data 360 supports a subset of the SQL/PGQ standard.