Name:_______________________ Edit this, PASTE and BOLD the output of each command after it. Print in a small font, narrow margins, double-sided, turn in. Use the mysql client to logon to your MySQL server. Use the SHOW statement to find out what databases currently exist on the server: (or at least the ones you have access to) SHOW DATABASES; CREATE DATABASE menagerie; Creating a database does not select it for use; you must do that explicitly. To make menagerie the current database, use this command: USE menagerie; SHOW TABLES; #of selected/current database. paste the message Use a CREATE TABLE statement to specify the layout of your table: CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20), species VARCHAR(20), sex CHAR(1), birth DATE, death DATE); (varchar is a variable-length string, char is fixed-length string) Now SHOW TABLES; will list your pet table. To verify that your table was created the way you expected, use a DESCRIBE statement: DESC pet; Download the pet.txt from the class web site in the DBs folder. Save it directly as is (i.e do NOT copy and paste it). It's in Unix text file format (one character, the newline, to indicate end of line, so it won't display well in Notepad.) It's also in MySQL's default format of Tab as field separator and Newline as record separator. To load the text file pet.txt into the pet table, use this command: LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet; (path is relative to folder you started mysql from. Simplest if it's in the same folder, so not path is needed, just the filename. (Note that Nulls are represented by \N in a file). Paste the message upon success. Check that all records succesfully loaded into table. SELECT * FROM pet; Add a new record using an INSERT statement like this: paste the message INSERT INTO pet VALUES ('Puffball','Diane','hamster','f','1999-03-30',NULL); check that it's there. SELECT * FROM pet WHERE name='Puffball'; Modify a record using an UPDATE statement: paste the message UPDATE pet SET birth='1989-08-31' WHERE name='Bowser'; check that it happened. SELECT * FROM pet WHERE name='Bowser'; Delete a record using a DELETE statement: paste the message DELETE FROM pet WHERE name='Puffball'; check that it's not there. SELECT * FROM pet WHERE name='Puffball'; DELETE FROM pet; paste the message SELECT * FROM pet; What happened? Delete without a Where clause is usually to be avoided. No problem here and now, load it again with LOAD DATA. Run the Create Table command again. Paste the message. DROP TABLE pet; the command to delete a table. Paste the message. SHOW TABLES; Paste the message. Run the Create Table command again. Paste the message. SHOW TABLES; Run the LOAD DATA command again to populate the pet table.