104 - Define basic terms of query processing e.g., SQL, primary and foreign keys, table join

Define basic terms of query processing e.g., SQL, primary and foreign keys, table join

Concepts

  • [AM2-2] Structured Query Language (SQL) and attribute queries
    The most common operator for defining queries in a relational database is the language SQL, which stands for Structured Query Language. A spatial DBMS provides support for geographic coordinate systems and transformations. It will also provide storage of the relationships between features, including the creation and storage of topological relationships. As a result, one is able to use functions for “spatial query” (exploring spatial relationships). To illustrate, a spatial query using SQL to find all the Thai restaurants within 2 km of a given hotel would look like: SELECT R.Name FROM Restaurants AS R, Hotels as H WHERE R.Type = Thai AND H.name = Hilton AND Intersect(R.Geometry, Buffer(H.Geometry, 2)) The Intersect command creates a spatial join between restaurants and hotels. The Geometry column carries the spatial data. It is likely that in the near future all spatial data will be stored directly in spatial databases.