Skip to content

Commit 2360c2b

Browse files
authored
Merge branch 'main' into main
2 parents 7a9d7fc + 91d2e24 commit 2360c2b

12 files changed

+37
-33
lines changed

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ are okay.
9696

9797
This update is run ~~weekly or~~ on demand.
9898

99-
### 03 Maintain: Update Pacakge Cache (update-cache.yaml)
99+
### 03 Maintain: Update Package Cache (update-cache.yaml)
100100

101101
For lessons that have generated content, we use {renv} to ensure that the output
102102
is stable. This is controlled by a single lockfile which documents the packages
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.15
1+
0.13.0

CONTRIBUTING.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ introduce yourself and to meet some of our community members.
2626

2727
2. If you have a [GitHub][github] account, or are willing to [create
2828
one][github-join], but do not know how to use Git, you can report problems
29-
or suggest improvements by [creating an issue][issues]. This allows us to
30-
assign the item to someone and to respond to it in a threaded discussion.
29+
or suggest improvements by [creating an issue][repo-issues]. This allows us
30+
to assign the item to someone and to respond to it in a threaded discussion.
3131

3232
3. If you are comfortable with Git, and would like to add or change material,
3333
you can submit a pull request (PR). Instructions for doing this are
34-
[included below](#using-github).
34+
[included below](#using-github). For inspiration about changes that need to
35+
be made, check out the [list of open issues][issues] across the Carpentries.
3536

3637
Note: if you want to build the website locally, please refer to [The Workbench
3738
documentation][template-doc].
@@ -49,8 +50,8 @@ There are many ways to contribute, from writing new exercises and improving
4950
existing ones to updating or filling in the documentation and submitting [bug
5051
reports][issues] about things that do not work, are not clear, or are missing.
5152
If you are looking for ideas, please see [the list of issues for this
52-
repository][repo], or the issues for [Data Carpentry][dc-issues], [Library
53-
Carpentry][lc-issues], and [Software Carpentry][swc-issues] projects.
53+
repository][repo-issues], or the issues for [Data Carpentry][dc-issues],
54+
[Library Carpentry][lc-issues], and [Software Carpentry][swc-issues] projects.
5455

5556
Comments on issues and reviews of pull requests are just as welcome: we are
5657
smarter together than we are on our own. **Reviews from novices and newcomers
@@ -101,7 +102,8 @@ community listed at <https://carpentries.org/connect/> including via social
101102
media, slack, newsletters, and email lists. You can also [reach us by
102103
email][contact].
103104

104-
[repo]: https://example.com/FIXME
105+
[repo]: https://github.com/LibraryCarpentry/lc-sql
106+
[repo-issues]: https://github.com/LibraryCarpentry/lc-sql/issues
105107
[contact]: mailto:[email protected]
106108
[cp-site]: https://carpentries.org/
107109
[dc-issues]: https://github.com/issues?q=user%3Adatacarpentry
@@ -111,7 +113,7 @@ email][contact].
111113
[github]: https://github.com
112114
[github-flow]: https://guides.github.com/introduction/flow/
113115
[github-join]: https://github.com/join
114-
[how-contribute]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
116+
[how-contribute]: https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github
115117
[issues]: https://carpentries.org/help-wanted-issues/
116118
[lc-issues]: https://github.com/issues?q=user%3ALibraryCarpentry
117119
[swc-issues]: https://github.com/issues?q=user%3Aswcarpentry

episodes/02-selecting-sorting-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ In the first query above, we have capitalized the words `SELECT` and `FROM` beca
4141

4242
Example:
4343

