Skip to content

Commit a023f49

Browse files
committed
Expanded SQL Documentation Per Issue #7604
Expanded SQL documentation, basing terminology and level of detail on the assumption of an audience that is nearly or mostly new to SQL.
1 parent b61a08e commit a023f49

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ GEM
3838
faraday-net_http (3.1.0)
3939
net-http
4040
ffi (1.16.3)
41+
ffi (1.16.3-x64-mingw-ucrt)
4142
forwardable-extended (2.6.0)
4243
gemoji (4.1.0)
4344
github-pages (231)
@@ -233,6 +234,8 @@ GEM
233234
uri
234235
nokogiri (1.16.3-arm64-darwin)
235236
racc (~> 1.4)
237+
nokogiri (1.16.3-x64-mingw-ucrt)
238+
racc (~> 1.4)
236239
nokogiri (1.16.3-x86_64-linux)
237240
racc (~> 1.4)
238241
octokit (4.25.1)
@@ -270,19 +273,23 @@ GEM
270273
unf (0.1.4)
271274
unf_ext
272275
unf_ext (0.0.9.1)
276+
unf_ext (0.0.9.1-x64-mingw-ucrt)
273277
unicode-display_width (1.8.0)
274278
uri (0.13.0)
279+
wdm (0.1.1)
275280
webrick (1.8.1)
276281
yell (2.2.2)
277282

278283
PLATFORMS
279284
arm64-darwin-22
285+
x64-mingw-ucrt
280286
x86_64-linux
281287

282288
DEPENDENCIES
283289
github-pages (= 231)
284290
html-proofer (~> 3.19.4)
285291
json
292+
wdm (>= 0.1.1)
286293
webrick (~> 1.8)
287294

288295
BUNDLED WITH

_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)