Prolog is not a good language for querying databases (if that's what you mean by "query language"). Foe one thing, it lacks a SELECT statement or list comprehensions and the like. If you want all results of a goal, you have to use one of the bagof/setof/findall predicates, or roll your own.
On the other hand, Prolog programs are logic theories (as are Prolog queries) and their executio is a proof. The range of programs that can be expressed in Prolog is the set of programs that are computable by a Turing machine. So yes, Prolog is a programming language. Whether it's "terrible" or not is up to personal taste.
I mean, I don't konw of an objective measure of what makes a programming language "terrible".