Imported all the notebooks
[tm351-notebooks.git] / notebooks / Transactions-dave.ipynb
diff --git a/notebooks/Transactions-dave.ipynb b/notebooks/Transactions-dave.ipynb
new file mode 100644 (file)
index 0000000..979c186
--- /dev/null
@@ -0,0 +1,64 @@
+{
+ "metadata": {
+  "name": "",
+  "signature": "sha256:311f2b2a75020242bf012374bf39a33d311cbe438684511fa7dec5ea8b5eb362"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+  {
+   "cells": [
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "import psycopg2 as pg;from pandas import read_sql_query as psql;from pandas.io.sql import execute as psqlx\n",
+      "dave = pg.connect(\"dbname='tm351test'  host='localhost' user='test' password='test' \")"
+     ],
+     "language": "python",
+     "metadata": {
+      "activity": false
+     },
+     "outputs": []
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "psqlx(\"UPDATE cars SET price=59000 WHERE id=1\",dave)\n",
+      "psql(\"SELECT * FROM cars WHERE id=1\",dave)"
+     ],
+     "language": "python",
+     "metadata": {
+      "activity": false
+     },
+     "outputs": []
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [
+      "dave.commit()\n",
+      "psql(\"SELECT * FROM cars WHERE id=1\",dave)"
+     ],
+     "language": "python",
+     "metadata": {
+      "activity": false
+     },
+     "outputs": []
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [],
+     "language": "python",
+     "metadata": {
+      "activity": false
+     },
+     "outputs": []
+    }
+   ],
+   "metadata": {}
+  }
+ ]
+}
\ No newline at end of file