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:

CategoryQuestionLink
ProfilesFind the 'year of birth' of the Profiles, and how many Profiles were born in the same yearLink
Find the top 3 Profiles that have the highest number of FriendsLink
FriendshipFind Santo's FriendsLink
Find Santo's Friends who are also CustomersLink
Find Santo's Friends who are also Customers, and the Countries they are fromLink
Find Santo's Friends who are also Customers, and the Orders they have placedLink
Among Santo's Friends, find the top 3 Customers that placed the highest number of OrdersLink
Among Santo's Friends, find the top 3 Customers that visited the highest number of PlacesLink
Find all the Friends of Customer identified with OrderedId 1 that are not Customers (so that a product can be proposed)Link
CustomersFind everything that is connected (1st degree) to Customer with OrderedId 1Link
Find all Locations connected to Customer with OrderedId 1Link
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 1Link
Find all the places where Customer with OrderedId 2 has stayedLink
Find all places where Customer with Id 1 has eatenLink
Find the 3 Customers who made more reviewsLink
Find all Orders placed by Customer with OrderedId 2Link
Calculate the total revenues from Orders associated with Customer with OrderedId 2Link
Find the 3 Customers who placed most OrdersLink
Find the top 3 Countries from where Customers are fromLink
CountriesFind the top 3 Countries from where Customers are fromLink
Find Santo's Friends who are also Customers, and the Countries they are fromLink
OrdersCalculate the total revenues from Orders, and the min, max and average Order amountLink
Find the year of the Orders, and how many Orders have been placed in the same yearLink
Find the 3 Customers who placed most OrdersLink
Find the top 3 Customers in terms of spendingLink
Find all Orders placed by Customer with Id 2Link
Calculate the total revenues from Orders associated with Customer with Id 2Link
AttractionsFind all Attractions connected with Customer with OrderedId 1Link
ServicesFind all Services connected with Customer with OrderedId 1Link
Find the 3 Hotels that have been booked most timesLink
Find the 3 Hotels that have most reviewsLink
Find the top 3 nationality of the tourists that have eaten at Restaurant with Id 26Link
LocationsFind all Locations visited by SantoLink
Find all Locations connected to Customer with OrderedId 1Link
Find all Locations connected to Customer with OrderedId 1, and their Reviews (if any)Link
Find all Locations visited by Customer with OrderedId 2Link
Find all Locations visited by Santo's friendsLink
ReviewsFind number of Reviews per starLink
Find all reviewed ServicesLink
Find all reviewed Services and the Customer who made the reviewLink
Find the numbers of reviews per ServiceLink
Find the 3 Hotels that have most reviewsLink
Find the 3 Customers who made more reviewsLink
RecommendationsRecommend some friends to Profile 'Isabella Gomez' (friends of friends)Link
Recommend some Hotels to Customer with OrderedId 1Link
Business OpportunitiesFind 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
PolymorphismFind all Locations (Services + Attractions) connected with Customer with OrderedId 1Link
Find the 3 Services (Hotels + Restaurants) that have most reviewsLink
Shortest PathsFind 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
TraversesTraverse everything from Profile 'Santo' up to depth threeLink
Traverse everything from Country 'Italy' up to depth threeLink