- Query for all puppies and return the results in ascending alphabetical order.
- Query for all puppies that are less than 6 months old organized by the youngest first.
- Query all puppies by ascending weight.
- Query all puppies grouped by the shelter in which they are staying.
puppshelters.py- Defines the database structure. Do not run this file manually.puppypopulator.py- Populates the database with puppies and attributes.puppyqueries.py- A menu-based command line tool for read-only queries to the database.
The first two were provided by the instructor. I wrote the latter.
All code was developed on Ubuntu 14.04.2 LTS, Python 2.7 and
PostgreSQL 9.3.6. In addition
to installing PostgreSQL, you will also need to install the following Python
modules:
Don't forget to start the postgres daemon.
To create the database and its tables, run this command:
python puppypopulator.py
To run the puppyqueries.py script, run this command:
python queries.py
This will display a menu in a terminal based interface where you select menu
item numbers to call the various functions, including exiting the script if you
choose. All data is dumped to STDOUT and is not paginated.
