You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expanded SQL documentation, basing terminology and level of detail on
the assumption of an audience that is nearly or mostly new to SQL. This
is in response to issue
[#7604](Submitty/Submitty#7604), which
suggests adding example code and simple instructions for novice SQL
users to the existing documentation.
At a minimum, this should be reviewed for:
- language conforming to existing documentation
- level of detail appropriate for novices and beginners
- whether formatting and organization convey ideas as clearly as
possible
---------
Co-authored-by: Barb Cutler <[email protected]>
Copy file name to clipboardExpand all lines: _docs/instructor/course_management/sql_toolbox.md
+29-4Lines changed: 29 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,39 @@ redirect_from:
5
5
- /instructor/sql_toolbox
6
6
---
7
7
8
-
While Submitty provides mechanisms of getting information about a course, or grades, an
9
-
instructor may wish to run one-off queries against their database. To facilitate this,
8
+
While Submitty already provides information about courses and grades, an
9
+
instructor may wish to run one-off queries against Submitty's database in order to see
10
+
information in a format of their own choosing. To facilitate this,
10
11
Submitty provides for each course a "SQL Toolbox" that can be accessed from the
11
12
sidebar. Within the toolbox, instructors may run a `SELECT` query and see the results
12
13
in tabular format.
13
14
15
+

16
+
### Basic Use
17
+
The button labeled "Database Schema Documentation" at the top of the SQL Toolbox page
18
+
contains details of all the information stored by Submitty and how these different
19
+
pieces of information relate to one another.
20
+
21
+
One simple query you can use the SQL toolbox for is to check what assignment IDs you've already used when trying to decide on a new one. The code for that looks like:
22
+
```TSQL
23
+
SELECT g_id from gradeable
24
+
```
25
+
If you have a lot of gradeables, it might help to sort the output of that code like so:
26
+
```TSQL
27
+
SELECT g_id from gradeable ORDER BY g_id
28
+
```
29
+
### Outside Learning Sources
30
+
If you're brand new to writing SQL queries, here are a couple of popular resources for learning:
Once you're comfortable with writing SQL and have explored the database schema documentation some, you can start to write more complex queries. The query below shows all comments that have been written on all submissions from one student (username dents5 for this example):
37
+
```TSQL
38
+
SELECT comm.*, g.g_grade_due_date FROM gradeable_data_overall_comment comm INNER JOIN gradeable g ON comm.g_id = g.g_id WHERE comm.goc_user_id = 'dents5' ORDER BY comm.g_id
39
+
```
40
+
### Limitations
14
41
The toolbox does come with a number of important limitations, put in place to help
15
42
prevent accidental data loss and general security. As such, the toolbox will:
16
43
@@ -19,5 +46,3 @@ prevent accidental data loss and general security. As such, the toolbox will:
19
46
* only run one query at a time. Attempting to run two queries separated by `;` will
20
47
return an error.
21
48
* run each query inside of a transaction that is rolled back and never committed.
0 commit comments