Skip to content

Commit

Permalink
Text clarifications and minor formatting fixes (#377)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
adamancer and jd-foster authored Sep 11, 2024
1 parent b10aee2 commit 47ec0f2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion episodes/00-sql-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ data retrieval from a relational database.

Let's look at a pre-existing database, the `portal_mammals.sqlite`
file from the Portal Project dataset that we downloaded during
[Setup](../learners/setup.md). Click on the "Open Database" button, select the portal\_mammals.sqlite file, and click "Open" to open the database.
[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.

You can see the tables in the database by looking at the left hand side of the
screen under Database Structure tab. Here you will see a list under "Tables." Each item listed here corresponds to one of the `csv` files
Expand Down
14 changes: 8 additions & 6 deletions episodes/01-sql-basic-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,18 @@ For example, if we wanted to look at the mass of each individual
on different dates, but we needed it in kg instead of g we would use

```sql
SELECT year, month, day, weight/1000
SELECT year, month, day, weight / 1000
FROM surveys;
```

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

```sql
SELECT plot_id, species_id, sex, weight, ROUND(weight / 1000, 2)
Expand Down
24 changes: 13 additions & 11 deletions learners/discuss.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: Discussion

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

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

- Names are used more than once
- Names are not usually subject to change (for example, spelling errors)

- Names should uniquely identify what the data is representing

- Names should be descriptive and familiar

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

- Names should not contain spaces (for example, nameofdata)
- Names should not start with numbers, rather add numbers at the end of the name (for example, name5)
- Names should be full words, not abbreviations (for example, doctor)
- Underscores can separate words (for example, name\_of\_data)
- Data types are not names (for example, integer\_data instead of integer)
- Names are often in lowercase (for example, name)
- Do *not* use quotes when naming a table or field

### Other database management systems

Expand Down
1 change: 1 addition & 0 deletions learners/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ for SQLite**, so it does not have to be installed separately.

- There are a few options for Windows, but most modern computers can use the `Standard installer for 64-bit Windows` version
- 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.
- There are also two options for macOS. Most people should use the `DB Browser for SQLite (Universal)` installer.

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

Expand Down

0 comments on commit 47ec0f2

Please sign in to comment.