Mimir Classroom now has extended support for database questions on assignments!

Before, there were limited implementations of IO test cases for MySQL, PostgreSQL, and SQLite. These were quite limited, and not necessarily designed well for use on Mimir Classroom. We've received a lot of feedback from users to help us design a more powerful and useful database testing system that is now available to all users of Mimir Classroom!

The latest implementation of Database Code Questions now has support for the following databases:

Microsoft SQL Server

Test Case Types

Query Results Tests

The Query Results test case type is for checking contents of user submitted queries. There is an option to allow for column/row order sensitivity, so you can check for queries that return the same information, regardless of strict ordering.

Check out the Query Results help documentation for more information!

Keywords Tests

Keywords tests allow you to specify specific strings or keywords that you expect should be (or not be) in your student's query. This allows you to quickly check that they used a specific type of join, a union, or created a table with specific constraints.

Check out the Keywords test help documentation for more information!

SQL Post Hook Query Tests

The SQL Post Hook Query test type is useful for checking submitted queries that aren't explicitly a simple SELECT query. You can use it to check that certain insertions/deletions/modifications were made, or that certain columns/tables were modified. It is much quicker to set up than a Python Post Hook Script test, but is a bit more limited due to only allowing a SQL query.

Check out the SQL Post Hook Query help documentation for more information!

Python Post Hook Script Tests

Python Post Hook Script tests are quite similar to the Custom test case type on standard code questions in that they can be used to accomplish pretty much anything in the context of that test. They are currently written in python, and give you direct access to the database that the student's code has interacted with, as well as a ton of environment variables you can use within the test. This provides an easy and powerful way to test your student's code!

Check out the Python Post Hook Script test help documentation for more information!


Along with the new database code questions, we're introducing a new concept - the Dataset. Datasets are a convenient way to set up a standard schema and even seed data into your assignment, so that you can reuse your database setup across questions and test cases!

Test cases inside of database questions currently require a Dataset. This Dataset will be auto run within the context of the database before executing any student code.

Did this answer your question?