You can make your own autograded SQL problems in CodeHS Create. There are only a few steps to writing a good SQL program, and you can see a demo in the video below!
Create an assignment from the Create app or Assignments app
Step 1: Create a SQL Exercise
Click Create in the left-hand navigation menu to go to the Create app
Click Create New Assignment
Choose Coding Exercise > select a SQL Program Type
Fill in assignment details: title, description, and starter code
Step 2: Add Data and Starter/Solution Code
Click '...' next to the assignment > click Edit
Click the SQL Setup tab near the top
Add any SQL code needed to set up the exercise (such as creating tables and inserting data) in the
setup.sqlfile, and add the table names as a comma-separated list into thetablesfile.Be sure to click Save SQL Setup.
Enter your Starter Code and Solution Code using the tabs near the top.
SQL Setup Code
You can use this sample code to help create tables and add data:
CREATE TABLE Name (id, first_name, last_name, house);
INSERT into Name values ("1", "Harry", "Potter", "1");
INSERT into Name values ("2", "Ron", "Weasley", "1");
INSERT into Name values ("3", "Hermione", "Granger", "1");
INSERT into Name values ("4", "Severus", "Snape", "4");
CREATE TABLE House (house_name, house_id);
INSERT into House values ("Gryffindor", "1");
INSERT into House values ("Ravenclaw", "2");
INSERT into House values ("Hufflepuff", "3");
INSERT into House values ("Slytherin", "4");
Still have questions? Contact our team at support@codehs.com to learn more!