44-
```
44+
```sql
4545
SELECT Title, Authors, ISSNs, Year
4646
FROM Articles;
4747
```

episodes/04-ordering-commenting.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ their effects as we went along. For complex queries, this is a good strategy, t
7272

7373
When the queries become more complex, it can be useful to add comments to express to yourself, or to others, what you are doing with your query. Comments help explain the logic of a section and provide context for anyone reading the query. It's essentially a way of making notes within your SQL. In SQL, comments begin using <code class="language-plaintext highlighter-rouge">\--</code> and end at the end of the line. To mark a whole paragraph as a comment, you can enclose it with the characters /\* and \*/. For example, a commented version of the above query can be written as:
7474

75-
```
76-
/*In this section, even though JOINS (see link below this code block) are not introduced until Episode 6, we want to give an example how to
77-
join multiple tables becasue they represent a good example of using comments in SQL to explain more complex queries.*/
75+
```sql
76+
/*In this section, even though JOINS (see link below this code block)
77+
are not introduced until Episode 6, we want to give an example how to
78+
join multiple tables because they represent a good example of using
79+
comments in SQL to explain more complex queries.*/
7880

7981
-- First we mention all the fields we want to display
8082
SELECT articles.Title, articles.First_Author, journals.Journal_Title, publishers.Publisher

episodes/06-joins-aliases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ ON publishers.id = journals.PublisherId;
107107

108108
::::::::::::::::::::::::::::::::::::::: challenge
109109

110-
## Challenge:
110+
## Challenge
111111

112112
Write a query that returns the `Journal_Title`, `Publisher` name, and number of
113113
articles published, ordered by number of articles in descending order.

episodes/08-database-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Conceptually, we know that a journal has only one publisher but a publisher can
7676

7777
## More Terminology
7878

79-
The degree of relationship between entities is known as their 'cardinality'. Using the journals-publishers example, the 'publisheres' tble contains a primary key (PK) called 'id'. When the PK is used to create a connection between the original table and a different table, it is called a foreign key (FK) in the other table. To follow the example, we see a field in the 'journal' table called PublisherID that contains the values from the 'id' field in the 'publisher' table, connected the two tables.
79+
The degree of relationship between entities is known as their 'cardinality'. Using the journals-publishers example, the 'publishers' table contains a primary key (PK) called 'id'. When the PK is used to create a connection between the original table and a different table, it is called a foreign key (FK) in the other table. To follow the example, we see a field in the 'journal' table called PublisherID that contains the values from the 'id' field in the 'publisher' table, connecting the two tables.
8080

8181
There are 4 main types of relationships between tables:
8282

episodes/09-create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ stored in any particular order.)
175175

176176
::::::::::::::::::::::::::::::::::::::::::::::::::
177177

178-
Adaped from the Software Carpentry Course "Databases and SQL", Chapter 9. 'Creating and Modifying Data'.
178+
Adapted from the Software Carpentry Course "Databases and SQL", Chapter 9. 'Creating and Modifying Data'.
179179
<https://swcarpentry.github.io/sql-novice-survey/09-create>
180180

181181
:::::::::::::::::::::::::::::::::::::::: keypoints

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
site: sandpaper::sandpaper_site
33
---
44

5-
This Library Carpentry lesson introduces librarians to relational database management system using SQLite. At the conclusion of the lesson you will: understand what SQLite does; use SQLite to summarise and link data.
5+
This Library Carpentry lesson introduces librarians to relational database management system using SQLite. At the conclusion of the lesson you will: understand what SQLite does; use SQLite to summarise and link data.

learners/discuss.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Discussion
55
There are many ways to discuss Library Carpentry lessons:
66

77
- Join our [Gitter discussion forum](https://gitter.im/LibraryCarpentry/).
8-
- Join our [Slack organisation](https://swc-slack-invite.herokuapp.com/) and #libraries channel.
8+
- Join our [Slack organisation](https://slack-invite.carpentries.org/) and #libraries channel.
99
- Stay in touch with our [Topicbox Group](https://carpentries.topicbox.com/groups/discuss-library-carpentry).
1010
- Follow updates on [Twitter](https://twitter.com/LibCarpentry).
1111
- Make a suggestion or correct an error by [raising an Issue](https://github.com/LibraryCarpentry/lc-sql/issues) or [submitting a pull request](https://github.com/LibraryCarpentry/lc-sql/pulls).

learners/reference.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ title: 'SQL Cheat Sheet'
88

99
### Basic query
1010

11-
```
11+
```sql
1212
SELECT column_names
1313
FROM table_name;
1414
```
1515

1616
- selects only the specified columns from a table.
1717

