Commit 75d1c91f authored by unknown's avatar unknown

Missing comma in SQL command example (from Jason Livesay).

Examples reformatted in same section.

parent 5f1d5c2d
...@@ -13662,10 +13662,13 @@ The @code{AUTO_INCREMENT} attribute can be used to generate an unique ...@@ -13662,10 +13662,13 @@ The @code{AUTO_INCREMENT} attribute can be used to generate an unique
identity for new rows: identity for new rows:
@example @example
CREATE TABLE animals (id MEDIUMINT NOT NULL AUTO_INCREMENT, CREATE TABLE animals (
name CHAR(30) NOT NULL, PRIMARY KEY (id)); id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO animals (name) VALUES ("dog"),("cat"),("penguin"), INSERT INTO animals (name) VALUES ("dog"),("cat"),("penguin"),
("lax"),("whale"); ("lax"),("whale");
SELECT * FROM animals; SELECT * FROM animals;
Which returns: Which returns:
...@@ -13688,9 +13691,11 @@ value for the autoincrement column is calculated as ...@@ -13688,9 +13691,11 @@ value for the autoincrement column is calculated as
useful when you want to put data into ordered groups. useful when you want to put data into ordered groups.
@example @example
CREATE TABLE animals (grp ENUM('fish','mammal','bird') NOT NULL, CREATE TABLE animals (
id MEDIUMINT NOT NULL AUTO_INCREMENT grp ENUM('fish','mammal','bird') NOT NULL,
PRIMARY KEY (grp,id)); id MEDIUMINT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (grp,id)
);
INSERT INTO animals (grp,name) VALUES("mammal","dog"),("mammal","cat"), INSERT INTO animals (grp,name) VALUES("mammal","dog"),("mammal","cat"),
("bird","penguin"),("fish","lax"),("mammal","whale"); ("bird","penguin"),("fish","lax"),("mammal","whale");
SELECT * FROM animals ORDER BY grp,id; SELECT * FROM animals ORDER BY grp,id;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment