In this page we demonstrate how to initialize a database. There is a lot going on there.
  1. Start a connection
    Connection successful.
  2. Delete old tables. Here we want to use exec() because the drop command does not return a queryset but instead number of rows effected. (Note: Always returns 0 when deleting or creating tables.)

    Delete artist:

    Number of rows effected: 0
    Number of rows effected: 0
  3. Create Tables. The SQL here is the same as if you were doing it via command line

    Artist Table then Album Table

    Number of rows effected: 0
    Number of rows effected: 0
  4. Load Values Into Database
  5. Check Values (should be 100 albums but less artist since The Beatles and Led Zepplin Rock.

    Number of artists: 65
    Number of albums: 100