Brief introduction to relationships
We will start by learning about relationships. A relationship is the key property of any relational database that is where the relational database management system got its name from. ArcGIS uses a relational model which means we have to deal with relationships in our coding.
Take a moment and review the database model back in Chapter 1, The Bestaurants Project. In the Bestaurants scenario, our food_and_drinks
layer is related to another table called VENUES_REVIEW. Each relationship has a unique identifier that we will use to query the related records. Open the food_and_drinks
layer by visiting the link: http://arcgismachine:6080/arcgis/rest/services/Bestaurants/MapServer/0
and then scroll down to Relationships as you can see in the following screenshot:
Any relationship is composited of a primary key, which resides in the main or the source table. In our case it is food_and_drinks
, and a foreign key that can be found in the destination table, Venues_reviews...