Addressbook MySQL Altering

AddressBook Alter Table Commands


CHANGING THE CHARACTRISTCS OF A COLUMN
The profile column will not accept enough charatcers as a “text” type. I want to change it to varchar(255) which will accept more.
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| fname | varchar(10)| YES | | NULL | |
| lname | varchar(27)| YES | | NULL | |
| phone | varchar(17)| YES | | NULL | |
| age | int(3) | YES | | NULL | |
| gender | char(1) | YES | | NULL | |
| email | varchar(36)| YES | | NULL | |
| profile | text | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
mysql> alter table addressbook modify profile varchar(255);
Query OK, 11 rows affected (0.01 sec)
Records: 11 Duplicates: 0 Warnings: 0
+---------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| fname | varchar(10) | YES | | NULL | |
| lname | varchar(27) | YES | | NULL | |
| phone | varchar(17) | YES | | NULL | |
| age | int(3) | YES | | NULL | |
| gender | char(1) | YES | | NULL | |
| email | varchar(36) | YES | | NULL | |
| profile | varchar(255)| YES | | NULL | |
+---------+--------------+------+-----+---------+-------+


DELETING A ROW FROM A TABLE
The following example demonstrates the deletion of a row of information I no loonger need. Notice that first row lists the criterion for each column. I want to delete the row that starts with “fname”.

mysql> select * from addressbook;
+------------+----------+----------+------+--------+--------------------------+---------------------+
| fname | lname | phone | age | gender | email | profile |
+------------+----------+----------+------+--------+--------------------------+---------------------+
| fname | lname | phone | 0 | g | email | profile |
| Scott | Le Duc | 753-8880 | 32 | M | sleduc@osd.wednet.edu | Le Duc is a teacher |
| Kevin | Wright | 753-8880 | 33 | M | kwright@osd.wednet.edu | Wright is a teacher |
| Marc | Turnbow | 789-4989 | 40 | M | mturnbow@osd.wednet.edu | Tunbow is a teacher |
| Luke | Bowerman | 888-5625 | 20 | M | luke@newmediaarts.org | Bowerman is cool |
| Ron | Morsette | 586-1465 | 46 | M | rmorsette@osd.wednet.edu | Morsette is cool |
+------------+----------+----------+------+--------+--------------------------+---------------------+

STEP 1: THE COMMAND
mysql> delete from addressbook where fname = "fname";
Query OK, 1 row affected (0.00 sec)

STEP 2: THE RESULTS, THE ROW IS GONE!
mysql> select * from addressbook;
+------------+----------+----------+------+--------+--------------------------+---------------------+
| fname | lname | phone | age | gender | email | profile |
+------------+----------+----------+------+--------+--------------------------+---------------------+
| Scott | Le Duc | 753-8880 | 32 | M | sleduc@osd.wednet.edu | Le Duc is a teacher |
| Kevin | Wright | 753-8880 | 33 | M | kwright@osd.wednet.edu | Wright is a teacher |
| Marc | Turnbow | 789-4989 | 40 | M | mturnbow@osd.wednet.edu | Tunbow is a teacher |
| Luke | Bowerman | 888-5625 | 20 | M | luke@newmediaarts.org | Bowerman is cool |
| Ron | Morsette | 586-1465 | 46 | M | rmorsette@osd.wednet.edu | Morsette is cool |
+------------+----------+----------+------+--------+--------------------------+---------------------+