18-
```
18+
```sql
1919
SELECT *
2020
FROM table_name;
2121
```
2222

2323
- select all of the columns in a table.
2424

25-
```
26-
SELECT DINSTINCT column_name
25+
```sql
26+
SELECT DISTINCT column_name
2727
FROM table_name;
2828
```
2929

3030
- selects only the unique values from a table.
3131

32-
```
32+
```sql
3333
SELECT column_names
3434
FROM table_name
3535
WHERE column_name operator value;
@@ -39,15 +39,15 @@ WHERE column_name operator value;
3939
- you can use operators `=`,`<`,`>`, etc
4040
- you can also combine tests using `AND`, `OR` in the WHERE clause.
4141

42-
```
42+
```sql
4343
SELECT column_names
4444
FROM table_name
4545
WHERE column_name IN (value1, value2, value3);
4646
```
4747

4848
- selects only the data where column\_name equals to `value1`, `value2`, and so on.
4949

50-
```
50+
```sql
5151
SELECT column_names
5252
FROM table_name
5353
ORDER BY column_name ASC;
@@ -59,7 +59,7 @@ ORDER BY column_name ASC;
5959

6060
### Aggregation
6161

62-
```
62+
```sql
6363
SELECT aggregate_function(column_name)
6464
FROM table_name;
6565
```
@@ -68,7 +68,7 @@ FROM table_name;
6868
- E.g. `SELECT COUNT(*) FROM table_name` will display the total number of records.
6969
- You can use aggregate functions `COUNT`, `SUM`, `MAX`, `MIN`, `AVG`.
7070

71-
```
71+
```sql
7272
SELECT column_name, aggregate_function(column_name)
7373
FROM table_name
7474
WHERE column_name operator value
@@ -77,7 +77,7 @@ GROUP BY column_name;
7777

7878
- `GROUP BY` tells SQL what field or fields we want to use to aggregate the data. If we want to group by multiple fields, we give `GROUP BY` a comma separated list.
7979

80-
```
80+
```sql
8181
SELECT column_name, aggregate_function(column_name)
8282
FROM table_name
8383
GROUP BY column_name
@@ -90,7 +90,7 @@ HAVING aggregate_function(column_name) operator value;
9090

9191
### Joins and aliases
9292

93-
```
93+
```sql
9494
SELECT column_names
9595
FROM table_name1
9696
JOIN table_name2
@@ -100,7 +100,7 @@ ON table_name1.column_name = table_name2.column_name;
100100
- Combine data from two tables where the values of column\_name in the two tables are the same.
101101
- Instead of `ON`, you can use the `USING` keyword as a shorthand. E.g. `USING (coolumn_name)`.
102102

103-
```
103+
```sql
104104
SELECT alias1.column_name1, alias1.column_name2, alias2.column_name3
105105
FROM table_name1 AS alias1
106106
JOIN table_name2 AS alias2
@@ -114,7 +114,7 @@ ON alias1.column_name = alias2.column_name;
114114

115115
### Saving queries
116116

117-
```
117+
```sql
118118
CREATE VIEW viewname AS
119119
SELECT column_names
120120
FROM table_name;
@@ -126,7 +126,7 @@ FROM table_name;
126126

127127
### Commenting
128128

129-
```
129+
```sql
130130
-- Select all columns
131131
SELECT *
132132
-- From the table_name

learners/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Note: on Windows, the PortableApp download is recommended as the regular version
1515
To import data, you'll need to open DB Browser for SQLite and download a zip file containing the data files for this tutorial.
1616

1717
1. Download the data files doaj-article-sample.zip from
18-
[Zenodo](https://doi.org/10.5281/zenodo.2822005).
18+
[Zenodo](https://doi.org/10.5281/zenodo.8360812).
1919
2. Open the zip file with the zip utlity on your machine and save the folder and files to a location where you can easily find them. For example, your Desktop.
2020
3. Contained in the zip file are two files, doaj-article-sample.db and doaj-article-sample.db.sql. You can either open the database file (less steps) or import the SQL file (more steps).
2121

0 commit comments

Comments
 (0)