diff --git a/AUTHORS b/AUTHORS index 3a3dd0a5..19871534 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,6 +23,7 @@ Hilmar Lapp Ian Carroll Jaime Ashander James Allen +James Foster Jethro Johnson Jin Jon Pipitone diff --git a/episodes/00-sql-introduction.md b/episodes/00-sql-introduction.md index d0d8c1c4..e6e0e87a 100644 --- a/episodes/00-sql-introduction.md +++ b/episodes/00-sql-introduction.md @@ -187,7 +187,8 @@ follow these instructions: 7. Press **OK**, you should subsequently get a message that the table was imported. 9. Back on the Database Structure tab, you should now see the table listed. Right click on the table name and choose **Modify Table**, or click on the **Modify Table** button just under the tabs and above the table list. 10. Click **Save** if asked to save all pending changes. -11. In the center panel of the window that appears, set the data types for each field using the suggestions in the table below (this includes fields from the `plots` and `species` tables also): +11. In the center panel of the window that appears, set the data types for each field using the suggestions in the table below (this includes fields from the `plots` and `species` tables also). +12. Finally, click **OK** one more time to confirm the operation. Then click the **Write Changes** button to save the database. | Field | Data Type | Motivation | Table(s) | |-------------------|:---------------|----------------------------------------------------------------------------------|-------------------| @@ -205,8 +206,6 @@ follow these instructions: | weight | REAL | Field contains measured numerical data | surveys | | year | INTEGER | Allows for meaningful arithmetic and comparisons | surveys | -12. Finally, click **OK** one more time to confirm the operation. Then click the **Write Changes** button to save the database. - > ## Challenge > diff --git a/episodes/01-sql-basic-queries.md b/episodes/01-sql-basic-queries.md index ce722495..6e21bbb8 100644 --- a/episodes/01-sql-basic-queries.md +++ b/episodes/01-sql-basic-queries.md @@ -46,12 +46,12 @@ Sometimes you don't want to see all the results, you just want to get a sense of SELECT * FROM surveys - LIMIT 10; + LIMIT 10; ### Unique values If we want only the unique values so that we can quickly see what species have -been sampled we use `DISTINCT` +been sampled we use `DISTINCT` SELECT DISTINCT species_id FROM surveys; @@ -112,7 +112,7 @@ Here, we only want the data since 2000: WHERE year >= 2000; If we used the `TEXT` data type for the year, the `WHERE` clause should -be `year >= '2000'`. +be `year >= '2000'`. We can use more sophisticated conditions by combining tests with `AND` and `OR`. For example, suppose we want the data on *Dipodomys merriami* @@ -135,9 +135,9 @@ species codes `DM`, `DO`, and `DS`, we could combine the tests using OR: > ## Challenge > -> - Produce a table listing the data for all individuals in Plot 1 +> - Produce a table listing the data for all individuals in Plot 1 > that weighed more than 75 grams, telling us the date, species id code, and weight -> (in kg). +> (in kg). > > > ## Solution > > ~~~ @@ -250,10 +250,13 @@ The computer is basically doing this: 3. Displaying requested columns or expressions. Clauses are written in a fixed order: `SELECT`, `FROM`, `WHERE`, then `ORDER -BY`. +BY`. +> ## Multiple statements +> > It is possible to write a query as a single line, but for readability, we recommend to put each clause on its own line. -> The standard way to separate each SQL statement is with a semicolon. This allows more than one SQL statement to be executed together. +> The standard way to separate a whole SQL statement is with a semicolon. This allows more than one SQL statement to be executed together. +{: .discussion} > ## Challenge >