You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: episodes/05-aggregating-calculating.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,11 +111,11 @@ FROM articles
111
111
ORDER BY Author_Count -1DESC;
112
112
```
113
113
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.
115
115
116
116
We can use any arithmetic operators (like `+`, `-`, `*`, `/`, square root `SQRT` or the modulo operator `%`) if we would like.
117
117
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).
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.
53
53
54
54
When joining tables, you can specify the columns you want by using `table.colname` instead of selecting all the columns using `*`. For example:
Copy file name to clipboardExpand all lines: episodes/08-database-design.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ exercises: 20
18
18
19
19
## Spreadsheets
20
20
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.
22
22
23
23
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).
24
24
@@ -39,8 +39,6 @@ In the figure below, can you identify where inconsistencies in the data have bee
39
39
3. Date format is MM/DD/YYYY and not the commonly used ISO 8601 format;
40
40
4. The "Subjects" column delimits data by pipes and the data is in a variety of formats such as abbreviations, classifications, and sometimes capitalised.
41
41
**Can you spot anything else?**
42
-
43
-
44
42
45
43
:::::::::::::::::::::::::
46
44
@@ -54,9 +52,9 @@ Database design involves a model or plan developed to determine how the data is
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).
60
58
61
59
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.
62
60
@@ -116,8 +114,6 @@ For this exercise, you can either use pencil/pen and paper to draw new tables an
116
114
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.
117
115
2. A 'subjects' table can be created with a many-to-many relationship with the 'articles' table and a bridge table between them.
Copy file name to clipboardExpand all lines: episodes/09-create.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Be very careful when doing this:
46
46
if you drop the wrong table, hope that the person maintaining the database has a backup,
47
47
but it's better not to have to rely on it.
48
48
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).
50
50
51
51
When we create a table,
52
52
we can specify several kinds of constraints on its columns.
@@ -170,19 +170,13 @@ stored in any particular order.)
170
170
#### Disadvantages
171
171
172
172
- Artificial differences between commits because records don't have a fixed order
0 commit comments