Generating SQL Queries from Visual Specifications

  • George ObaidoEmail author
  • Abejide Ade-Ibijola
  • Hima Vadapalli
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 963)


The Structured Query Language (SQL) is the most widely used declarative language for accessing relational databases, and an essential topic in introductory database courses in higher learning institutions. Despite the intuitiveness of SQL, formulating and comprehending written queries can be confusing, especially for undergraduate students. One major reason for this is that the simple syntax of SQL is often misleading and hard to comprehend. A number of tools have been developed to aid the comprehension of queries and to improve the mental models of students concerning the underlying logic of SQL. Some of these tools employed visualisation and animation in their approach to aid the comprehension of SQL. This paper presents an interactive comprehension aid based on visualisation, specifically designed to support the SQL SELECT statement, an area identified in the literature as problematic for students. The visualisation tool uses visual specifications depicting SQL operations to build queries. This is expected to reduce the cognitive load of a student who is learning SQL. We have shown with an online survey that adopting visual specifications in teaching systems assist students in attaining a richer learning experience in introductory database courses.


SQL comprehension Visual specification Learning via visualisation 



Thanks to South Africa’s Department of Science and Technology (DST) and the Council for Scientific and Industrial Research (CSIR) for the DST-CSIR inter-bursary support programme that funds our research (


  1. 1.
    Ade-Ibijola, A.: Automatic novice program comprehension for semantic bug detection. Doctoral Dissertation (2016)Google Scholar
  2. 2.
    Ade-Ibijola, A.: New Finite Automata Applications in Novice Program Comprehension. Lambert Academic Publishing, Riga (2017)Google Scholar
  3. 3.
    Ade-Ibijola, A., Ewert, S., Sanders, I.: Abstracting and narrating novice programs using regular expressions. In: Proceedings of the Annual Conference of the South African Institute for Computer Scientists and Information Technologists, SAICSIT 2014, pp. 19–28. ACM (2014)Google Scholar
  4. 4.
    Ahadi, A., Behbood, V., Vihavainen, A., Prior, J., Lister, R.: Students’ syntactic mistakes in writing seven different types of SQL queries and its application to predicting students’ success. In: Proceedings of the 47th ACM Technical Symposium on Computing Science Education, pp. 401–406 (2016)Google Scholar
  5. 5.
    Aken, A., Michalisin, M.D.: The impact of the skills gap on the recruitment of MIS graduates. In: Proceedings of the ACM SIGMIS Conference on Computer Personnel Research, pp. 105–111 (2007)Google Scholar
  6. 6.
    Allenstein, B., Yost, A., Wagner, P., Morrison, J.: A query simulation system to illustrate database query execution. ACM SIGCSE Bull. 40(1), 493–497 (2008)CrossRefGoogle Scholar
  7. 7.
    Bau, D.: Droplet, a blocks-based editor for text code. J. Comput. Sci. Coll. 30(6), 138–144 (2015)MathSciNetGoogle Scholar
  8. 8.
    Brown, C.M.: Human-Computer Interface Design Guidelines. Intellect Books, Bristol (1998)Google Scholar
  9. 9.
    Caldeira, C.P.: Teaching SQL: a case study. ACM SIGCSE Bull. 40, 340 (2008)CrossRefGoogle Scholar
  10. 10.
    Cembalo, M., de Santis, A., Ferraro-Petrillo, U.: SAVI: a new system for advanced SQL visualization. In: Proceedings of the Conference on Information Technology Education, pp. 165–170. ACM (2011)Google Scholar
  11. 11.
    Cooper, S., Dann, W., Pausch, R.: Teaching objects-first in introductory computer science. ACM SIGCSE Bull. 35, 191–195 (2003)CrossRefGoogle Scholar
  12. 12.
    Danaparamita, J., Gatterbauer, W.: QueryViz: helping users understand SQL queries and their patterns. In: Proceedings of the 14th International Conference on Extending Database Technology, pp. 558–561. ACM (2011)Google Scholar
  13. 13.
    Dann, W.P., Cooper, S., Pausch, R.: Learning to Program with Alice 2. Prentice Hall, Upper Saddle River (2008)Google Scholar
  14. 14.
    Davis, P.: What computer skills do employees expect from recent college graduates? J. Technol. Horiz. Educ. 25(2), 74 (1997)Google Scholar
  15. 15.
    Dekeyser, S., de Raadt, M., Lee, T.Y.: Computer assisted assessment of SQL query skills. In: Proceedings 18th Conference on Australian Databases, pp. 53–62. Australian Computer Society, Inc. (2007)Google Scholar
  16. 16.
    Ellis, G., Dix, A.: A taxonomy of clutter reduction for information visualisation. IEEE Trans. Vis. Comput. Graph. 13(6), 1216–1223 (2007)CrossRefGoogle Scholar
  17. 17.
    Ellis, G., Mansmann, F.: Mastering the information age solving problems with visual analytics. In: Proceedings of the Eurographics, vol. 2, p. 5 (2010)Google Scholar
  18. 18.
    Fincher, S.: What are we doing when we teach programming? In: Proceedings of the Frontiers in Education conference, pp. 12A4. IEEE (1999)Google Scholar
  19. 19.
    Folland, K.A.T.: viSQLizer: an interactive visualizer for learning SQL. Master’s thesis (2016)Google Scholar
  20. 20.
    Garner, P., Mariani, J.A.: Learning SQL in steps. J. Syst. Cybern. Inf. 13(4), 19–24 (2015)Google Scholar
  21. 21.
    Gray, C., Malins, J.: Visualizing Research: A Guide to the Research Process in Art and Design. Routledge, Abingdon (2016)CrossRefGoogle Scholar
  22. 22.
    Grillenberger, A., Brinda, T.: eledSQL: a new web-based learning environment for teaching databases and SQL at secondary school level. In: Proceedings 7th Workshop on Primary and Secondary Computing Education, pp. 101–104. ACM (2012)Google Scholar
  23. 23.
    Jost, T., Ouerhani, N., von Wartburg, R., Müri, R., Hügli, H.: Assessing the contribution of color in visual attention. Comp. Vis. Image Underst. 100(1/2), 107–123 (2005)CrossRefGoogle Scholar
  24. 24.
    Kawash, J.: Formulating second-order logic conditions in SQL. In: Proceedings of the 15th Annual Conference on Information technology education, pp. 115–120. ACM (2014)Google Scholar
  25. 25.
    Kearns, R., Shead, S., Fekete, A.: A teaching system for SQL. In: Proceedings of the 2nd Australasian Conference on Computer Science Education, pp. 224–231. ACM (1997)Google Scholar
  26. 26.
    Keim, D.A., Mansmann, F., Schneidewind, J., Thomas, J., Ziegler, H.: Visual analytics: scope and challenges. In: Simoff, S.J., Böhlen, M.H., Mazeika, A. (eds.) Visual Data Mining. LNCS, vol. 4404, pp. 76–90. Springer, Heidelberg (2008). Scholar
  27. 27.
    Kellems, R.O., Gabrielsen, T.P., Williams, C.: Using visual organizers and technology: supporting executive function, abstract language comprehension, and social learning. In: Cardon, T.A. (ed.) Technology and the Treatment of Children with Autism Spectrum Disorder. ACPS, pp. 75–86. Springer, Cham (2016). Scholar
  28. 28.
    Kriegel, A.: Discovering SQL: A Hands-on Guide for Beginners. Wiley, Hoboken (2011)Google Scholar
  29. 29.
    Kyfonidis, C., Moumoutzis, N., Christodoulakis, S.: Block-C: a block-based programming teaching tool to facilitate introductory C programming courses. In: Proceedings of the IEEE Global Engineering Education Conference, pp. 570–579 (2017)Google Scholar
  30. 30.
    Lee, Y.Y., Chen, N., Johnson, R.E.: Drag-and-drop refactoring: intuitive and efficient program transformation. In: Proceedings of the International Conference on Software Engineering, ICSE 2013, pp. 23–32, IEEE (2013)Google Scholar
  31. 31.
    Liberty, J.: Programming C#: building .NET applications with C. O’Reilly, Sebastopol (2005)Google Scholar
  32. 32.
    Lye, S.Y., Koh, J.H.L.: Review on teaching and learning of computational thinking through programming: what is next for K-12? Comput. Hum. Behav. 41, 51–61 (2014)CrossRefGoogle Scholar
  33. 33.
    Malan, D.J., Leitner, H.H.: Scratch for budding computer scientists. ACM SIGCSE Bull. 39, 223–227 (2007)CrossRefGoogle Scholar
  34. 34.
    Mitrovic, A.: An intelligent SQL tutor on the web. Int. J. Artif. Intel. Educ. 13(2/4), 173–197 (2003)Google Scholar
  35. 35.
    Myalapalli, V.K., Shiva, M.B.: An appraisal to optimize SQL queries. In: Proceedings of the International Conference on Pervasive Computing, pp. 1–6. IEEE (2015)Google Scholar
  36. 36.
    Nagataki, H., Nakano, Y., Nobe, M., Tohyama, T., Kanemune, S.: A visual learning tool for database operation. In: Proceedings of the 8th Workshop in Primary and Secondary Computing Education, pp. 39–40. ACM (2013)Google Scholar
  37. 37.
    Prior, J.C., Lister, R.: The backwash effect on SQL skills grading. ACM SIGCSE Bull. 36(3), 32–36 (2004)CrossRefGoogle Scholar
  38. 38.
    Renaud, K., van Biljon, J.: Teaching SQL—which pedagogical horse for this course? In: Williams, H., MacKinnon, L. (eds.) BNCOD 2004. LNCS, vol. 3112, pp. 244–256. Springer, Heidelberg (2004). Scholar
  39. 39.
    Resnick, M., et al.: Scratch: programming for all. Commun. ACM 52(11), 60–67 (2009)CrossRefGoogle Scholar
  40. 40.
    Rizvi, M., Humphries, T., Major, D., Jones, M., Lauzun, H.: A CS0 course using Scratch. J. Comput. Sci. Coll. 26(3), 19–27 (2011)Google Scholar
  41. 41.
    Sadiq, S., Orlowska, M., Sadiq, W., Lin, J.: SQLator: an online SQL learning workbench. ACM SIGCSE Bull. 36, 223–227 (2004)CrossRefGoogle Scholar
  42. 42.
    Satyanarayan, A., Heer, J.: Lyra: an interactive visualization design environment. Comput. Graph. Forum 33, 351–360 (2014)CrossRefGoogle Scholar
  43. 43.
    Wang, K., McCaffrey, C., Wendel, D., Klopfer, E.: 3D game design with programming blocks in StarLogo TNG. In: Proceedings of the 7th International Conference on Learning Sciences, pp. 1008–1009 (2006)Google Scholar
  44. 44.
    Yassine, A., Chenouni, D., Berrada, M., Tahiri, A.: A serious game for learning C programming language concepts using solo taxonomy. Int. J. Emerg. Technol. Learn. 12(3), 110–127 (2017)CrossRefGoogle Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  • George Obaido
    • 2
    Email author
  • Abejide Ade-Ibijola
    • 1
  • Hima Vadapalli
    • 2
  1. 1.Department of Applied Information SystemsUniversity of JohannesburgJohannesburgSouth Africa
  2. 2.School of Computer Science and Applied MathematicsUniversity of the WitwatersrandJohannesburgSouth Africa

Personalised recommendations