Sometimes instructors would like to ensure that their students have included specific types of keywords in their DB queries, or that they aren't using certain keywords. Think using a LEFT JOIN instead of a RIGHT JOIN, or making sure that they have created a table with a UNIQUE constraint on a field.

How it works

Currently, the keywords test case has a very simple syntax:

+ join

Each line is treated as an individual check. Keywords checked are case insensitive, and they will ignore any text inside of single or multiple line comments. Leading a line with a plus (+) makes it a required string. Leading a line with a minus (-) makes it a restricted string. White space is trimmed off of both sides of the string before it is used for comparison.

In the above case, this requires that the query contains LEFT and JOIN, and restricts use of RIGHT. The keywords test cases are currently pass/fail, so if any of these checks are failing, the entire test case is failed.

Keywords are not limited to just SQL reserved keywords, but will instead work for any text/string not inside of comments.

Did this answer your question?