The SQL question type assesses database querying with automatic grading. The candidate gets a ready database, writes a query in an editor, and the platform compares their result with the result of your reference solution.
The database runs on SQLite, both for the file you upload and for the script you write. Features exclusive to other databases, such as MySQL, PostgreSQL or SQL Server, will not work.
How to create the question
Go to Assessment > Library > Create > Question.
Select the SQL format and click Continue.
Fill in the Settings tab with the prompt and the rules of the question.
Build the database in the Choose the Configuration model card.
Write the Code stub and the Solution, then run them to check the output.
Save the question.
Settings tab
This is where the question gets its prompt and rules:
Main language: Portuguese, English or Spanish.
Title and Description: what the candidate reads. Describe what the query must return, which columns are expected and in what order.
Duration: the time available to answer.
Level and Weight: difficulty and how much the question counts in the assessment.
Score limits (%): the floor and the ceiling of the question percentage.
Partial score: sets whether the answer must match the solution exactly or can earn a proportional score.
Skills, Type and Job/category: the classification used by the Library filters.
Guidelines for revision: Goal of the question and How to evaluate, used by the review team.
In the Presentation tab you can turn on Video and write the Presentation explanation. The candidate then records a video explaining the query after answering it.
How to build the database
In the Choose the Configuration model card, pick the Format:
File: upload a ready SQLite database with a
.sqliteor.sqlite3extension, up to 10 MB, holding at least one table with data. The platform checks the extension, the size, the file integrity and the presence of data before finishing the upload.Editor: write the setup script on screen, with
CREATE TABLEandINSERTstatements. The script must be SQLite-compatible and is limited to 1 MB. It is validated as you type.
Databases you have already uploaded stay in the list and can be reused across other SQL questions, with no need to upload them again.
The table names are shown to the candidate next to the prompt, under Available tables. The columns themselves are only discovered by querying, so write in the prompt everything the candidate needs to build the query.
Code stub and Solution
Code stub: the text already in the editor when the candidate starts. Use it for guiding comments or for the skeleton of the query.
Solution: the reference query. Its output becomes the expected result used for grading.
Run the query before saving. The platform executes the code and shows the output as a table, so you can confirm that the solution returns exactly what the prompt asks for.
How grading works
Grading compares the candidate result with the result of the Solution, row by row. Keep in mind that:
column names are compared case-insensitively, and the column order does not matter;
row order does matter. Whenever order is relevant, use
ORDER BYin the solution and make it explicit in the prompt;when the query has more than one statement, the comparison uses the output of the last one;
with Partial score off, grading is all or nothing: the answer must match the solution;
with Partial score on, the score is proportional to the correct fields and rows.
The final score comes from the query the candidate had saved when they finished the question.
What the candidate sees
They open the question with the prompt and the table list on one side and the SQL editor on the other. Running the query shows the output as a table, highlighting the rows that differ from the expected ones, the extra rows and the missing ones. When video is enabled, the recording happens after the answer.
In the assessment results you see the submitted query, the score and the video, when there is one.
Tips for a good SQL question
Prefer small databases with realistic data. Too few rows make trial and error easy.
Handle ties: if two rows could swap places, add a second sorting criterion.
State the expected column names and order in the prompt, or use clear aliases in the solution.
Run the solution before saving and confirm the output is really what you want to assess.
If the question accepts more than one valid path with different outputs, consider turning partial score on.
Frequently asked questions
Can I use MySQL, PostgreSQL or SQL Server?
No. The database runs on SQLite, so both the uploaded file and the editor script must be SQLite-compatible. Statements and functions exclusive to other databases fail at execution.
Do I have to upload the database file for every question?
No. Databases you have already uploaded stay available in the SQLite file list and can be reused in other questions.
My file was rejected on upload. What should I check?
The validation points to the reason: an extension other than .sqlite or .sqlite3, a size above 10 MB, a corrupted file, or a database with no table holding data.
Is grading really automatic?
Yes. The score comes from comparing the candidate output with the solution output, with no manual review. Human review is still possible from the assessment results, as with any other question.
The question type shows a Beta badge. Can I use it?
Yes. The badge means the format is recent and still evolving, so it may receive improvements over time.
See also: What you find in the Library
