Question: Suppose the student relation has an attribute named location of type point, and the classroom relation has an attribute location of type polygon. Write the
Suppose the student relation has an attribute named location of type point, and the classroom relation has an attribute location of type polygon. Write the following queries in SQL using the Post GIS spatial functions and predicates that we saw earlier:
a. Find the names of all students whose location is within the classroom Packard 101.
b. Find all classrooms that are within 100 meters or Packard 101; assume all distances are represented in units of meters.
c. Find the ID and name of student who is geographically nearest to the student with ID 12345.
d. Find the ID and names of all pairs of students whose locations are less than 200 meters apart.
Step by Step Solution
3.58 Rating (162 Votes )
There are 3 Steps involved in it
a This query can be answered using the STContains function SELECT ... View full answer
Get step-by-step solutions from verified subject matter experts
