Skip to content

Commit 47ec0f2

Browse files
adamancerjd-foster
andauthored
Text clarifications and minor formatting fixes (#377)
* Specifies preferred macOS install option (#375) * Fixed formatting in proposed design lesson (#374) * Clarified how calculations are returned by SELECT (#372) * Clarified Open Database instruction (#370) * Fix typo in learners/discuss.md * Fix formatting in learners/discuss.md --------- Co-authored-by: James Foster <38274066+jd-foster@users.noreply.github.com>
1 parent b10aee2 commit 47ec0f2

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

episodes/00-sql-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ data retrieval from a relational database.
140140

141141
Let's look at a pre-existing database, the `portal_mammals.sqlite`
142142
file from the Portal Project dataset that we downloaded during
143-
[Setup](../learners/setup.md). Click on the "Open Database" button, select the portal\_mammals.sqlite file, and click "Open" to open the database.
143+
[Setup](../learners/setup.md). In DB Browser for SQLite, click on the "Open Database" button, select the portal\_mammals.sqlite file, and click "Open" to open the database.
144144

145145
You can see the tables in the database by looking at the left hand side of the
146146
screen under Database Structure tab. Here you will see a list under "Tables." Each item listed here corresponds to one of the `csv` files

episodes/01-sql-basic-queries.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,18 @@ For example, if we wanted to look at the mass of each individual
8484
on different dates, but we needed it in kg instead of g we would use
8585

8686
```sql
87-
SELECT year, month, day, weight/1000
87+
SELECT year, month, day, weight / 1000
8888
FROM surveys;
8989
```
9090

9191
When we run the query, the expression `weight / 1000` is evaluated for each
92-
row and appended to that row, in a new column. If we used the `INTEGER` data type
93-
for the weight field then integer division would have been done, to obtain the
94-
correct results in that case divide by `1000.0`. Expressions can use any fields,
95-
any arithmetic operators (`+`, `-`, `*`, and `/`) and a variety of built-in
96-
functions. For example, we could round the values to make them easier to read.
92+
row and appended in a new column to the table returned by the query. Note that
93+
the new column only exists in the query results—the surveys table itself is
94+
not changed. If we used the `INTEGER` data type for the weight field then
95+
integer division would have been done, to obtain the correct results in that
96+
case divide by `1000.0`. Expressions can use any fields, any arithmetic
97+
operators (`+`, `-`, `*`, and `/`) and a variety of built-in functions. For
98+
example, we could round the values to make them easier to read.
9799

98100
```sql
99101
SELECT plot_id, species_id, sex, weight, ROUND(weight / 1000, 2)

learners/discuss.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: Discussion
88

99
1. Order doesn't matter
1010
2. Every row-column combination contains a single *atomic* value, i.e., not
11-
containing parts we might want to work with separately.
11+
containing parts we might want to work with separately.
1212
3. One field per type of information
1313
4. No redundant information
1414
- Split into separate tables with one table per class of information
@@ -18,21 +18,23 @@ title: Discussion
1818
### Naming
1919

2020
- Naming conventions are important because:
21-
\* Names are used more than once
22-
\* Names are not usually subject to change (for example, spelling errors)
21+
22+
- Names are used more than once
23+
- Names are not usually subject to change (for example, spelling errors)
2324

2425
- Names should uniquely identify what the data is representing
2526

2627
- Names should be descriptive and familiar
2728

28-
- Names should adhere to certain standards: (General Tips)
29-
\* Names should not contain spaces (for example, nameofdata)
30-
\* Names should not start with numbers, rather add numbers at the end of the name (for example, name$
31-
\* Names should be full words, not abbreviations (for example, doctor)
32-
\* Underscores can separate words (for example, name\_of\_data)
33-
\* Data types are not names (for example, integer\_data instead of integer)
34-
\* Names are often in lowercase (for example, name)
35-
\* DO NOT use quotes when naming a table or field
29+
- Names should adhere to certain standards (general tips):
30+
31+
- Names should not contain spaces (for example, nameofdata)
32+
- Names should not start with numbers, rather add numbers at the end of the name (for example, name5)
33+
- Names should be full words, not abbreviations (for example, doctor)
34+
- Underscores can separate words (for example, name\_of\_data)
35+
- Data types are not names (for example, integer\_data instead of integer)
36+
- Names are often in lowercase (for example, name)
37+
- Do *not* use quotes when naming a table or field
3638

3739
### Other database management systems
3840

learners/setup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ for SQLite**, so it does not have to be installed separately.
3333

3434
- There are a few options for Windows, but most modern computers can use the `Standard installer for 64-bit Windows` version
3535
- The `.zip (no installer)` version can be run directly from the folder, after extracting the contents of the zip file. It will not show up in the `Start` menu.
36+
- There are also two options for macOS. Most people should use the `DB Browser for SQLite (Universal)` installer.
3637

3738
Launch **DB Browser for SQLite** to confirm that the installation was successful.
3839

0 commit comments

Comments
 (0)