This document summarizes an algorithm for efficiently answering substring queries in large databases. It first develops an algorithm to answer smallest substring queries in O(n) time using a suffix tree index. It then computes unique substrings for every position in a given string in O(n*h) time and O(n) space, where h is often much smaller than n. The algorithm models substring queries, explores their properties, and presents an O(n) time algorithm using suffix trees to answer a shortest unique substring query. It also shows how to pre-compute shortest unique substrings for every position in O(n*h) time and space.