Tuesday, October 20, 2009

Section A.8. Chapter 8










A.8. Chapter 8




Solution to Question 8-1


The mysql command provides an interactive interface to MySQL.




Solution to Question 8-2


To back up a database called "blog" from the command line, execute:



mysqldump -u root -p blog > my_backup.sql



A password prompt appears before the backup begins.





Solution to Question 8-3


To restore the "blog" backup file from the command line, execute:



mysql -u root -p -D test < my_backup.sql



A password prompt appears before the restore begins.





Solution to Question 8-4


The advantages for creating an index are:


  • Queries with where clauses that match the index columns are much faster.

  • Verifying the uniqueness of an index value is much faster.


Some disadvantages are:


  • Queries that insert or remove rows from an indexed table take longer for the index to update.

  • Additional storage space is required to store the index.














No comments: