mysql> use alex 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> show tables; +----------------+ | Tables_in_alex | +----------------+ | Customer | | Product | | Purchases | | t1 | | t3 | +----------------+ 5 rows in set (0.01 sec) mysql> select * from t3; +------+----+------+------+------+------+----+---+------+ | qqq | id | b | c | d | e | r | p | q | +------+----+------+------+------+------+----+---+------+ | e | 1 | 1 | 11 | NULL | e | | 0 | 15 | | e | 2 | 10 | 12 | NULL | e | | 0 | 15 | | e | 3 | 1 | 4 | NULL | e | | 0 | 15 | | e | 10 | 1 | 234 | 234 | e | hi | 1 | 1 | | e | 11 | 1 | HELL | 234 | e | hi | 1 | 1 | | e | 13 | 100 | HELL | 234 | e | hi | 1 | 1 | +------+----+------+------+------+------+----+---+------+ 6 rows in set (0.00 sec) mysql> DELETE FROM t3 where id=10; Query OK, 1 row affected (0.01 sec) mysql> select * from t3; +------+----+------+------+------+------+----+---+------+ | qqq | id | b | c | d | e | r | p | q | +------+----+------+------+------+------+----+---+------+ | e | 1 | 1 | 11 | NULL | e | | 0 | 15 | | e | 2 | 10 | 12 | NULL | e | | 0 | 15 | | e | 3 | 1 | 4 | NULL | e | | 0 | 15 | | e | 11 | 1 | HELL | 234 | e | hi | 1 | 1 | | e | 13 | 100 | HELL | 234 | e | hi | 1 | 1 | +------+----+------+------+------+------+----+---+------+ 5 rows in set (0.00 sec) mysql> DELETE FROM t3 where c = 'HELL'; Query OK, 2 rows affected (0.00 sec) mysql> select * from t3; +------+----+------+------+------+------+---+---+------+ | qqq | id | b | c | d | e | r | p | q | +------+----+------+------+------+------+---+---+------+ | e | 1 | 1 | 11 | NULL | e | | 0 | 15 | | e | 2 | 10 | 12 | NULL | e | | 0 | 15 | | e | 3 | 1 | 4 | NULL | e | | 0 | 15 | +------+----+------+------+------+------+---+---+------+ 3 rows in set (0.00 sec) mysql> DELETE FROM t3; Query OK, 3 rows affected (0.01 sec) mysql> select * from t3; Empty set (0.00 sec) mysql> use cards; ERROR 1049 (42000): Unknown database 'cards' mysql> use card; ERROR 1049 (42000): Unknown database 'card' mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | abartl02 | | adinh03 | | afraga | | aidavis | | alder | | alex | | alschmie | | aottobon | | ascattin | | asnakamu | | atran67 | | aye01 | | bbaronia | | bmotl | | bnbeck | | bokumura | | cathibod | | cdiaz32 | | cmould | | cpinson | | dekhtyar | | djgrove | | dmarndt | | dnnichol | | dsyao | | ecolsen | | edybsett | | emharris | | eramos04 | | eschen | | goscott | | hschuman | | hyates | | jacaudil | | jakahn | | jasper | | jfong19 | | jkehl | | jking14 | | jkuzmich | | jly03 | | jnunez21 | | jrickman | | kaswaffo | | kdrosenf | | kkawahar | | kpidding | | lgardn01 | | lstanche | | lubo | | mcavagna | | mccolema | | mgriff09 | | mjdoerne | | mmoore32 | | mrhalver | | mycards | | mysql | | narusso | | nayerma | | ngonella | | nick | | nifisher | | nledwith | | nrdiamon | | performance_schema | | radamovi | | rchang08 | | rfmathew | | rmmckinl | | smannan | | snayerma | | test | | tstarck | | twhite07 | | vdking | | vmuttine | | vmvilla | | vravikum | | wgottens | | zberson | | zcagle | | ztscott | +--------------------+ 84 rows in set (0.01 sec) mysql> create database poker; Query OK, 1 row affected (0.00 sec) mysql> use poker Database changed mysql> source cards.sql Query OK, 0 rows affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.00 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.01 sec) Query OK, 13 rows affected (0.01 sec) Records: 13 Duplicates: 0 Warnings: 0 mysql> select * from Deck; +--------+----------+------+---------+ | CardId | Suit | Card | NumCard | +--------+----------+------+---------+ | 1 | Clubs | 2 | 2 | | 2 | Clubs | 3 | 3 | | 3 | Clubs | 4 | 4 | | 4 | Clubs | 5 | 5 | | 5 | Clubs | 6 | 6 | | 6 | Clubs | 7 | 7 | | 7 | Clubs | 8 | 8 | | 8 | Clubs | 9 | 9 | | 9 | Clubs | 10 | 10 | | 10 | Clubs | J | 11 | | 11 | Clubs | Q | 12 | | 12 | Clubs | K | 13 | | 13 | Clubs | A | 1 | | 14 | Diamonds | 2 | 2 | | 15 | Diamonds | 3 | 3 | | 16 | Diamonds | 4 | 4 | | 17 | Diamonds | 5 | 5 | | 18 | Diamonds | 6 | 6 | | 19 | Diamonds | 7 | 7 | | 20 | Diamonds | 8 | 8 | | 21 | Diamonds | 9 | 9 | | 22 | Diamonds | 10 | 10 | | 23 | Diamonds | J | 11 | | 24 | Diamonds | Q | 12 | | 25 | Diamonds | K | 13 | | 26 | Diamonds | A | 1 | | 27 | Spades | 2 | 2 | | 28 | Spades | 3 | 3 | | 29 | Spades | 4 | 4 | | 30 | Spades | 5 | 5 | | 31 | Spades | 6 | 6 | | 32 | Spades | 7 | 7 | | 33 | Spades | 8 | 8 | | 34 | Spades | 9 | 9 | | 35 | Spades | 10 | 10 | | 36 | Spades | J | 11 | | 37 | Spades | Q | 12 | | 38 | Spades | K | 13 | | 39 | Spades | A | 1 | | 40 | Hearts | 2 | 2 | | 41 | Hearts | 3 | 3 | | 42 | Hearts | 4 | 4 | | 43 | Hearts | 5 | 5 | | 44 | Hearts | 6 | 6 | | 45 | Hearts | 7 | 7 | | 46 | Hearts | 8 | 8 | | 47 | Hearts | 9 | 9 | | 48 | Hearts | 10 | 10 | | 49 | Hearts | J | 11 | | 50 | Hearts | Q | 12 | | 51 | Hearts | K | 13 | | 52 | Hearts | A | 1 | +--------+----------+------+---------+ 52 rows in set (0.00 sec) mysql> mysql> source hands.sql Query OK, 0 rows affected (0.02 sec) Query OK, 0 rows affected (0.01 sec) Query OK, 0 rows affected (0.01 sec) Query OK, 4 rows affected (0.01 sec) Records: 4 Duplicates: 0 Warnings: 0 Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.02 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.01 sec) Query OK, 1 row affected (0.00 sec) Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 5 rows affected (0.00 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 5 rows affected (0.01 sec) Records: 5 Duplicates: 0 Warnings: 0 Query OK, 5 rows affected (0.00 sec) Records: 5 Duplicates: 0 Warnings: 0 mysql> show tables; +-----------------+ | Tables_in_poker | +-----------------+ | Deck | | Games | | Hands | | Players | +-----------------+ 4 rows in set (0.00 sec) mysql> select * from Players; +--------------+----------+------------+ | Name | NickName | CashOnHand | +--------------+----------+------------+ | Anna Holden | Anna | 6600 | | Bob Smith | Bob | 10000 | | Mary Brown | Mary | 7000 | | Peter Ivanov | Piotr | 5000 | +--------------+----------+------------+ 4 rows in set (0.01 sec) mysql> describe Players; +------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+-------------+------+-----+---------+-------+ | Name | varchar(20) | YES | | NULL | | | NickName | char(8) | NO | PRI | NULL | | | CashOnHand | float | YES | | NULL | | +------------+-------------+------+-----+---------+-------+ 3 rows in set (0.02 sec) mysql> UPDATE Players -> SET CashOnHand = CashOnHand + 1000 -> ; Query OK, 4 rows affected (0.01 sec) Rows matched: 4 Changed: 4 Warnings: 0 mysql> select * from Players; +--------------+----------+------------+ | Name | NickName | CashOnHand | +--------------+----------+------------+ | Anna Holden | Anna | 7600 | | Bob Smith | Bob | 11000 | | Mary Brown | Mary | 8000 | | Peter Ivanov | Piotr | 6000 | +--------------+----------+------------+ 4 rows in set (0.00 sec) mysql> UPDATE Players -> SET CashOnHand = CashOnHand - 5000 -> WHERE NickName = 'Bob'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> UPDATE Players SET CashOnHand = CashOnHand + 5000 WHERE NickName = 'Anna'; Query OK, 1 row affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from Players; +--------------+----------+------------+ | Name | NickName | CashOnHand | +--------------+----------+------------+ | Anna Holden | Anna | 12600 | | Bob Smith | Bob | 6000 | | Mary Brown | Mary | 8000 | | Peter Ivanov | Piotr | 6000 | +--------------+----------+------------+ 4 rows in set (0.00 sec) mysql> UPDATE CashOnHand -> ; 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> UPDATE Players -> SET CashOnHand = CashOnHand + 13 -> WHERE CashOnHand < 10000 AND NickName != 'Bob'; Query OK, 2 rows affected (0.01 sec) Rows matched: 2 Changed: 2 Warnings: 0 mysql> select * from Players; +--------------+----------+------------+ | Name | NickName | CashOnHand | +--------------+----------+------------+ | Anna Holden | Anna | 12600 | | Bob Smith | Bob | 6000 | | Mary Brown | Mary | 8013 | | Peter Ivanov | Piotr | 6013 | +--------------+----------+------------+ 4 rows in set (0.00 sec) mysql>