The ability to retrieve accurate information from relational databases requires proficiency in structured query language (SQL). In spite of its declarative nature, teaching and learning SQL for complex data-retrieval tasks remains a challenge. Cognitive load theory (CLT) explains the interactions between working and long-term memories in acquiring complex knowledge and skills. We used CLT to identify two instructional interventions expected to improve query writing performance under conditions of high and low query (code) complexity. First, we presented information requests in pseudo-SQL language rather than manager English to clarify the relevant elements in the data model. Second, we provided a query template as an intermediate problem-solving step prior to coding. We conducted an experiment with 63 student participants in a 2 x 2 x 2 repeated measures design in which the request language was either pseudo SQL or manager English, the task included a query template or did not, and the task had either low or high query (code) complexity. Results show that both request language and template usage significantly affected query writing performance but in different situations. Pseudo SQL requests had a significant positive impact on query accuracy with less complex queries but had no impact with more complex queries. On the other hand, using a query template prior to writing SQL code improved task performance with more complex queries but not with less complex queries. We discuss the implications of these findings for instructional design and future research.