Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : fc804ca
Branch  : main
Author  : The Carpentries Apprentice (beta) <[email protected]>
Time    : 2023-09-13 19:48:43 +0000
Message : [actions] update sandpaper workflow to version 0.13.0 (datacarpentry#366)

Co-authored-by: zkamvar <[email protected]>
  • Loading branch information
actions-user and zkamvar committed Oct 12, 2023
1 parent d1d191e commit 03bc66d
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 21 deletions.
9 changes: 8 additions & 1 deletion 03-sql-joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,14 @@ In fact the `JOIN` keyword is simply shorthand for `INNER JOIN` and the two
terms can be used interchangeably as they will produce the same result.

We can also tell the computer that we wish to keep all the records in the first
table by using a `LEFT OUTER JOIN` clause, or `LEFT JOIN` for short.
table by using a `LEFT OUTER JOIN` clause, or `LEFT JOIN` for short. The difference
between the two JOINs can be visualized like so:

![
Diagrams representing INNER JOIN and LEFT JOIN in SQLite
](fig/sql-joins.png){
alt='Diagrams representing INNER JOIN and LEFT JOIN each include two overlapping circles labeled A (left) and B (right). For INNER JOIN, the intersection of the two circles is filled in. The associated query is SELECT * FROM A JOIN B ON A.Key = B.Key. For LEFT JOIN, circle A, including its intersection with circle B, is filled in. The associated query is SELECT * FROM A LEFT JOIN B ON A.Key = B.Key.'
}

::::::::::::::::::::::::::::::::::::::: challenge

Expand Down
Binary file added fig/sql-joins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ Data Carpentry's teaching is hands-on, so participants are encouraged to use
their own computers to insure the proper setup of tools for an efficient
workflow. <br>**These lessons assume no prior knowledge of the skills or tools.**

To get started, follow the directions in the "[Setup](learners/setup.md)" tab to
download data to your computer and follow any installation instructions.

#### Prerequisites

This lesson requires:

- Working copy of **DB Browser for SQLite for SQL**
- A dataset

Follow the directions in the **Setup** tab to download both the DB Browser for SQLite and the data to your computer and follow any installation instructions.
Follow the directions in the **[Setup](learners/setup.md)** section to download both the DB Browser for SQLite and the data to your computer and follow any installation instructions.

Please make sure to install everything *before* working through this lesson.

Expand Down
8 changes: 4 additions & 4 deletions md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-10-12"
"NEWS.md" "84aa522251c8b0043f12e83af45cc3d8" "site/built/NEWS.md" "2023-10-12"
"config.yaml" "0928fbefeca4f51e54ccc3687a9565e9" "site/built/config.yaml" "2023-10-12"
"index.md" "a6ad4a1e5ecbac4adca8986126fe5770" "site/built/index.md" "2023-10-12"
"index.md" "cfdee7444b27a96171c25e1d4915e1e9" "site/built/index.md" "2023-10-12"
"episodes/00-sql-introduction.md" "702a6c1b841bc4729bb2d8e0b358532e" "site/built/00-sql-introduction.md" "2023-10-12"
"episodes/01-sql-basic-queries.md" "31fc6d3e21d679cab6a002bffe7c182d" "site/built/01-sql-basic-queries.md" "2023-10-12"
"episodes/02-sql-aggregation.md" "07784e3014a42660059c18e6ba71f26d" "site/built/02-sql-aggregation.md" "2023-10-12"
"episodes/03-sql-joins.md" "9cf92d24583f0ea2395044e6b9092155" "site/built/03-sql-joins.md" "2023-10-12"
"episodes/03-sql-joins.md" "4c87f9451d13eaa88c1b38fe29c7a7f3" "site/built/03-sql-joins.md" "2023-10-12"
"instructors/instructor-notes.md" "105728ef72c768e968ca9d11c2a14109" "site/built/instructor-notes.md" "2023-10-12"
"learners/discuss.md" "c5994f9f17e9da0d08a530600084ba55" "site/built/discuss.md" "2023-10-12"
"learners/reference.md" "bd2a5ec583a60be99fcee0afcf73dac1" "site/built/reference.md" "2023-10-12"
"learners/setup.md" "1251f53cb7d4ffbef97833af269b7e35" "site/built/setup.md" "2023-10-12"
"learners/reference.md" "a9e2e8b2be027afbeb360f1bbd966da2" "site/built/reference.md" "2023-10-12"
"learners/setup.md" "ba0ada65a673ca1d95ed722b0711fa87" "site/built/setup.md" "2023-10-12"
"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2023-10-12"
104 changes: 97 additions & 7 deletions reference.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,105 @@
---
title: 'FIXME'
title: Reference
---

## Glossary

## Reference
*The definitions below are modified from the [Carpentries
Glosario](https://glosario.carpentries.org/) (CC-BY-4.0)*

[[**aggreation**]{#aggreation}](https://glosario.carpentries.org/en/#aggreation)
: To combine many values into one, e.g., by summing a set of numbers.

[[**field**]{#field}](https://glosario.carpentries.org/en/#field)
: A component of a [record](#record) containing a single value. Every
record in a database [table](#table) has the same fields.

[[**filter**]{#filter}](https://glosario.carpentries.org/en/#filter)
: To choose a set of [records](#record) (i.e., rows of a table) based
on the values they contain.

[[**full join**]{#full-join}](https://glosario.carpentries.org/en/#full_join)
: A [join](#join) that returns all rows and all columns from two
tables A and B. Where the [keys](#key) of A and B match, values are
combined; where they do not, missing values from either table are
filled with [null](#null), NA, or some other [missing
value](#missing-value) signifier.

[[**group**]{#group}](https://glosario.carpentries.org/en/#group)
: To divide data into subsets according to a set of criteria while
leaving records in a single structure.

[[**inner join**]{#inner-join}](https://glosario.carpentries.org/en/#inner_join)
: A [join](#join) that returns the combination of rows from two
tables, A and B, whose [keys](#key) exist in both tables.

[[**join**]{#join}](https://glosario.carpentries.org/en/#join)
: One of several operations that combine values from two
[tables](#table).

[[**key**]{#key}](https://glosario.carpentries.org/en/#key)
: A [field](#field) or combination of fields whose value(s)
uniquely identify a [record](#record) within a [table](#table) or
dataset. Keys are often used to select specific records and in
[joins](#join).

[[**left join**]{#left-join}](https://glosario.carpentries.org/en/#left_join)
: A [join](#join) that combines data from two tables, A and B, where
[keys](#key) in table A match keys in table B, [fields](#field) are
concatenated. Where a key in table A does *not* match a key in
table B, columns from table B are filled with [null](#null), NA, or
some other [missing value](#missing-value). Keys from table B that
do not match keys from table A are excluded for the result.

[[**missing value**]{#missing-value}](https://glosario.carpentries.org/en/#missing_value)
: A special value such as [null](#null) or NA used to indicate the
absence of data. Missing values can signal that data was not
collected or that the data did not exist in the first place (e.g.,
the middle name of someone who does not have one).

[[**null**]{#null}](https://glosario.carpentries.org/en/#null)
: A special value used to represent a missing object.

[[**record**]{#record}](https://glosario.carpentries.org/en/#record)
: A group of related values that are stored together. A record may be
represented as a tuple or as a row in a [table](#table); in the
latter case, every record in the table has the same
[fields](#field).

[[**relational_database**]{#relational-database}](https://glosario.carpentries.org/en/#relational_database)
: A database that organizes information into [tables](#table), each of
which has a fixed set of named [fields](#field) (shown as columns)
and a variable number of [records](#record) (shown as rows).

[[**right join**]{#right-join}](https://glosario.carpentries.org/en/#right_join)
: A [join](#join) that combines data from two tables, A and B. Where
[keys](#key) in table A match keys in table B, [fields](#field) are
concatenated. Where a key in table B does \*not\* match a key in
table A, columns from table A are filled with [null](#null), NA, or
some other [missing value](#missing-value) signifier. Keys from
table A that do not exist in table B are dropped.

[[**select**]{#select}](https://glosario.carpentries.org/en/#select)
: To choose entire columns or rows from a table by name or location.

[[**SQL**]{#SQL}](https://glosario.carpentries.org/en/#sql)
: The language used for writing queries for a [relational
database](#relational-database). The term is an acronym for
Structured Query Language.

[[**table**]{#table}](https://glosario.carpentries.org/en/#table)
: A set of [records](#record) in a [relational
database](#relational-database) or observations in a data frame.
Tables are usually displayed as rows (each of which represents one
record or observation) and columns (each of which represents a
[field](#field) or variable.)

## Commands

See [this cheat sheet](files/sql-cheat-sheet.md) for an list of the commands
covered in this lesson.

### Keywords Description Summary
### Keywords

<table>
<thead>
Expand All @@ -24,12 +114,12 @@ covered in this lesson.
<tr>
<td rowspan=3> SELECT </td>
<td rowspan = 3> Select data from database or table </td>
<td> SELECT *</td>
<td> Selects the entire dataset</td>
<td>SELECT *</td>
<td>Selects the entire dataset</td>
</tr>
<tr>
<td>SELECT column1</td>
<td> Selects a particular column</td>
<td>Selects a particular column</td>
</tr>
<tr>
<td>SELECT 1 + 2</td>
Expand Down Expand Up @@ -79,7 +169,7 @@ covered in this lesson.
</tr>
<tr>
<td>JOIN</td>
<td> Joins tables</td>
<td>Joins tables</td>
<td>SELECT * <br> FROM surveys <br> JOIN species <br> ON surveys.species_id = species.species_id</td>
<td>Query will display all the columns from both tables where the condition is met</td>
</tr>
Expand Down
12 changes: 7 additions & 5 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
title: Setup
---

## Setup

:::::::::::::::::::::::::::::::::::::::::: prereq

## Data
### Data

This lesson uses specific data files from the [Portal Project Teaching Database](https://figshare.com/articles/Portal_Project_Teaching_Database/1314459). To
get the data, go to the [data location on figshare](https://figshare.com/articles/Portal_Project_Teaching_Database/1314459) and click on the **Download all** button to download the zip file.
Expand All @@ -21,7 +23,7 @@ See the

:::::::::::::::::::::::::::::::::::::::::: prereq

## Software
### Software

Download **DB Browser for SQLite** for your operating system
from [https://sqlitebrowser.org/dl/](https://sqlitebrowser.org/dl/).
Expand All @@ -38,11 +40,11 @@ Launch **DB Browser for SQLite** to confirm that the installation was successful

:::::::::::::::::::::::::::::::::::::::::: prereq

## Am I ready?
### Am I ready?

The [first lesson episode](episodes/00-sql-introduction.md) has instructions
on loading the data in DB Browser. If you can follow the instructions under "Relational
Databases" or "Import", everything should have downloaded and installed correctly.
on loading the data in DB Browser. To test your setup, you can follow the instructions for importing your data into DB Browser under the sections [Relational
Databases](../episodes/00-sql-introduction.md#relational-databases) or [Import](../episodes/00-sql-introduction.md#import).

::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down

0 comments on commit 03bc66d

Please sign in to comment.