SAMPLE QUESTION
Which of the following SQL expressions would you use to select all roads and the fields with a speed limit greater than 40 mph from a road network dataset?
A) SELECT * FROM Roads WHERE SpeedLimit > 40
B) SELECT RoadName FROM Roads WHERE SpeedLimit = 40
C) SELECT SpeedLimit FROM Roads WHERE SpeedLimit > 40
D) SELECT RoadName, SpeedLimit FROM Roads WHERE SpeedLimit > 40
Answer: A) SELECT * FROM Roads WHERE SpeedLimit > 40
Explanation:
- Option A selects all fields (*) from the Roads table where the SpeedLimit is greater than 40 mph.
- Option B only retrieves the specific column (RoadName) where the SpeedLimit is equal to 40 mph.
- Option C only retrieves the specific column (SpeedLimit) where the SpeedLimit is greater than 40 mph.
- Option D only retrieves both the RoadName and SpeedLimit columns for roads meeting the condition.
Remember that SQL expressions in GIS adhere to standard SQL syntax, and the correct choice depends on the specific query requirements.