Skip to content

Commit

Permalink
data/visited.csv: Fix '1939' -> '1930' typo
Browse files Browse the repository at this point in the history
With:

  $ sed -i 's/1939/1930/g' *.md code/gen-survey-database.sql \
  >   data/visited.csv fig/*.svg

In index.md, we have:

  In the late 1920s and early 1930s, ...

So 1939 is probably a fat-finger error dating back to 61ae6ff (First
three lessons on SQL for beginners, 2013-11-09).  It's possible that
the error was intentional, to setup an excuse to talk about dirty
data, or OCR errors, or something like that.  We already talk about
potentially dirty data with units and the anomalous salinity
measurements in 08-hygiene.md though, so I don't think the 1939 date
is worth the trouble.
  • Loading branch information
wking committed Apr 4, 2015
1 parent a8aa095 commit a7b8022
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion 01-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The tables below show the database we will use in our examples:
> |-----|-----|----------|
> |619 |DR-1 |1927-02-08|
> |622 |DR-1 |1927-02-10|
> |734 |DR-3 |1939-01-07|
> |734 |DR-3 |1930-01-07|
> |735 |DR-3 |1930-01-12|
> |751 |DR-3 |1930-02-26|
> |752 |DR-3 |-null- |
Expand Down
2 changes: 1 addition & 1 deletion 03-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ SELECT * FROM Visited WHERE site LIKE 'DR%';
|-----|-----|----------|
|619 |DR-1 |1927-02-08|
|622 |DR-1 |1927-02-10|
|734 |DR-3 |1939-01-07|
|734 |DR-3 |1930-01-07|
|735 |DR-3 |1930-01-12|
|751 |DR-3 |1930-02-26|
|752 |DR-3 | |
Expand Down
6 changes: 3 additions & 3 deletions 05-null.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SELECT * FROM Visited;
|-----|----|----------|
|619 |DR-1|1927-02-08|
|622 |DR-1|1927-02-10|
|734 |DR-3|1939-01-07|
|734 |DR-3|1930-01-07|
|735 |DR-3|1930-01-12|
|751 |DR-3|1930-02-26|
|752 |DR-3|-null- |
Expand Down Expand Up @@ -59,7 +59,7 @@ SELECT * FROM Visited WHERE dated>='1930-01-01';

|ident|site|dated |
|-----|----|----------|
|734 |DR-3|1939-01-07|
|734 |DR-3|1930-01-07|
|735 |DR-3|1930-01-12|
|751 |DR-3|1930-02-26|
|837 |MSK-|1932-01-14|
Expand Down Expand Up @@ -121,7 +121,7 @@ SELECT * FROM Visited WHERE dated IS NOT NULL;
|-----|----|----------|
|619 |DR-1|1927-02-08|
|622 |DR-1|1927-02-10|
|734 |DR-3|1939-01-07|
|734 |DR-3|1930-01-07|
|735 |DR-3|1930-01-12|
|751 |DR-3|1930-02-26|
|837 |MSK-|1932-01-14|
Expand Down
4 changes: 2 additions & 2 deletions 06-agg.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SELECT dated FROM Visited;
|----------|
|1927-02-08|
|1927-02-10|
|1939-01-07|
|1930-01-07|
|1930-01-12|
|1930-02-26|
|-null- |
Expand Down Expand Up @@ -51,7 +51,7 @@ SELECT max(dated) FROM Visited;

|max(dated)|
|----------|
|1939-01-07|
|1930-01-07|

`min` and `max` are just two of
the aggregation functions built into SQL.
Expand Down
16 changes: 8 additions & 8 deletions 07-join.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ SELECT * FROM Site JOIN Visited;
|-----|------|-------|-----|------|----------|
|DR-1 |-49.85|-128.57|619 |DR-1 |1927-02-08|
|DR-1 |-49.85|-128.57|622 |DR-1 |1927-02-10|
|DR-1 |-49.85|-128.57|734 |DR-3 |1939-01-07|
|DR-1 |-49.85|-128.57|734 |DR-3 |1930-01-07|
|DR-1 |-49.85|-128.57|735 |DR-3 |1930-01-12|
|DR-1 |-49.85|-128.57|751 |DR-3 |1930-02-26|
|DR-1 |-49.85|-128.57|752 |DR-3 |-null- |
|DR-1 |-49.85|-128.57|837 |MSK-4 |1932-01-14|
|DR-1 |-49.85|-128.57|844 |DR-1 |1932-03-22|
|DR-3 |-47.15|-126.72|619 |DR-1 |1927-02-08|
|DR-3 |-47.15|-126.72|622 |DR-1 |1927-02-10|
|DR-3 |-47.15|-126.72|734 |DR-3 |1939-01-07|
|DR-3 |-47.15|-126.72|734 |DR-3 |1930-01-07|
|DR-3 |-47.15|-126.72|735 |DR-3 |1930-01-12|
|DR-3 |-47.15|-126.72|751 |DR-3 |1930-02-26|
|DR-3 |-47.15|-126.72|752 |DR-3 |-null- |
|DR-3 |-47.15|-126.72|837 |MSK-4 |1932-01-14|
|DR-3 |-47.15|-126.72|844 |DR-1 |1932-03-22|
|MSK-4|-48.87|-123.4 |619 |DR-1 |1927-02-08|
|MSK-4|-48.87|-123.4 |622 |DR-1 |1927-02-10|
|MSK-4|-48.87|-123.4 |734 |DR-3 |1939-01-07|
|MSK-4|-48.87|-123.4 |734 |DR-3 |1930-01-07|
|MSK-4|-48.87|-123.4 |735 |DR-3 |1930-01-12|
|MSK-4|-48.87|-123.4 |751 |DR-3 |1930-02-26|
|MSK-4|-48.87|-123.4 |752 |DR-3 |-null- |
Expand Down Expand Up @@ -86,7 +86,7 @@ SELECT * FROM Site JOIN Visited ON Site.name=Visited.site;
|DR-1 |-49.85|-128.57|619 |DR-1 |1927-02-08|
|DR-1 |-49.85|-128.57|622 |DR-1 |1927-02-10|
|DR-1 |-49.85|-128.57|844 |DR-1 |1932-03-22|
|DR-3 |-47.15|-126.72|734 |DR-3 |1939-01-07|
|DR-3 |-47.15|-126.72|734 |DR-3 |1930-01-07|
|DR-3 |-47.15|-126.72|735 |DR-3 |1930-01-12|
|DR-3 |-47.15|-126.72|751 |DR-3 |1930-02-26|
|DR-3 |-47.15|-126.72|752 |DR-3 |-null- |
Expand Down Expand Up @@ -130,7 +130,7 @@ ON Site.name=Visited.site;
|-47.15|-126.72|-null- |
|-47.15|-126.72|1930-01-12|
|-47.15|-126.72|1930-02-26|
|-47.15|-126.72|1939-01-07|
|-47.15|-126.72|1930-01-07|
|-48.87|-123.4 |1932-01-14|

If joining two tables is good,
Expand All @@ -155,9 +155,9 @@ AND Visited.dated IS NOT NULL;
|-49.85|-128.57|1927-02-08|sal |0.13 |
|-49.85|-128.57|1927-02-10|rad |7.8 |
|-49.85|-128.57|1927-02-10|sal |0.09 |
|-47.15|-126.72|1939-01-07|rad |8.41 |
|-47.15|-126.72|1939-01-07|sal |0.05 |
|-47.15|-126.72|1939-01-07|temp |-21.5 |
|-47.15|-126.72|1930-01-07|rad |8.41 |
|-47.15|-126.72|1930-01-07|sal |0.05 |
|-47.15|-126.72|1930-01-07|temp |-21.5 |
|-47.15|-126.72|1930-01-12|rad |7.22 |
|-47.15|-126.72|1930-01-12|sal |0.06 |
|-47.15|-126.72|1930-01-12|temp |-26.0 |
Expand Down
2 changes: 1 addition & 1 deletion 08-hygiene.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ we could get rid of the `Site` table and rewrite the `Visited` table like this:
|-----|------|-------|-----------|
|619 |-49.85|-128.57| 1927-02-08|
|622 |-49.85|-128.57| 1927-02-10|
|734 |-47.15|-126.72| 1939-01-07|
|734 |-47.15|-126.72| 1930-01-07|
|735 |-47.15|-126.72| 1930-01-12|
|751 |-47.15|-126.72| 1930-02-26|
|752 |-47.15|-126.72| -null- |
Expand Down
2 changes: 1 addition & 1 deletion code/gen-survey-database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ create table Visited(

insert into Visited values(619, 'DR-1', '1927-02-08');
insert into Visited values(622, 'DR-1', '1927-02-10');
insert into Visited values(734, 'DR-3', '1939-01-07');
insert into Visited values(734, 'DR-3', '1930-01-07');
insert into Visited values(735, 'DR-3', '1930-01-12');
insert into Visited values(751, 'DR-3', '1930-02-26');
insert into Visited values(752, 'DR-3', null);
Expand Down
2 changes: 1 addition & 1 deletion data/visited.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
619,DR-1,1927-02-08
622,DR-1,1927-02-10
734,DR-3,1939-01-07
734,DR-3,1930-01-07
735,DR-3,1930-01-12
751,DR-3,1930-02-26
752,DR-3,
Expand Down
12 changes: 6 additions & 6 deletions fig/sql-aggregation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions fig/sql-filter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a7b8022

Please sign in to comment.