2. Chapter 2: SQL Learnability
2.3 How Students Learn: A Cognitive Theory in Learning SQL
2.3.2 Cognitive Models in Learning SQL
Some studies provide a cognitive perspective on how the data model and query language influences learners’ query performance. Reisner [57] proposed a process where a user will generate a set of lexical items and also generate a query template, followed by the merging of the lexical items with the template to generate the final query (see Figure 2.6).
43
Figure 2.6: Query Writing Model Adapted Reisner [57]
Figure 2.7: Query Writing Model Adapted from Mannino’s [58]
Mannino [58] proposes a two-step model: from problem statement to database representation, and from the database representation into a database query language statement, as illustrated in Figure 2.7.
Figure 2.8: Three-Stage Cognitive Model Adapted from Ogden [59]
The model in Figure 2.8 presents an alternative three-stage cognitive model of database query proposed by Ogden [59]:
44
• Query formulation (stage 0): decide what data they need to solve the problem. One example is: “I need to know the average salary of employees who work in the sales department.” This stage relies on knowledge of the application domain.
• Query translation (stage 1): use the output from stage 0 as input, and decide what elements of the data model are relevant, and what the necessary operations are. One example of the output of this stage is: “The employee relation is needed, the column salary is to be selected, and the average to be calculated and a restriction of working in the sales department must be specified on column department. The output of this stage usually retained mentally by experts but written down by novices.
• Query writing (stage 2): write the query in SQL. For the example in the previous stage, to translate into SQL, would be: “select AVG (salary) from employee where…” This stage is heavily dependent on the particular query language syntax and semantics.
Through studying and analyzing these models, it is possible to say that, as individual model, they do not particularly mirror learner cognition and learning stages. They only show the abstract tasks that one can be involved in. Commonly, SQL novices seem to lack a deep understanding of the language construct and the way in which such constructs are used to solve problems [60], which suggests that Mannino’s model [58] might more accurately depict an expert’s processes than that of a learner. Novices often lack strategic knowledge - i.e. the ability to apply syntactic and semantic knowledge to solve novel problems [61]. Strategic knowledge supports stage 0 and stage 1 of the model in Figure 2.8, and without it, a novice might very well go straight to stage 2, to the detriment of learning and the query quality.
By comparing relevant elements from these models, it is possible to propose a new model that combines elements from Mannino [58] and Ogden [59] models and includes the cognitive science representation of solving problem. In addition, the model highlights the presence of instructional materials.
45
Cognitive psychologists think of a problem as consisting of an initial state and a goal state, and to solve a problem a person must perform some action (operators) to move from initial state to goal state [62]. Therefore, it is possible to consider the” problem statements” in Mannino model as the initial state and the “query language statements” as the goal state. In addition, the three cognitive processes in Ogden [59] model can be used as the set of operators to move from initial to goal state. Figure 2.9 shows this model to solve SQL problems.
Figure 2.9: SQL Cognitive Model
This leads to investigate other skills, knowledge or tools that need to be available to learners during the process of SQL acquisition. Moreover, the action or process (operators) that happened between exposing students to the problem and presenting the final query is missing. Ogden [59] model presents those as actions or tasks. Integrating these models helps depict how students solve SQL problems.
As a result, the proposed model in Figure 2.9 was enhanced by adding another cognitive process called Evaluation. One could say any problem solver should evaluate the work that has been carried at different stages.
46
Figure 2.10: The Practice Stage of SQL Learning Taxonomy
Moreover, during problem solving students need tools, knowledge to support solving the problem (such as instructional materials) and database representations, which could be part of any instructional material. This model is illustrated in Figure 2.10, which presents the different stages and tools learners employ during problem solving process that consists of the following:
Problem or task environment: this consists of the “Query problem” statement
and the context in which a problem is encountered. Students’ understanding of the problem is based on experience of the major variables or facts that are relevant to the problem. Thus, at this stage, learners need to have some pre- existing knowledge about both the context of the given problem and the problem itself. This might be achieved during the lecture or the tutorial by exposing students to some examples or cases that have similar characteristics. As a result, problem interpretation might be straight forward.
It can be concluded that the initial representation of query problems is crucial in helping students in deciding and identifying the initial state of the problem. It influences their decisions about the goals of the problem and the related operations that need to be performed.
47
Query Formulation stage: this might be called analysis task or operator used
stage. At this stage, students try to define the major variables and figure out the required knowledge and skills. This stage is affected by students’ skills and knowledge level. Problem solving skills are essential at this stage. Learners are required to divide the problem into small problems, identify the facts and the required knowledge. Moreover, knowledge of underlining database presentation and concepts is crucial at this stage.
Query Translation stage: this can be called task syntheses. In addition to the
database knowledge, learners require SQL knowledge. Thus, they might be able to decide about the different required data. For example: tables, columns, relations, keys.
Query writing stage: or the application stage. At this stage, the learner is
assumed able to write the related SQL query. Thus, SQL knowledge and syntax is important. This stage leads to the final element in the model, which is output result.
Output result: this presents the output of the query.
Evaluation stage: this is the last destination, where students need to reflect on
the results of the previous stage and make a decision about whether the goal of the initial state was achieved or not. If not, then learners need to check the decision taken at one of the above stages. For example, they might need to check their understanding of the problem or their formulation or translation attempts.
Supported materials: such as tools, Database structure, and instructional
materials.
Looking at CS problem solving – the practice stage of “CS Learning Taxonomy” (Figure 2.3), it is possible to conclude that to help students to become reasonably experts with query problem solving, it is essential to know in some
48
details the stages they pass through on their mental process from novice to SQL mastery. To do this, course designers, researchers or educators need to expose both novices and experts to a query problem and observe everything they do.
Gathered data could be analysed in light of some questions, such as: how do participants engage in the problem solving process? Do certain instructional processes help subjects acquire these processes effectively? This is explored in more details in chapter 6.