This topic is about adding a schema-creation script and test cases to an SQL question. Before this, you need to create and save an SQL question. For more information, see Adding SQL questions to the library.
After you save the question, you will see the following:
- Sample Explanation
- Max. Marks
- Allow partial scoring
- Allowed Languages
- Schema creation scripts
- Sample test case
- Test case files
- Edit checker limits
- Code snippets
A sample explanation is used to drive the candidate in the correct direction in terms of logic. This field can be used to explain that the sample output is derived from the sample input.
Use this field to add hints, explanations, or additional information about the problem. This will be visible to the candidates during the test as a part of the problem statement.
Specify the maximum score that a candidate can get for a specific problem. For example, 100.0.
Allow partial scoring
If this setting is checked, the candidate will be awarded a score based on the number of test cases that the candidate’s code has passed. When this setting is disabled, the candidate receives either no score or a full score only.
For example, assume that the allow partial scoring feature is enabled for a problem that has 10 test cases with a score of 10 marks each test case. If the candidate’s code has passed 3 test cases, then the score will be 30/100. If this feature is not enabled, then the candidate will receive a score of 0 or 100.
The following databases are supported on the Recruit platform.
- MSSQL (Microsoft SQL)
- Oracle Database
Schema Creation Scripts
A schema is the structure of a database. It is used to set up the test database for a submission.
For example, assume, that you have a table named 'Circle' that stores the following information:
- Coordinates of the center
In MySQL, the schema-creation script for this is as follows:
create table Circle(r it, x in, y nit);
The query in the schema script is database specific i.e. you must write different queries for different languages (MySQL, PostgreSQL, MSSQL, and Oracle Database).
Therefore, you should upload schema-creation scripts for all the checked databases.
Sample test case
Upload test cases that candidates can use to check the syntactical correctness of their queries. A test case will run a candidate’s query against a smaller set of data to ensure that the query does not have any syntax errors. There is no score associated with this.
Test case files
These are the files that are used to test a candidate’s solution and assign a score.
Edit checker limits
You can set the time limit within which a query must run on the test case files. This time can be set to a maximum of 10 seconds.
- The Advanced SQL-checker Settings section allows you to specify the following:
- Maximum code size for the submitted code (i.e. candidate’s code). For example, 1024 KB
- Memory limit for the submitted code (i.e. memory of a candidate’s code). For example, 256 MB
- Maximum number of tables that can exist in the database for a specific candidate’s submission. For example, 10 tables.
- Maximum number of rows in each table. For example, 30 rows.
Enter the answer to the problem in this field. This is only for the problem setter’s reference. It will not be visible to the candidate.
Add tags that are relevant to the question
You can add sample code snippets to the SQL question. These are pre-loaded in the code editor for candidates to use in the test. For more information, see Code snippets.