Exploring SQL
Let’s get a feel for the capabilities and advantages of working with datasets in a spatial database. SQL is described as a declarative programming language. If you have experience in a coding environment, this might be a fairly big departure.
In a declarative programming language, you write what you want to do, and the program figures it out. SQL is a query language that sends queries to manipulate and retrieve data from the database. In an object-oriented programming (OOP) language such as Python, for example, you need to specify system calls incorporating libraries and various packages. Although Python’s syntax is readable, a familiarity with built-in data structures, powerful libraries, frameworks, and a relative commitment to scripting expertise is required. PostgreSQL includes extensions to write procedures in additional programming languages such as Python and R, for example, but the focus here is on SQL and spatial SQL.
In Figure 1.8, you will...