This research reports on the experimental test of several causes of us
er errors while composing database queries. The query language under c
onsideration is Structured Query Language (SQL), the industry standard
language for querying databases. Unfortunately, users commit many err
ors when using SQL. To understand user errors, a model of query writin
g was developed that integrated a GOMS-type analysis of query writing
with the characteristics of human cognition. This model revealed multi
ple cognitive causes of a frequent and troublesome error, join clause
omission. This semantic user error returns answers from the database t
hat may be undetectably wrong, affecting users, decision makers, and p
rogrammers. The model predicted four possible causes of join clause om
ission, and empirical testing revealed that all four contributed to th
e error. Specifically, the frequency of this error increased because (
1) the load on working memory caused by writing intervening clauses ma
de the users forget to include the join clause, (2) an explicit clue t
o write the join clause was absent from the problem statement, (3) use
rs inappropriately reused the procedure appropriate for a single table
query, which requires no join clause, when a join clause is indeed ne
cessary, and (4) some users never learned the comet procedure. These r
esults are significant for understanding user errors in general and fo
r developing new interfaces and training schemes for the task of writi
ng database queries.