How do you make a database using sqlite3 in python
Question: I'm trying to make a .db file which as a 1 to many realntionshp in it and it
will not work.

    
    
    from sqlite3 import *
    $sqlite3 testDB.db
    SQLite version 3.7.15.2 2013-01-09 11:53:05
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite>
    CREATE TABLE BOOKS(
    ISBN TEXT PRIMARY KEY    NOT NULL,
    TITLE            TEXT   NOT NULL,
    ATHOUR           TEXT   NOT NULL,
    NUMBEROFCOPIES   INT    NOT NULL,
    OUTNUMBER        INT    NOT NULL);
    CREATE TABLE LOANS(
    ORDERNUMBER TEXT PRIMATY KEY    NOT NULL,
    FOREIGN KEY (ISBN) REFERENCES BOOKS
    TILLE                   TEXT    NOT NULL,
    AUTHOR                  TEXT    NOT NULL,
    PERSON                  TEXT    NOT NULL,
    DUEDATE                 TEXT    NOT NULL);
    


Answer: You can take a look at pySQLite. It's a package that will allow you to dev
databases within Python use sqlite, but from what I'm seeing, it isn't as
widely available.

If I were you, I'd take a good look at using MySQL and then wrapping it with
mysql-python.

<https://wiki.python.org/moin/MySQL>

and

<http://code.google.com/p/pyodbc/>

Will be great places to start. The getting started page on the Google link has
some great examples of pulling in a database to Python.

I hope this helps!

