Skip to content

Commit 74b0be6

Browse files
zkamvarCarpentries Apprentice
authored andcommitted
[custom] fix lesson contents
1 parent 0810334 commit 74b0be6

15 files changed

Lines changed: 19 additions & 25 deletions

episodes/04-ordering-commenting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ JOIN publishers
9090
ON publishers.id = journals.PublisherId;
9191
```
9292

93-
To see the introduction and explanation of JOINS, please click to [Episode 6](https://librarycarpentry.org/lc-sql/06-joins-aliases/index.html).
93+
To see the introduction and explanation of JOINS, please click to [Episode 6](06-joins-aliases.md).
9494
{: .sql}
9595

9696
:::::::::::::::::::::::::::::::::::::::: keypoints

episodes/05-aggregating-calculating.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ FROM articles
111111
ORDER BY Author_Count -1 DESC;
112112
```
113113

114-
In section [6\. Joins and aliases](https://librarycarpentry.org/lc-sql/06-joins-aliases/index.html) we are going to learn more about the SQL keyword `AS` and how to make use of aliases - in this example we simply used the calculation and `AS` to represent that the new column is different from the original SQL table data.
114+
In section [6\. Joins and aliases](06-joins-aliases.md) we are going to learn more about the SQL keyword `AS` and how to make use of aliases - in this example we simply used the calculation and `AS` to represent that the new column is different from the original SQL table data.
115115

116116
We can use any arithmetic operators (like `+`, `-`, `*`, `/`, square root `SQRT` or the modulo operator `%`) if we would like.
117117

118-
If you would like to learn more about calculated values, the Software Carpentry Databases and SQL lesson includes a useful episode on [Calculating New Values](https://swcarpentry.github.io/sql-novice-survey/04-calc/index.html).
118+
If you would like to learn more about calculated values, the Software Carpentry Databases and SQL lesson includes a useful episode on [Calculating New Values](https://swcarpentry.github.io/sql-novice-survey/04-calc).
119119

120120
:::::::::::::::::::::::::::::::::::::::: keypoints
121121

episodes/06-joins-aliases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ USING (ISSNs);
4949

5050
This figure shows the relations between the tables and helps to visualise joining or linking the tables in the database:
5151
![](fig/articles-erd-v02.png){alt='Articles Database'}
52-
We will cover [relational database design](https://librarycarpentry.org/lc-sql/08-database-design/index.html) in the next episode. In addition to visual above, *[SQL Join Types Explained Visually](https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/)* provides visual/animated examples to help convey to learners what is happening in SQL `JOIN`s.
52+
We will cover [relational database design](08-database-design.md) in the next episode. In addition to visual above, *[SQL Join Types Explained Visually](https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/)* provides visual/animated examples to help convey to learners what is happening in SQL `JOIN`s.
5353

5454
When joining tables, you can specify the columns you want by using `table.colname` instead of selecting all the columns using `*`. For example:
5555

episodes/08-database-design.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exercises: 20
1818

1919
## Spreadsheets
2020

21-
In libraries, spreadsheets are often created to keep lists of a variety of things like an inventory of equipment, reference statistics, or items to review for purchase (See *[What are some of the uses for SQL in libraries?](https://librarycarpentry.org/lc-sql/01-introduction/index.html)*). Spreadsheets, sometimes referred to as tabular data or flat files, are an easy way to display data organized in columns and rows. Column headers describe the data contained in corresponding columns. Each row is a record (sometimes called an observation) with data about it contained in separate column cells.
21+
In libraries, spreadsheets are often created to keep lists of a variety of things like an inventory of equipment, reference statistics, or items to review for purchase (See *[What are some of the uses for SQL in libraries?](01-introduction.md)*). Spreadsheets, sometimes referred to as tabular data or flat files, are an easy way to display data organized in columns and rows. Column headers describe the data contained in corresponding columns. Each row is a record (sometimes called an observation) with data about it contained in separate column cells.
2222

2323
Spreadsheets can make data gathering easier but they can also lead to messy data. Over time, if you gather enough data in spreadsheets, you will likely end up with inconsistent data (i.e. misformatted, misspelled data).
2424

@@ -39,8 +39,6 @@ In the figure below, can you identify where inconsistencies in the data have bee
3939
3. Date format is MM/DD/YYYY and not the commonly used ISO 8601 format;
4040
4. The "Subjects" column delimits data by pipes and the data is in a variety of formats such as abbreviations, classifications, and sometimes capitalised.
4141
**Can you spot anything else?**
42-
43-
4442

4543
:::::::::::::::::::::::::
4644

@@ -54,9 +52,9 @@ Database design involves a model or plan developed to determine how the data is
5452

5553
## Terminology
5654

57-
<img src="assets/img/field-record-value.png" alt="Fields, Records, Values" width="500"/>
55+
<img src="fig/field-record-value.png" alt="Fields, Records, Values" width="500"/>
5856

59-
In the [Introduction to SQL](https://librarycarpentry.org/lc-sql/01-introduction/index.html) lesson, we introduced the terms "fields", "records", and "values". These terms are commonly used in databases while the "columns", "rows", and "cells" terms are more common in spreadsheets. Fields store a single kind of information (text, integers, etc.) related to one topic (title, author, year), while records are a set of fields containing specific values related to one item in your database (a book, a person, a library).
57+
In the [Introduction to SQL](01-introduction.md) lesson, we introduced the terms "fields", "records", and "values". These terms are commonly used in databases while the "columns", "rows", and "cells" terms are more common in spreadsheets. Fields store a single kind of information (text, integers, etc.) related to one topic (title, author, year), while records are a set of fields containing specific values related to one item in your database (a book, a person, a library).
6058

6159
To design a database, we must first decide what kinds of things we want to represent as tables. A table is the physical manifestation of a kind of "entity". An entity is the conceptual representation of the thing we want to store informtation about in the database, with each row containing information about one entity. An entity has "attributes" that describe it, represented as fields. For example, an article or a journal is an entity. Attributes would be things like the article title, or journal ISSN which would appear as fields.
6260

@@ -116,8 +114,6 @@ For this exercise, you can either use pencil/pen and paper to draw new tables an
116114
1. An 'authors' table can be created with a many-to-many relationship with the 'articles' table and an [associative entity](https://en.wikipedia.org/wiki/Associative_entity) or bridge table between them.
117115
2. A 'subjects' table can be created with a many-to-many relationship with the 'articles' table and a bridge table between them.
118116
**Can you spot anything else?**
119-
120-
121117

122118
:::::::::::::::::::::::::
123119

episodes/09-create.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Be very careful when doing this:
4646
if you drop the wrong table, hope that the person maintaining the database has a backup,
4747
but it's better not to have to rely on it.
4848

49-
We talked about data types earlier [in Introduction to SQL: SQL Data Type Quick Reference](https://librarycarpentry.org/lc-sql/01-introduction/index.html#sql-data-type-quick-reference).
49+
We talked about data types earlier [in Introduction to SQL: SQL Data Type Quick Reference](01-introduction.md#sql-data-type-quick-reference).
5050

5151
When we create a table,
5252
we can specify several kinds of constraints on its columns.
@@ -170,19 +170,13 @@ stored in any particular order.)
170170
#### Disadvantages
171171

172172
- Artificial differences between commits because records don't have a fixed order
173-
174-
175173

176174
:::::::::::::::::::::::::
177175

178176
::::::::::::::::::::::::::::::::::::::::::::::::::
179177

180178
Adaped from the Software Carpentry Course "Databases and SQL", Chapter 9. 'Creating and Modifying Data'.
181-
[https://github.com/swcarpentry/sql-novice-survey/edit/gh-pages/\_episodes/09-create.md](https://github.com/swcarpentry/sql-novice-survey/edit/gh-pages/_episodes/09-create.md)
182-
183-
[create-table]: https://www.sqlite.org/lang_createtable.html
184-
[drop-table]: https://www.sqlite.org/lang_droptable.html
185-
179+
<https://swcarpentry.github.io/sql-novice-survey/09-create>
186180

187181
:::::::::::::::::::::::::::::::::::::::: keypoints
188182

@@ -195,4 +189,8 @@ Adaped from the Software Carpentry Course "Databases and SQL", Chapter 9. 'Creat
195189

196190
::::::::::::::::::::::::::::::::::::::::::::::::::
197191

192+
[create-table]: https://www.sqlite.org/lang_createtable.html
193+
[drop-table]: https://www.sqlite.org/lang_droptable.html
194+
195+
198196

episodes/fig/articles-erd-v02.png

40.8 KB
Loading

episodes/fig/articles-erd.png

42.2 KB
Loading

episodes/fig/doaj-spreadsheet.png

175 KB
Loading
68.8 KB
Loading

episodes/fig/join.png

13.3 KB
Loading

0 commit comments

Comments
 (0)