diff --git a/episodes/00-sql-introduction.md b/episodes/00-sql-introduction.md index b76c015a..d8092898 100644 --- a/episodes/00-sql-introduction.md +++ b/episodes/00-sql-introduction.md @@ -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 diff --git a/episodes/01-sql-basic-queries.md b/episodes/01-sql-basic-queries.md index fa3f9c49..76b5a850 100644 --- a/episodes/01-sql-basic-queries.md +++ b/episodes/01-sql-basic-queries.md @@ -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) diff --git a/learners/discuss.md b/learners/discuss.md index 34a93744..3ddc0dd0 100644 --- a/learners/discuss.md +++ b/learners/discuss.md @@ -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 @@ -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 diff --git a/learners/setup.md b/learners/setup.md index 0360e492..d9f231e6 100644 --- a/learners/setup.md +++ b/learners/setup.md @@ -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.