Skip to content

Commit a241a96

Browse files
expliKatebmcutler
andauthored
[Documentation:InstructorUI] Expand SQL Doc. (#618)
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]>
1 parent d1d5f6a commit a241a96

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

_docs/instructor/course_management/sql_toolbox.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,39 @@ redirect_from:
55
- /instructor/sql_toolbox
66
---
77

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,
1011
Submitty provides for each course a "SQL Toolbox" that can be accessed from the
1112
sidebar. Within the toolbox, instructors may run a `SELECT` query and see the results
1213
in tabular format.
1314

15+
![](/images/sql_toolbox.png)
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:
31+
32+
[SQL Bolt](https://sqlbolt.com/)
33+
34+
[w3 Schools](https://www.w3schools.com/sql/sql_intro.asp)
35+
### Advanced Use
36+
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
1441
The toolbox does come with a number of important limitations, put in place to help
1542
prevent accidental data loss and general security. As such, the toolbox will:
1643

@@ -19,5 +46,3 @@ prevent accidental data loss and general security. As such, the toolbox will:
1946
* only run one query at a time. Attempting to run two queries separated by `;` will
2047
return an error.
2148
* run each query inside of a transaction that is rolled back and never committed.
22-
23-
![](/images/sql_toolbox.png)

0 commit comments

Comments
 (0)