#!/usr/bin/python


import sqlite3
conn = sqlite3.connect('sqlite3_trades.db')

c = conn.cursor()

# Create table
c.execute("""CREATE TABLE stocks
             (date text, trans_type text, symbol text, qty real, price real)""")

# Insert a row of data
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)")
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','AAPL',10,115.14)")
c.execute("INSERT INTO stocks VALUES ('2006-01-06','SELL','RHAT',100,33.08)")
c.execute("INSERT INTO stocks VALUES ('2006-01-05','BUY','AAPL',50,118.20)")
c.execute("INSERT INTO stocks VALUES ('2006-01-05','SELL','AAPL',150,121.08)")

# Save (commit) the changes
conn.commit()

# Changes will not be written until we close the connection
conn.close()




