Module 3: Manipulating a Database


What does the following command do?

 ALTER TABLE horse_gear MODIFY num_code MEDIUMINT(9) PRIMARY KEY NOT NULL AUTO_INCREMENT, MODIFY feed CHAR(15) NOT NULL, CHANGE saddles_bridles tack CHAR(20) NOT NULL, ADD blanket ENUM( 


MySQL(c) Essential Skills
MySQL: Essential Skills
ISBN: 0072255137
EAN: 2147483647
Year: 2006
Pages: 109

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net

1.  

How do you make a copy of the table wolfhounds , including its data?

2.  

If you have a table called sport and it has the fields football , basketball , soccer , and hockey , how do you make a table called ballgames without the hockey field?

3.  

What kind of table resides in memory and lasts only as long as the MySQL Client s current connection?

4.  

What does the following command accomplish?

 LOAD DATA INFILE '\documents\games_stats.txt' INTO TABLE stat_sheet FIELDS TERMINATED BY ':' LINES TERMINATED BY '\r\n'; 

5.  

What are the four options for the ALTER TABLE command and what to they do?

6.  

What command inserts only entire records into a table?

7.  

What does a table need to have in order to use the REPLACE INTO command and avoid inserting duplicate records?

8.  

What do you type on the command line to temporarily turn off the safe-updates option?

9.  

Which command allows you to insert data into specific fields within records?

10.  

What does the following command do?

 UPDATE wine_list SET color="red" WHERE variety="Merlot"; 

11.  

Which command(s) removes a table and which command(s) removes only the data in the table?

12.  

How is TRUNCATE different from DELETE ?

13.