Create a SQL Assignment

How to create a database template and then a SQL assignment for students to query

1

Open your class

2

Enter the class

3

Create a database template first

The "New Database Template" dialog is open, allowing you to define a database schema with SQL CREATE TABLE and INSERT statements that will be available to students. Notice the checkbox option to "Allow DML (INSERT/UPDATE/DELETE)" which you can uncheck if you want students to only run SELECT queries on read-only data. The blue notification at the bottom confirms that SQL assignments require a database template to be created first.

Create a database template first
4

Define the seed database

The teacher is creating a database template called "University DB" and defining the initial SQL schema in the seed database section. The SQL code creates two tables (students and courses) and populates them with sample data that students will work with in their assignments. Notice that the "Allow DML" checkbox controls whether students can modify the data or only run SELECT queries against this seeded database.

Define the seed database
5

Save the database template

Save the database template
6

Now create the SQL assignment

Now create the SQL assignment
7

Set up the SQL assignment

A teacher is creating a new SQL assignment with the title "SQL Lab 3 — Joins and Aggregates" and has selected SQL as the assignment type. The form shows the University DB database template has been selected, and there's a description field explaining that students will write queries using JOINs and aggregate functions. The assignment is set to be visible to students, with an optional deadline field available.

Set up the SQL assignment
8

Create the assignment

Create the assignment