Introduction
Creating the remote database
Creating the local database
OK, so now what?
Deciding on fields
Deciding on an index
Creating the table
Insert some data
Querying the database
Scripted querying
Uploading onto the server

Query the database

The table can now be queried in any way you want to, using any of the querying methods that are available in MySQL (described in the MySQL manual), for example if we wanted to query the table to show the prices of the books in order from highest to lowest we could use;

        mysql> select * from books order by price desc;
        +-----------------------------------------------+------------+-------+---------------------+
        | bookname                                      | isbn       | price | datepurchased       |
        +-----------------------------------------------+------------+-------+---------------------+
        | Photoshop Web Magic Volume 1                  | 1568303149 | 41.50 | 2000-07-01 09:21:00 |
        | Sams - Teach yourself MySQL in 21 days        | 0672319144 | 28.99 | 2000-06-05 13:05:00 |
        | The Chess-Players Handbook                    | 0713450568 |  9.99 | 1996-03-23 15:54:00 |
        | lonely-planet - New York City                 | 0864425023 |  9.99 | 1999-02-05 17:35:00 |
        | The Holiday Which? Guide To The Lake District | 0340488786 |  7.95 | 1994-12-15 10:43:00 |
        +-----------------------------------------------+------------+-------+---------------------+
        5 rows in set (0.00 sec)

So to find the most expensive book we might use the following syntax;

        mysql> select * from books order by price desc limit 1;
        +------------------------------+------------+-------+---------------------+
        | bookname                     | isbn       | price | datepurchased       |
        +------------------------------+------------+-------+---------------------+
        | Photoshop Web Magic Volume 1 | 1568303149 | 41.50 | 2000-07-01 09:21:00 |
        +------------------------------+------------+-------+---------------------+
        1 row in set (0.00 sec)

All of these functions and how to use them are documented in the MySQL manual and I recommend having a glance through them at least and experiment with some of them on your table to try and become more aware of how to use them all.

Another example would be if we knew part or all of the ISBN number and wanter to find our book, say we knew that the ISBN number began with `0864', we could look through the entire database and find the one that we are looking for or we can let the database do it for us, like so;

        mysql> select * from books where isbn like '0864%';
        +-------------------------------+------------+-------+---------------------+
        | bookname                      | isbn       | price | datepurchased       |
        +-------------------------------+------------+-------+---------------------+
        | lonely-planet - New York City | 0864425023 |  9.99 | 1999-02-05 17:35:00 |
        +-------------------------------+------------+-------+---------------------+
        1 row in set (0.00 sec)

See? The 'like` function is discussed in depth within the MySQL manual because it uses regular expressions to do its searching which is a huge section of database querying and is definitely worth a look.