banner

Discovery Project 7-2: Random Proverbs

The original proverbs.txt file

He who springs on innerspring this spring have offspring next spring.
A bird does not sing because it has an answer. It sings because it has a song.
A book is like a garden carried in the pocket.
A child's life is like a piece of paper on which every person leaves a mark.
A gem is not polished without rubbing, nor a man perfected without trials.
Deep doubts, deep wisdom; small doubts, little wisdom.
Do not remove a fly from your friend's forehead with a hatchet.
He who asks is a fool for five minutes, but he who does not ask remains a fool forever.
Raise your sail one foot and you get ten feet of wind.
The palest ink is better than the best memory.
Man who tell one too many light bulb jokes soon burn out.
Two wrongs not make right, but two rights make U-turn.
Man who push piano down mine shaft, likely to get A flat minor.
The swiftest horse can't overtake a word once spoken.
To succeed, consult three old people.

The new proverb_load.txt file

1	He who springs on innerspring this spring have offspring next spring.	0
2	A bird does not sing because it has an answer. It sings because it has a song.	0
3	A book is like a garden carried in the pocket.	0
4	A child's life is like a piece of paper on which every person leaves a mark.	0
5	A gem is not polished without rubbing, nor a man perfected without trials.	0
6	Deep doubts, deep wisdom; small doubts, little wisdom.	0
7	Do not remove a fly from your friend's forehead with a hatchet.	0
8	He who asks is a fool for five minutes, but he who does not ask remains a fool forever.	0
9	Raise your sail one foot and you get ten feet of wind.	0
10	The palest ink is better than the best memory.	0
11	Man who tell one too many light bulb jokes soon burn out.	0
12	Two wrongs not make right, but two rights make U-turn.	0
13	Man who push piano down mine shaft, likely to get A flat minor.	0
14	The swiftest horse can't overtake a word once spoken.	0
15	To succeed, consult three old people.	0

The mySQL monitor output

ca86_49@php:~$ mysql -u ca86_49 -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3922
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema | 
| ca86_49            | 
+--------------------+
2 rows in set (0.00 sec)

mysql> use ca86_49;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> use ca86_49;
Database changed
mysql> select database();
+------------+
| database() |
+------------+
| ca86_49    | 
+------------+
1 row in set (0.00 sec)

mysql> describe ca86_49
    -> ;
ERROR 1146 (42S02): Table 'ca86_49.ca86_49' doesn't exist
mysql> describe;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql> show tables;
+-------------------+
| Tables_in_ca86_49 |
+-------------------+
| teamstats         | 
| zodiacsigns       | 
+-------------------+
2 rows in set (0.00 sec)

mysql> CREATE TABLE randomproverb (proverb_number INT,
    -> proverb VARCHAR(200), display_count INT);
Query OK, 0 rows affected (0.03 sec)

mysql> describe randomproverb;
+----------------+--------------+------+-----+---------+-------+
| Field          | Type         | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| proverb_number | int(11)      | YES  |     | NULL    |       | 
| proverb        | varchar(200) | YES  |     | NULL    |       | 
| display_count  | int(11)      | YES  |     | NULL    |       | 
+----------------+--------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> load data local infile 'public_html/ChineseZodiac/proverb_load.txt' into table randomproverb;
Query OK, 15 rows affected (0.00 sec)
Records: 15  Deleted: 0  Skipped: 0  Warnings: 0

mysql> select * from randomproverb;
+----------------+-----------------------------------------------------------------------------------------+---------------+
| proverb_number | proverb                                                                                 | display_count |
+----------------+-----------------------------------------------------------------------------------------+---------------+
|              1 | He who springs on innerspring this spring have offspring next spring.                   |             0 | 
|              2 | A bird does not sing because it has an answer. It sings because it has a song.          |             0 | 
|              3 | A book is like a garden carried in the pocket.                                          |             0 | 
|              4 | A child's life is like a piece of paper on which every person leaves a mark.            |             0 | 
|              5 | A gem is not polished without rubbing, nor a man perfected without trials.              |             0 | 
|              6 | Deep doubts, deep wisdom; small doubts, little wisdom.                                  |             0 | 
|              7 | Do not remove a fly from your friend's forehead with a hatchet.                         |             0 | 
|              8 | He who asks is a fool for five minutes, but he who does not ask remains a fool forever. |             0 | 
|              9 | Raise your sail one foot and you get ten feet of wind.                                  |             0 | 
|             10 | The palest ink is better than the best memory.                                          |             0 | 
|             11 | Man who tell one too many light bulb jokes soon burn out.                               |             0 | 
|             12 | Two wrongs not make right, but two rights make U-turn.                                  |             0 | 
|             13 | Man who push piano down mine shaft, likely to get A flat minor.                         |             0 | 
|             14 | The swiftest horse can't overtake a word once spoken.                                   |             0 | 
|             15 | To succeed, consult three old people.                                                   |             0 | 
+----------------+-----------------------------------------------------------------------------------------+---------------+
15 rows in set (0.01 sec)

mysql>