Queries
This Section includes several query examples that you can execute from the Studio's Browse Tab, or from its Graph Editor. You may also execute these queries directly from the Console, or your application through an API or Driver.
{% include "../include-demodb-version-warning.md" %}
The following table can help you navigate through all examples:
Category | Question | Link |
---|---|---|
Profiles | Find the 'year of birth' of the Profiles, and how many Profiles were born in the same year | Link |
Find the top 3 Profiles that have the highest number of Friends | Link | |
Friendship | Find Santo's Friends | Link |
Find Santo's Friends who are also Customers | Link | |
Find Santo's Friends who are also Customers, and the Countries they are from | Link | |
Find Santo's Friends who are also Customers, and the Orders they have placed | Link | |
Among Santo's Friends, find the top 3 Customers that placed the highest number of Orders | Link | |
Among Santo's Friends, find the top 3 Customers that visited the highest number of Places | Link | |
Find all the Friends of Customer identified with OrderedId 1 that are not Customers (so that a product can be proposed) | Link | |
Customers | Find everything that is connected (1st degree) to Customer with OrderedId 1 | Link |
Find all Locations connected to Customer with OrderedId 1 | Link | |
Find all Locations connected to Customer with OrderedId 1, and their Reviews (if any) | Link | |
Find the other Customers that visited the Locations visited by Customer with OrderedId 1 | Link | |
Find all the places where Customer with OrderedId 2 has stayed | Link | |
Find all places where Customer with Id 1 has eaten | Link | |
Find the 3 Customers who made more reviews | Link | |
Find all Orders placed by Customer with OrderedId 2 | Link | |
Calculate the total revenues from Orders associated with Customer with OrderedId 2 | Link | |
Find the 3 Customers who placed most Orders | Link | |
Find the top 3 Countries from where Customers are from | Link | |
Countries | Find the top 3 Countries from where Customers are from | Link |
Find Santo's Friends who are also Customers, and the Countries they are from | Link | |
Orders | Calculate the total revenues from Orders, and the min, max and average Order amount | Link |
Find the year of the Orders, and how many Orders have been placed in the same year | Link | |
Find the 3 Customers who placed most Orders | Link | |
Find the top 3 Customers in terms of spending | Link | |
Find all Orders placed by Customer with Id 2 | Link | |
Calculate the total revenues from Orders associated with Customer with Id 2 | Link | |
Attractions | Find all Attractions connected with Customer with OrderedId 1 | Link |
Services | Find all Services connected with Customer with OrderedId 1 | Link |
Find the 3 Hotels that have been booked most times | Link | |
Find the 3 Hotels that have most reviews | Link | |
Find the top 3 nationality of the tourists that have eaten at Restaurant with Id 26 | Link | |
Locations | Find all Locations visited by Santo | Link |
Find all Locations connected to Customer with OrderedId 1 | Link | |
Find all Locations connected to Customer with OrderedId 1, and their Reviews (if any) | Link | |
Find all Locations visited by Customer with OrderedId 2 | Link | |
Find all Locations visited by Santo's friends | Link | |
Reviews | Find number of Reviews per star | Link |
Find all reviewed Services | Link | |
Find all reviewed Services and the Customer who made the review | Link | |
Find the numbers of reviews per Service | Link | |
Find the 3 Hotels that have most reviews | Link | |
Find the 3 Customers who made more reviews | Link | |
Recommendations | Recommend some friends to Profile 'Isabella Gomez' (friends of friends) | Link |
Recommend some Hotels to Customer with OrderedId 1 | Link | |
Business Opportunities | Find all the Friends of Customer identified with OrderedId 1 that are not Customers (so that a product can be proposed) | Link |
Find all the Customer Friends that are not Customers (so that a product can be proposed) | Link | |
Polymorphism | Find all Locations (Services + Attractions) connected with Customer with OrderedId 1 | Link |
Find the 3 Services (Hotels + Restaurants) that have most reviews | Link | |
Shortest Paths | Find the shortest path between the Profile 'Santo' and the Country 'United States' | Link |
Find the shortest path between the Profile 'Santo' and the Restaurant 'Malga Granezza' | Link | |
Traverses | Traverse everything from Profile 'Santo' up to depth three | Link |
Traverse everything from Country 'Italy' up to depth three | Link |