Skip to content

Commit

Permalink
Merge pull request swcarpentry#318 from danmichaelo/ep9-fix
Browse files Browse the repository at this point in the history
Ep9: Fix INSERT datatypes + slight rephrasing
  • Loading branch information
henrykironde authored Mar 10, 2020
2 parents e75bbd0 + f0b9de6 commit 9fcec77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _episodes/09-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Once tables have been created,
we can add, change, and remove records using our other set of commands,
`INSERT`, `UPDATE`, and `DELETE`.

The simplest form of `INSERT` statement lists values in order:
Here is an example of inserting rows into the `Site` table:

~~~
INSERT INTO Site (name, lat, long) VALUES ('DR-1', -49.85, -128.57);
Expand All @@ -107,7 +107,7 @@ INSERT INTO Site (name, lat, long) VALUES ('MSK-4', -48.87, -123.40);
We can also insert values into one table directly from another:

~~~
CREATE TABLE JustLatLong(lat text, long text);
CREATE TABLE JustLatLong(lat real, long real);
INSERT INTO JustLatLong SELECT lat, long FROM Site;
~~~
{: .sql}
Expand All @@ -118,7 +118,7 @@ what we want to change the values to for any or all of the fields,
and under what conditions we should update the values.

For example, if we made a mistake when entering the lat and long values
of the last `INSERT` statement above:
of the last `INSERT` statement above, we can correct it with an update:

~~~
UPDATE Site SET lat = -47.87, long = -122.40 WHERE name = 'MSK-4';
Expand Down

0 comments on commit 9fcec77

Please sign in to comment.