From b037b6a7ee49f0de985f958dceb7f4ee1b275f58 Mon Sep 17 00:00:00 2001
From: Benjamin Bengfort <benjamin@bengfort.com>
Date: Wed, 27 Sep 2017 13:08:09 -0400
Subject: [PATCH] python3ify notebooks

---
 jupyter/.gitignore                            |   1 +
 jupyter/01-Jupyter-Getting-Started.ipynb      |  15 +-
 jupyter/02-Basics-SQL.ipynb                   | 699 ++++++++----------
 jupyter/03-SQL-Different-Types-of-Joins.ipynb | 335 ++++-----
 jupyter/04-SQL-NULLs-and-UNKNOWN.ipynb        | 138 +---
 jupyter/05-Basic-Relational-Algebra.ipynb     |  59 +-
 jupyter/06-SQL-INDEXES-AND-EXPLAIN.ipynb      | 218 +++---
 ...tional-Database-Design-Normalization.ipynb | 622 +++++++++-------
 8 files changed, 955 insertions(+), 1132 deletions(-)
 create mode 100644 jupyter/.gitignore

diff --git a/jupyter/.gitignore b/jupyter/.gitignore
new file mode 100644
index 0000000..763513e
--- /dev/null
+++ b/jupyter/.gitignore
@@ -0,0 +1 @@
+.ipynb_checkpoints
diff --git a/jupyter/01-Jupyter-Getting-Started.ipynb b/jupyter/01-Jupyter-Getting-Started.ipynb
index 4a8d499..af16915 100644
--- a/jupyter/01-Jupyter-Getting-Started.ipynb
+++ b/jupyter/01-Jupyter-Getting-Started.ipynb
@@ -128,7 +128,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def fibonacci(sequence_length):\n",
@@ -225,15 +227,6 @@
     "x,y = minmax(positions)\n",
     "print (x,y)"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
@@ -252,7 +245,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.5.2"
+   "version": "3.6.2"
   }
  },
  "nbformat": 4,
diff --git a/jupyter/02-Basics-SQL.ipynb b/jupyter/02-Basics-SQL.ipynb
index 2db18d3..35b8dff 100644
--- a/jupyter/02-Basics-SQL.ipynb
+++ b/jupyter/02-Basics-SQL.ipynb
@@ -13,22 +13,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [
-    {
-     "data": {
-      "text/plain": [
-       "u'Connected: ubuntu@university'"
-      ]
-     },
-     "execution_count": 1,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
    "source": [
     "%load_ext sql\n",
     "%sql postgresql://ubuntu:ubuntu@localhost/university"
@@ -43,10 +30,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 5,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -140,21 +125,21 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'10101', u'Srinivasan', u'Comp. Sci.', Decimal('65000.00')),\n",
-       " (u'12121', u'Wu', u'Finance', Decimal('90000.00')),\n",
-       " (u'15151', u'Mozart', u'Music', Decimal('40000.00')),\n",
-       " (u'22222', u'Einstein', u'Physics', Decimal('95000.00')),\n",
-       " (u'32343', u'El Said', u'History', Decimal('60000.00')),\n",
-       " (u'33456', u'Gold', u'Physics', Decimal('87000.00')),\n",
-       " (u'45565', u'Katz', u'Comp. Sci.', Decimal('75000.00')),\n",
-       " (u'58583', u'Califieri', u'History', Decimal('62000.00')),\n",
-       " (u'76543', u'Singh', u'Finance', Decimal('80000.00')),\n",
-       " (u'76766', u'Crick', u'Biology', Decimal('72000.00')),\n",
-       " (u'83821', u'Brandt', u'Comp. Sci.', Decimal('92000.00')),\n",
-       " (u'98345', u'Kim', u'Elec. Eng.', Decimal('80000.00'))]"
+       "[('10101', 'Srinivasan', 'Comp. Sci.', Decimal('65000.00')),\n",
+       " ('12121', 'Wu', 'Finance', Decimal('90000.00')),\n",
+       " ('15151', 'Mozart', 'Music', Decimal('40000.00')),\n",
+       " ('22222', 'Einstein', 'Physics', Decimal('95000.00')),\n",
+       " ('32343', 'El Said', 'History', Decimal('60000.00')),\n",
+       " ('33456', 'Gold', 'Physics', Decimal('87000.00')),\n",
+       " ('45565', 'Katz', 'Comp. Sci.', Decimal('75000.00')),\n",
+       " ('58583', 'Califieri', 'History', Decimal('62000.00')),\n",
+       " ('76543', 'Singh', 'Finance', Decimal('80000.00')),\n",
+       " ('76766', 'Crick', 'Biology', Decimal('72000.00')),\n",
+       " ('83821', 'Brandt', 'Comp. Sci.', Decimal('92000.00')),\n",
+       " ('98345', 'Kim', 'Elec. Eng.', Decimal('80000.00'))]"
       ]
      },
-     "execution_count": 2,
+     "execution_count": 5,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -173,10 +158,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 3,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 6,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -195,65 +178,65 @@
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>prereq</td>\n",
+       "        <td>department</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>teaches</td>\n",
+       "        <td>section</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>instructor</td>\n",
+       "        <td>course</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>department</td>\n",
+       "        <td>prereq</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>student</td>\n",
+       "        <td>classroom</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>advisor</td>\n",
+       "        <td>takes</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>section</td>\n",
+       "        <td>instructor</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>classroom</td>\n",
+       "        <td>teaches</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>time_slot</td>\n",
+       "        <td>student</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>takes</td>\n",
+       "        <td>advisor</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>public</td>\n",
-       "        <td>course</td>\n",
+       "        <td>time_slot</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(u'public', u'prereq'),\n",
-       " (u'public', u'teaches'),\n",
-       " (u'public', u'instructor'),\n",
-       " (u'public', u'department'),\n",
-       " (u'public', u'student'),\n",
-       " (u'public', u'advisor'),\n",
-       " (u'public', u'section'),\n",
-       " (u'public', u'classroom'),\n",
-       " (u'public', u'time_slot'),\n",
-       " (u'public', u'takes'),\n",
-       " (u'public', u'course')]"
+       "[('public', 'department'),\n",
+       " ('public', 'section'),\n",
+       " ('public', 'course'),\n",
+       " ('public', 'prereq'),\n",
+       " ('public', 'classroom'),\n",
+       " ('public', 'takes'),\n",
+       " ('public', 'instructor'),\n",
+       " ('public', 'teaches'),\n",
+       " ('public', 'student'),\n",
+       " ('public', 'advisor'),\n",
+       " ('public', 'time_slot')]"
       ]
      },
-     "execution_count": 3,
+     "execution_count": 6,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -267,10 +250,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 7,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -306,13 +287,13 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'id', u'character varying'),\n",
-       " (u'name', u'character varying'),\n",
-       " (u'dept_name', u'character varying'),\n",
-       " (u'salary', u'numeric')]"
+       "[('id', 'character varying'),\n",
+       " ('name', 'character varying'),\n",
+       " ('dept_name', 'character varying'),\n",
+       " ('salary', 'numeric')]"
       ]
      },
-     "execution_count": 4,
+     "execution_count": 7,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -382,10 +363,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 8,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -419,11 +398,11 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'BIO-101', u'Intro. to Biology', u'Biology', Decimal('4')),\n",
-       " (u'BIO-399', u'Computational Biology', u'Biology', Decimal('3'))]"
+       "[('BIO-101', 'Intro. to Biology', 'Biology', Decimal('4')),\n",
+       " ('BIO-399', 'Computational Biology', 'Biology', Decimal('3'))]"
       ]
      },
-     "execution_count": 5,
+     "execution_count": 8,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -441,10 +420,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 9,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -476,10 +453,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'98988', u'BIO-101', u'1', u'Summer', Decimal('2009'), u'A')]"
+       "[('98988', 'BIO-101', '1', 'Summer', Decimal('2009'), 'A')]"
       ]
      },
-     "execution_count": 6,
+     "execution_count": 9,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -490,10 +467,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 7,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 10,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -525,10 +500,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'98988', u'BIO-101', u'1', u'Summer', Decimal('2009'), u'A')]"
+       "[('98988', 'BIO-101', '1', 'Summer', Decimal('2009'), 'A')]"
       ]
      },
-     "execution_count": 7,
+     "execution_count": 10,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -548,10 +523,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 11,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -573,10 +546,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(2L,)]"
+       "[(2,)]"
       ]
      },
-     "execution_count": 8,
+     "execution_count": 11,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -594,10 +567,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 12,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -625,10 +596,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'22222', u'Einstein', u'Physics', Decimal('95000.00'))]"
+       "[('22222', 'Einstein', 'Physics', Decimal('95000.00'))]"
       ]
      },
-     "execution_count": 9,
+     "execution_count": 12,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -650,10 +621,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 10,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 13,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -734,21 +703,21 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'Srinivasan', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Wu', u'Finance', u'Painter'),\n",
-       " (u'Mozart', u'Music', u'Packard'),\n",
-       " (u'Einstein', u'Physics', u'Watson'),\n",
-       " (u'El Said', u'History', u'Painter'),\n",
-       " (u'Gold', u'Physics', u'Watson'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Califieri', u'History', u'Painter'),\n",
-       " (u'Singh', u'Finance', u'Painter'),\n",
-       " (u'Crick', u'Biology', u'Watson'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Taylor')]"
+       "[('Srinivasan', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Wu', 'Finance', 'Painter'),\n",
+       " ('Mozart', 'Music', 'Packard'),\n",
+       " ('Einstein', 'Physics', 'Watson'),\n",
+       " ('El Said', 'History', 'Painter'),\n",
+       " ('Gold', 'Physics', 'Watson'),\n",
+       " ('Katz', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Califieri', 'History', 'Painter'),\n",
+       " ('Singh', 'Finance', 'Painter'),\n",
+       " ('Crick', 'Biology', 'Watson'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Kim', 'Elec. Eng.', 'Taylor')]"
       ]
      },
-     "execution_count": 10,
+     "execution_count": 13,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -769,10 +738,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 11,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 14,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -853,21 +820,21 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'Srinivasan', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Wu', u'Finance', u'Painter'),\n",
-       " (u'Mozart', u'Music', u'Packard'),\n",
-       " (u'Einstein', u'Physics', u'Watson'),\n",
-       " (u'El Said', u'History', u'Painter'),\n",
-       " (u'Gold', u'Physics', u'Watson'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Califieri', u'History', u'Painter'),\n",
-       " (u'Singh', u'Finance', u'Painter'),\n",
-       " (u'Crick', u'Biology', u'Watson'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Taylor')]"
+       "[('Srinivasan', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Wu', 'Finance', 'Painter'),\n",
+       " ('Mozart', 'Music', 'Packard'),\n",
+       " ('Einstein', 'Physics', 'Watson'),\n",
+       " ('El Said', 'History', 'Painter'),\n",
+       " ('Gold', 'Physics', 'Watson'),\n",
+       " ('Katz', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Califieri', 'History', 'Painter'),\n",
+       " ('Singh', 'Finance', 'Painter'),\n",
+       " ('Crick', 'Biology', 'Watson'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Kim', 'Elec. Eng.', 'Taylor')]"
       ]
      },
-     "execution_count": 11,
+     "execution_count": 14,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -887,10 +854,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 12,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 15,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1331,93 +1296,93 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'Srinivasan', u'Comp. Sci.', u'Watson'),\n",
-       " (u'Wu', u'Finance', u'Watson'),\n",
-       " (u'Mozart', u'Music', u'Watson'),\n",
-       " (u'Einstein', u'Physics', u'Watson'),\n",
-       " (u'El Said', u'History', u'Watson'),\n",
-       " (u'Gold', u'Physics', u'Watson'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Watson'),\n",
-       " (u'Califieri', u'History', u'Watson'),\n",
-       " (u'Singh', u'Finance', u'Watson'),\n",
-       " (u'Crick', u'Biology', u'Watson'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Watson'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Watson'),\n",
-       " (u'Srinivasan', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Wu', u'Finance', u'Taylor'),\n",
-       " (u'Mozart', u'Music', u'Taylor'),\n",
-       " (u'Einstein', u'Physics', u'Taylor'),\n",
-       " (u'El Said', u'History', u'Taylor'),\n",
-       " (u'Gold', u'Physics', u'Taylor'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Califieri', u'History', u'Taylor'),\n",
-       " (u'Singh', u'Finance', u'Taylor'),\n",
-       " (u'Crick', u'Biology', u'Taylor'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Taylor'),\n",
-       " (u'Srinivasan', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Wu', u'Finance', u'Taylor'),\n",
-       " (u'Mozart', u'Music', u'Taylor'),\n",
-       " (u'Einstein', u'Physics', u'Taylor'),\n",
-       " (u'El Said', u'History', u'Taylor'),\n",
-       " (u'Gold', u'Physics', u'Taylor'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Califieri', u'History', u'Taylor'),\n",
-       " (u'Singh', u'Finance', u'Taylor'),\n",
-       " (u'Crick', u'Biology', u'Taylor'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Taylor'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Taylor'),\n",
-       " (u'Srinivasan', u'Comp. Sci.', u'Painter'),\n",
-       " (u'Wu', u'Finance', u'Painter'),\n",
-       " (u'Mozart', u'Music', u'Painter'),\n",
-       " (u'Einstein', u'Physics', u'Painter'),\n",
-       " (u'El Said', u'History', u'Painter'),\n",
-       " (u'Gold', u'Physics', u'Painter'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Painter'),\n",
-       " (u'Califieri', u'History', u'Painter'),\n",
-       " (u'Singh', u'Finance', u'Painter'),\n",
-       " (u'Crick', u'Biology', u'Painter'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Painter'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Painter'),\n",
-       " (u'Srinivasan', u'Comp. Sci.', u'Painter'),\n",
-       " (u'Wu', u'Finance', u'Painter'),\n",
-       " (u'Mozart', u'Music', u'Painter'),\n",
-       " (u'Einstein', u'Physics', u'Painter'),\n",
-       " (u'El Said', u'History', u'Painter'),\n",
-       " (u'Gold', u'Physics', u'Painter'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Painter'),\n",
-       " (u'Califieri', u'History', u'Painter'),\n",
-       " (u'Singh', u'Finance', u'Painter'),\n",
-       " (u'Crick', u'Biology', u'Painter'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Painter'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Painter'),\n",
-       " (u'Srinivasan', u'Comp. Sci.', u'Packard'),\n",
-       " (u'Wu', u'Finance', u'Packard'),\n",
-       " (u'Mozart', u'Music', u'Packard'),\n",
-       " (u'Einstein', u'Physics', u'Packard'),\n",
-       " (u'El Said', u'History', u'Packard'),\n",
-       " (u'Gold', u'Physics', u'Packard'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Packard'),\n",
-       " (u'Califieri', u'History', u'Packard'),\n",
-       " (u'Singh', u'Finance', u'Packard'),\n",
-       " (u'Crick', u'Biology', u'Packard'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Packard'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Packard'),\n",
-       " (u'Srinivasan', u'Comp. Sci.', u'Watson'),\n",
-       " (u'Wu', u'Finance', u'Watson'),\n",
-       " (u'Mozart', u'Music', u'Watson'),\n",
-       " (u'Einstein', u'Physics', u'Watson'),\n",
-       " (u'El Said', u'History', u'Watson'),\n",
-       " (u'Gold', u'Physics', u'Watson'),\n",
-       " (u'Katz', u'Comp. Sci.', u'Watson'),\n",
-       " (u'Califieri', u'History', u'Watson'),\n",
-       " (u'Singh', u'Finance', u'Watson'),\n",
-       " (u'Crick', u'Biology', u'Watson'),\n",
-       " (u'Brandt', u'Comp. Sci.', u'Watson'),\n",
-       " (u'Kim', u'Elec. Eng.', u'Watson')]"
+       "[('Srinivasan', 'Comp. Sci.', 'Watson'),\n",
+       " ('Wu', 'Finance', 'Watson'),\n",
+       " ('Mozart', 'Music', 'Watson'),\n",
+       " ('Einstein', 'Physics', 'Watson'),\n",
+       " ('El Said', 'History', 'Watson'),\n",
+       " ('Gold', 'Physics', 'Watson'),\n",
+       " ('Katz', 'Comp. Sci.', 'Watson'),\n",
+       " ('Califieri', 'History', 'Watson'),\n",
+       " ('Singh', 'Finance', 'Watson'),\n",
+       " ('Crick', 'Biology', 'Watson'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Watson'),\n",
+       " ('Kim', 'Elec. Eng.', 'Watson'),\n",
+       " ('Srinivasan', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Wu', 'Finance', 'Taylor'),\n",
+       " ('Mozart', 'Music', 'Taylor'),\n",
+       " ('Einstein', 'Physics', 'Taylor'),\n",
+       " ('El Said', 'History', 'Taylor'),\n",
+       " ('Gold', 'Physics', 'Taylor'),\n",
+       " ('Katz', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Califieri', 'History', 'Taylor'),\n",
+       " ('Singh', 'Finance', 'Taylor'),\n",
+       " ('Crick', 'Biology', 'Taylor'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Kim', 'Elec. Eng.', 'Taylor'),\n",
+       " ('Srinivasan', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Wu', 'Finance', 'Taylor'),\n",
+       " ('Mozart', 'Music', 'Taylor'),\n",
+       " ('Einstein', 'Physics', 'Taylor'),\n",
+       " ('El Said', 'History', 'Taylor'),\n",
+       " ('Gold', 'Physics', 'Taylor'),\n",
+       " ('Katz', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Califieri', 'History', 'Taylor'),\n",
+       " ('Singh', 'Finance', 'Taylor'),\n",
+       " ('Crick', 'Biology', 'Taylor'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Taylor'),\n",
+       " ('Kim', 'Elec. Eng.', 'Taylor'),\n",
+       " ('Srinivasan', 'Comp. Sci.', 'Painter'),\n",
+       " ('Wu', 'Finance', 'Painter'),\n",
+       " ('Mozart', 'Music', 'Painter'),\n",
+       " ('Einstein', 'Physics', 'Painter'),\n",
+       " ('El Said', 'History', 'Painter'),\n",
+       " ('Gold', 'Physics', 'Painter'),\n",
+       " ('Katz', 'Comp. Sci.', 'Painter'),\n",
+       " ('Califieri', 'History', 'Painter'),\n",
+       " ('Singh', 'Finance', 'Painter'),\n",
+       " ('Crick', 'Biology', 'Painter'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Painter'),\n",
+       " ('Kim', 'Elec. Eng.', 'Painter'),\n",
+       " ('Srinivasan', 'Comp. Sci.', 'Painter'),\n",
+       " ('Wu', 'Finance', 'Painter'),\n",
+       " ('Mozart', 'Music', 'Painter'),\n",
+       " ('Einstein', 'Physics', 'Painter'),\n",
+       " ('El Said', 'History', 'Painter'),\n",
+       " ('Gold', 'Physics', 'Painter'),\n",
+       " ('Katz', 'Comp. Sci.', 'Painter'),\n",
+       " ('Califieri', 'History', 'Painter'),\n",
+       " ('Singh', 'Finance', 'Painter'),\n",
+       " ('Crick', 'Biology', 'Painter'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Painter'),\n",
+       " ('Kim', 'Elec. Eng.', 'Painter'),\n",
+       " ('Srinivasan', 'Comp. Sci.', 'Packard'),\n",
+       " ('Wu', 'Finance', 'Packard'),\n",
+       " ('Mozart', 'Music', 'Packard'),\n",
+       " ('Einstein', 'Physics', 'Packard'),\n",
+       " ('El Said', 'History', 'Packard'),\n",
+       " ('Gold', 'Physics', 'Packard'),\n",
+       " ('Katz', 'Comp. Sci.', 'Packard'),\n",
+       " ('Califieri', 'History', 'Packard'),\n",
+       " ('Singh', 'Finance', 'Packard'),\n",
+       " ('Crick', 'Biology', 'Packard'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Packard'),\n",
+       " ('Kim', 'Elec. Eng.', 'Packard'),\n",
+       " ('Srinivasan', 'Comp. Sci.', 'Watson'),\n",
+       " ('Wu', 'Finance', 'Watson'),\n",
+       " ('Mozart', 'Music', 'Watson'),\n",
+       " ('Einstein', 'Physics', 'Watson'),\n",
+       " ('El Said', 'History', 'Watson'),\n",
+       " ('Gold', 'Physics', 'Watson'),\n",
+       " ('Katz', 'Comp. Sci.', 'Watson'),\n",
+       " ('Califieri', 'History', 'Watson'),\n",
+       " ('Singh', 'Finance', 'Watson'),\n",
+       " ('Crick', 'Biology', 'Watson'),\n",
+       " ('Brandt', 'Comp. Sci.', 'Watson'),\n",
+       " ('Kim', 'Elec. Eng.', 'Watson')]"
       ]
      },
-     "execution_count": 12,
+     "execution_count": 15,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1438,10 +1403,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 13,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 16,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1479,22 +1442,22 @@
        "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on instructor s  (cost=0.00..15.50 rows=2 width=14)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filter: ((dept_name)::text = 'Biology'::text)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filter: ((dept_name)::text = &#x27;Biology&#x27;::text)</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(u'HashAggregate  (cost=43.84..45.84 rows=200 width=58)',),\n",
-       " (u'  Group Key: t.name',),\n",
-       " (u'  ->  Nested Loop  (cost=0.00..43.10 rows=293 width=58)',),\n",
-       " (u'        Join Filter: (t.salary > s.salary)',),\n",
-       " (u'        ->  Seq Scan on instructor t  (cost=0.00..14.40 rows=440 width=72)',),\n",
-       " (u'        ->  Materialize  (cost=0.00..15.51 rows=2 width=14)',),\n",
-       " (u'              ->  Seq Scan on instructor s  (cost=0.00..15.50 rows=2 width=14)',),\n",
-       " (u\"                    Filter: ((dept_name)::text = 'Biology'::text)\",)]"
+       "[('HashAggregate  (cost=43.84..45.84 rows=200 width=58)',),\n",
+       " ('  Group Key: t.name',),\n",
+       " ('  ->  Nested Loop  (cost=0.00..43.10 rows=293 width=58)',),\n",
+       " ('        Join Filter: (t.salary > s.salary)',),\n",
+       " ('        ->  Seq Scan on instructor t  (cost=0.00..14.40 rows=440 width=72)',),\n",
+       " ('        ->  Materialize  (cost=0.00..15.51 rows=2 width=14)',),\n",
+       " ('              ->  Seq Scan on instructor s  (cost=0.00..15.50 rows=2 width=14)',),\n",
+       " (\"                    Filter: ((dept_name)::text = 'Biology'::text)\",)]"
       ]
      },
-     "execution_count": 13,
+     "execution_count": 16,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1517,10 +1480,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 14,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 17,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1537,43 +1498,43 @@
        "        <th>QUERY PLAN</th>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>Hash Join  (cost=29.12..176.18 rows=3612 width=68) (actual time=0.016..0.016 rows=0 loops=1)</td>\n",
+       "        <td>Hash Join  (cost=29.12..176.18 rows=3612 width=68) (actual time=0.047..0.047 rows=0 loops=1)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>&nbsp;&nbsp;Hash Cond: ((p1.prereq_id)::text = (p2.course_id)::text)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;-&gt;  Seq Scan on prereq p1  (cost=0.00..18.50 rows=850 width=68) (actual time=0.005..0.006 rows=7 loops=1)</td>\n",
+       "        <td>&nbsp;&nbsp;-&gt;  Seq Scan on prereq p1  (cost=0.00..18.50 rows=850 width=68) (actual time=0.012..0.013 rows=7 loops=1)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;-&gt;  Hash  (cost=18.50..18.50 rows=850 width=68) (actual time=0.005..0.005 rows=7 loops=1)</td>\n",
+       "        <td>&nbsp;&nbsp;-&gt;  Hash  (cost=18.50..18.50 rows=850 width=68) (actual time=0.016..0.016 rows=7 loops=1)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Buckets: 1024  Batches: 1  Memory Usage: 9kB</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on prereq p2  (cost=0.00..18.50 rows=850 width=68) (actual time=0.001..0.002 rows=7 loops=1)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on prereq p2  (cost=0.00..18.50 rows=850 width=68) (actual time=0.003..0.005 rows=7 loops=1)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>Planning time: 0.130 ms</td>\n",
+       "        <td>Planning time: 0.328 ms</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>Execution time: 0.029 ms</td>\n",
+       "        <td>Execution time: 0.124 ms</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(u'Hash Join  (cost=29.12..176.18 rows=3612 width=68) (actual time=0.016..0.016 rows=0 loops=1)',),\n",
-       " (u'  Hash Cond: ((p1.prereq_id)::text = (p2.course_id)::text)',),\n",
-       " (u'  ->  Seq Scan on prereq p1  (cost=0.00..18.50 rows=850 width=68) (actual time=0.005..0.006 rows=7 loops=1)',),\n",
-       " (u'  ->  Hash  (cost=18.50..18.50 rows=850 width=68) (actual time=0.005..0.005 rows=7 loops=1)',),\n",
-       " (u'        Buckets: 1024  Batches: 1  Memory Usage: 9kB',),\n",
-       " (u'        ->  Seq Scan on prereq p2  (cost=0.00..18.50 rows=850 width=68) (actual time=0.001..0.002 rows=7 loops=1)',),\n",
-       " (u'Planning time: 0.130 ms',),\n",
-       " (u'Execution time: 0.029 ms',)]"
+       "[('Hash Join  (cost=29.12..176.18 rows=3612 width=68) (actual time=0.047..0.047 rows=0 loops=1)',),\n",
+       " ('  Hash Cond: ((p1.prereq_id)::text = (p2.course_id)::text)',),\n",
+       " ('  ->  Seq Scan on prereq p1  (cost=0.00..18.50 rows=850 width=68) (actual time=0.012..0.013 rows=7 loops=1)',),\n",
+       " ('  ->  Hash  (cost=18.50..18.50 rows=850 width=68) (actual time=0.016..0.016 rows=7 loops=1)',),\n",
+       " ('        Buckets: 1024  Batches: 1  Memory Usage: 9kB',),\n",
+       " ('        ->  Seq Scan on prereq p2  (cost=0.00..18.50 rows=850 width=68) (actual time=0.003..0.005 rows=7 loops=1)',),\n",
+       " ('Planning time: 0.328 ms',),\n",
+       " ('Execution time: 0.124 ms',)]"
       ]
      },
-     "execution_count": 14,
+     "execution_count": 17,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1594,10 +1555,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 18,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1612,7 +1571,7 @@
        "[]"
       ]
      },
-     "execution_count": 15,
+     "execution_count": 18,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1623,10 +1582,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 19,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1662,13 +1619,13 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'CS-190', u'PHY-101'),\n",
-       " (u'CS-315', u'PHY-101'),\n",
-       " (u'CS-319', u'PHY-101'),\n",
-       " (u'CS-347', u'PHY-101')]"
+       "[('CS-190', 'PHY-101'),\n",
+       " ('CS-315', 'PHY-101'),\n",
+       " ('CS-319', 'PHY-101'),\n",
+       " ('CS-347', 'PHY-101')]"
       ]
      },
-     "execution_count": 16,
+     "execution_count": 19,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1690,10 +1647,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 20,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1736,17 +1691,17 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'CS-101',),\n",
-       " (u'CS-315',),\n",
-       " (u'CS-319',),\n",
-       " (u'CS-347',),\n",
-       " (u'FIN-201',),\n",
-       " (u'HIS-351',),\n",
-       " (u'MU-199',),\n",
-       " (u'PHY-101',)]"
+       "[('CS-101',),\n",
+       " ('CS-315',),\n",
+       " ('CS-319',),\n",
+       " ('CS-347',),\n",
+       " ('FIN-201',),\n",
+       " ('HIS-351',),\n",
+       " ('MU-199',),\n",
+       " ('PHY-101',)]"
       ]
      },
-     "execution_count": 17,
+     "execution_count": 20,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1771,10 +1726,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 21,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1822,16 +1775,16 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'Comp. Sci.', Decimal('77333.333333333333')),\n",
-       " (u'Elec. Eng.', Decimal('80000.000000000000')),\n",
-       " (u'History', Decimal('61000.000000000000')),\n",
-       " (u'Music', Decimal('40000.000000000000')),\n",
-       " (u'Finance', Decimal('85000.000000000000')),\n",
-       " (u'Physics', Decimal('91000.000000000000')),\n",
-       " (u'Biology', Decimal('72000.000000000000'))]"
+       "[('Comp. Sci.', Decimal('77333.333333333333')),\n",
+       " ('Elec. Eng.', Decimal('80000.000000000000')),\n",
+       " ('History', Decimal('61000.000000000000')),\n",
+       " ('Music', Decimal('40000.000000000000')),\n",
+       " ('Finance', Decimal('85000.000000000000')),\n",
+       " ('Physics', Decimal('91000.000000000000')),\n",
+       " ('Biology', Decimal('72000.000000000000'))]"
       ]
      },
-     "execution_count": 18,
+     "execution_count": 21,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1852,10 +1805,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 22,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1879,10 +1830,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'Comp. Sci.', Decimal('77333.333333333333'))]"
+       "[('Comp. Sci.', Decimal('77333.333333333333'))]"
       ]
      },
-     "execution_count": 19,
+     "execution_count": 22,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1909,10 +1860,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 23,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1937,7 +1886,7 @@
        "[(Decimal('120000.00'),)]"
       ]
      },
-     "execution_count": 20,
+     "execution_count": 23,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1964,10 +1913,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 21,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 24,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -2001,11 +1948,11 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'10101', u'Srinivasan', u'Comp. Sci.', Decimal('65000.00')),\n",
-       " (u'12121', u'Wu', u'Finance', Decimal('90000.00'))]"
+       "[('10101', 'Srinivasan', 'Comp. Sci.', Decimal('65000.00')),\n",
+       " ('12121', 'Wu', 'Finance', Decimal('90000.00'))]"
       ]
      },
-     "execution_count": 21,
+     "execution_count": 24,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2024,85 +1971,95 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 22,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 31,
+   "metadata": {},
    "outputs": [
     {
-     "ename": "SyntaxError",
-     "evalue": "invalid syntax (<ipython-input-22-c0c17496ea2b>, line 2)",
-     "output_type": "error",
-     "traceback": [
-      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-22-c0c17496ea2b>\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m    select flightdate, count(*)\u001b[0m\n\u001b[0m                    ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "7 rows affected.\n"
      ]
+    },
+    {
+     "data": {
+      "text/html": [
+       "<table>\n",
+       "    <tr>\n",
+       "        <th>dept_name</th>\n",
+       "        <th>count</th>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>Biology</td>\n",
+       "        <td>3</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>Comp. Sci.</td>\n",
+       "        <td>5</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>Elec. Eng.</td>\n",
+       "        <td>1</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>Finance</td>\n",
+       "        <td>1</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>History</td>\n",
+       "        <td>1</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>Music</td>\n",
+       "        <td>1</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>Physics</td>\n",
+       "        <td>1</td>\n",
+       "    </tr>\n",
+       "</table>"
+      ],
+      "text/plain": [
+       "[('Biology', 3),\n",
+       " ('Comp. Sci.', 5),\n",
+       " ('Elec. Eng.', 1),\n",
+       " ('Finance', 1),\n",
+       " ('History', 1),\n",
+       " ('Music', 1),\n",
+       " ('Physics', 1)]"
+      ]
+     },
+     "execution_count": 31,
+     "metadata": {},
+     "output_type": "execute_result"
     }
    ],
    "source": [
-    "with t as (\n",
-    "    select flightdate, count(*)\n",
-    "    from flewon\n",
-    "    group by flightdate\n",
-    ")\n",
-    "select flightdate, count\n",
-    "from t \n",
-    "where t.count = (select max(count) from t where count < (select max(count) from t));"
+    "%%sql \n",
+    "SELECT dept_name, count(course_id)\n",
+    "    FROM course \n",
+    "GROUP BY dept_name\n",
+    "ORDER BY dept_name"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 2",
+   "display_name": "Python 3",
    "language": "python",
-   "name": "python2"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
-    "version": 2
+    "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.12"
+   "pygments_lexer": "ipython3",
+   "version": "3.6.2"
   }
  },
  "nbformat": 4,
diff --git a/jupyter/03-SQL-Different-Types-of-Joins.ipynb b/jupyter/03-SQL-Different-Types-of-Joins.ipynb
index 7ccfd3f..812f9fd 100644
--- a/jupyter/03-SQL-Different-Types-of-Joins.ipynb
+++ b/jupyter/03-SQL-Different-Types-of-Joins.ipynb
@@ -9,32 +9,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 2,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [
-    {
-     "name": "stderr",
-     "output_type": "stream",
-     "text": [
-      "/usr/local/lib/python2.7/dist-packages/IPython/config.py:13: ShimWarning: The `IPython.config` package has been deprecated. You should import from traitlets.config instead.\n",
-      "  \"You should import from traitlets.config instead.\", ShimWarning)\n",
-      "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.\n",
-      "  warn(\"IPython.utils.traitlets has moved to a top-level traitlets package.\")\n"
-     ]
-    },
-    {
-     "data": {
-      "text/plain": [
-       "u'Connected: vagrant@university'"
-      ]
-     },
-     "execution_count": 2,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
    "source": [
     "%load_ext sql\n",
     "%sql postgresql://vagrant:vagrant@localhost/university"
@@ -42,10 +19,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 2,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -68,7 +43,7 @@
        "[]"
       ]
      },
-     "execution_count": 4,
+     "execution_count": 2,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -97,10 +72,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 3,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -194,21 +167,21 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one'),\n",
-       " (u'alpha', 10, 20, u'two'),\n",
-       " (u'alpha', 10, 40, u'three'),\n",
-       " (u'beta', 20, 10, u'one'),\n",
-       " (u'beta', 20, 20, u'two'),\n",
-       " (u'beta', 20, 40, u'three'),\n",
-       " (u'gamma', 20, 10, u'one'),\n",
-       " (u'gamma', 20, 20, u'two'),\n",
-       " (u'gamma', 20, 40, u'three'),\n",
-       " (u'rho', 30, 10, u'one'),\n",
-       " (u'rho', 30, 20, u'two'),\n",
-       " (u'rho', 30, 40, u'three')]"
+       "[('alpha', 10, 10, 'one'),\n",
+       " ('alpha', 10, 20, 'two'),\n",
+       " ('alpha', 10, 40, 'three'),\n",
+       " ('beta', 20, 10, 'one'),\n",
+       " ('beta', 20, 20, 'two'),\n",
+       " ('beta', 20, 40, 'three'),\n",
+       " ('gamma', 20, 10, 'one'),\n",
+       " ('gamma', 20, 20, 'two'),\n",
+       " ('gamma', 20, 40, 'three'),\n",
+       " ('rho', 30, 10, 'one'),\n",
+       " ('rho', 30, 20, 'two'),\n",
+       " ('rho', 30, 40, 'three')]"
       ]
      },
-     "execution_count": 5,
+     "execution_count": 3,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -219,10 +192,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 4,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -438,33 +409,33 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one', u'one', u'alpha'),\n",
-       " (u'alpha', 10, 20, u'two', u'one', u'alpha'),\n",
-       " (u'alpha', 10, 40, u'three', u'one', u'alpha'),\n",
-       " (u'alpha', 10, 10, u'one', u'two', u'beta'),\n",
-       " (u'alpha', 10, 20, u'two', u'two', u'beta'),\n",
-       " (u'alpha', 10, 40, u'three', u'two', u'beta'),\n",
-       " (u'beta', 20, 10, u'one', u'one', u'alpha'),\n",
-       " (u'beta', 20, 20, u'two', u'one', u'alpha'),\n",
-       " (u'beta', 20, 40, u'three', u'one', u'alpha'),\n",
-       " (u'beta', 20, 10, u'one', u'two', u'beta'),\n",
-       " (u'beta', 20, 20, u'two', u'two', u'beta'),\n",
-       " (u'beta', 20, 40, u'three', u'two', u'beta'),\n",
-       " (u'gamma', 20, 10, u'one', u'one', u'alpha'),\n",
-       " (u'gamma', 20, 20, u'two', u'one', u'alpha'),\n",
-       " (u'gamma', 20, 40, u'three', u'one', u'alpha'),\n",
-       " (u'gamma', 20, 10, u'one', u'two', u'beta'),\n",
-       " (u'gamma', 20, 20, u'two', u'two', u'beta'),\n",
-       " (u'gamma', 20, 40, u'three', u'two', u'beta'),\n",
-       " (u'rho', 30, 10, u'one', u'one', u'alpha'),\n",
-       " (u'rho', 30, 20, u'two', u'one', u'alpha'),\n",
-       " (u'rho', 30, 40, u'three', u'one', u'alpha'),\n",
-       " (u'rho', 30, 10, u'one', u'two', u'beta'),\n",
-       " (u'rho', 30, 20, u'two', u'two', u'beta'),\n",
-       " (u'rho', 30, 40, u'three', u'two', u'beta')]"
+       "[('alpha', 10, 10, 'one', 'one', 'alpha'),\n",
+       " ('alpha', 10, 20, 'two', 'one', 'alpha'),\n",
+       " ('alpha', 10, 40, 'three', 'one', 'alpha'),\n",
+       " ('alpha', 10, 10, 'one', 'two', 'beta'),\n",
+       " ('alpha', 10, 20, 'two', 'two', 'beta'),\n",
+       " ('alpha', 10, 40, 'three', 'two', 'beta'),\n",
+       " ('beta', 20, 10, 'one', 'one', 'alpha'),\n",
+       " ('beta', 20, 20, 'two', 'one', 'alpha'),\n",
+       " ('beta', 20, 40, 'three', 'one', 'alpha'),\n",
+       " ('beta', 20, 10, 'one', 'two', 'beta'),\n",
+       " ('beta', 20, 20, 'two', 'two', 'beta'),\n",
+       " ('beta', 20, 40, 'three', 'two', 'beta'),\n",
+       " ('gamma', 20, 10, 'one', 'one', 'alpha'),\n",
+       " ('gamma', 20, 20, 'two', 'one', 'alpha'),\n",
+       " ('gamma', 20, 40, 'three', 'one', 'alpha'),\n",
+       " ('gamma', 20, 10, 'one', 'two', 'beta'),\n",
+       " ('gamma', 20, 20, 'two', 'two', 'beta'),\n",
+       " ('gamma', 20, 40, 'three', 'two', 'beta'),\n",
+       " ('rho', 30, 10, 'one', 'one', 'alpha'),\n",
+       " ('rho', 30, 20, 'two', 'one', 'alpha'),\n",
+       " ('rho', 30, 40, 'three', 'one', 'alpha'),\n",
+       " ('rho', 30, 10, 'one', 'two', 'beta'),\n",
+       " ('rho', 30, 20, 'two', 'two', 'beta'),\n",
+       " ('rho', 30, 40, 'three', 'two', 'beta')]"
       ]
      },
-     "execution_count": 6,
+     "execution_count": 4,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -483,10 +454,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 7,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 5,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -526,12 +495,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one'),\n",
-       " (u'beta', 20, 20, u'two'),\n",
-       " (u'gamma', 20, 20, u'two')]"
+       "[('alpha', 10, 10, 'one'), ('beta', 20, 20, 'two'), ('gamma', 20, 20, 'two')]"
       ]
      },
-     "execution_count": 7,
+     "execution_count": 5,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -542,10 +509,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 6,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -593,12 +558,12 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one', u'one', u'alpha'),\n",
-       " (u'beta', 20, 20, u'two', u'two', u'beta'),\n",
-       " (u'gamma', 20, 20, u'two', u'two', u'beta')]"
+       "[('alpha', 10, 10, 'one', 'one', 'alpha'),\n",
+       " ('beta', 20, 20, 'two', 'two', 'beta'),\n",
+       " ('gamma', 20, 20, 'two', 'two', 'beta')]"
       ]
      },
-     "execution_count": 8,
+     "execution_count": 6,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -609,10 +574,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 7,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -664,14 +627,14 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 20, u'two'),\n",
-       " (u'alpha', 10, 40, u'three'),\n",
-       " (u'beta', 20, 40, u'three'),\n",
-       " (u'gamma', 20, 40, u'three'),\n",
-       " (u'rho', 30, 40, u'three')]"
+       "[('alpha', 10, 20, 'two'),\n",
+       " ('alpha', 10, 40, 'three'),\n",
+       " ('beta', 20, 40, 'three'),\n",
+       " ('gamma', 20, 40, 'three'),\n",
+       " ('rho', 30, 40, 'three')]"
       ]
      },
-     "execution_count": 9,
+     "execution_count": 7,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -682,10 +645,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 10,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 8,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -725,12 +686,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'beta', 20, 20, u'two'),\n",
-       " (u'gamma', 20, 20, u'two'),\n",
-       " (u'rho', 30, 10, u'one')]"
+       "[('beta', 20, 20, 'two'), ('gamma', 20, 20, 'two'), ('rho', 30, 10, 'one')]"
       ]
      },
-     "execution_count": 10,
+     "execution_count": 8,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -749,10 +708,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 11,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 9,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -792,12 +749,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one'),\n",
-       " (u'beta', 20, 20, u'two'),\n",
-       " (u'gamma', 20, 20, u'two')]"
+       "[('alpha', 10, 10, 'one'), ('beta', 20, 20, 'two'), ('gamma', 20, 20, 'two')]"
       ]
      },
-     "execution_count": 11,
+     "execution_count": 9,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -808,10 +763,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 12,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 10,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -859,12 +812,12 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one', u'one', u'alpha'),\n",
-       " (u'beta', 20, 20, u'two', u'two', u'beta'),\n",
-       " (u'gamma', 20, 20, u'two', u'two', u'beta')]"
+       "[('alpha', 10, 10, 'one', 'one', 'alpha'),\n",
+       " ('beta', 20, 20, 'two', 'two', 'beta'),\n",
+       " ('gamma', 20, 20, 'two', 'two', 'beta')]"
       ]
      },
-     "execution_count": 12,
+     "execution_count": 10,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -885,10 +838,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 13,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 11,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -924,10 +875,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(10, u'alpha', u'one'), (20, u'beta', u'two'), (20, u'gamma', u'two')]"
+       "[(10, 'alpha', 'one'), (20, 'beta', 'two'), (20, 'gamma', 'two')]"
       ]
      },
-     "execution_count": 13,
+     "execution_count": 11,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -938,10 +889,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 14,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 12,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -981,12 +930,12 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'one', 10, u'alpha', u'alpha'),\n",
-       " (u'two', 20, u'beta', u'beta'),\n",
-       " (u'two', 20, u'gamma', u'beta')]"
+       "[('one', 10, 'alpha', 'alpha'),\n",
+       " ('two', 20, 'beta', 'beta'),\n",
+       " ('two', 20, 'gamma', 'beta')]"
       ]
      },
-     "execution_count": 14,
+     "execution_count": 12,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1011,10 +960,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 13,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1060,13 +1007,13 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one'),\n",
-       " (u'beta', 20, 20, u'two'),\n",
-       " (u'gamma', 20, 20, u'two'),\n",
-       " (u'rho', 30, None, None)]"
+       "[('alpha', 10, 10, 'one'),\n",
+       " ('beta', 20, 20, 'two'),\n",
+       " ('gamma', 20, 20, 'two'),\n",
+       " ('rho', 30, None, None)]"
       ]
      },
-     "execution_count": 15,
+     "execution_count": 13,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1084,10 +1031,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 14,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1133,13 +1078,13 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one'),\n",
-       " (u'beta', 20, 20, u'two'),\n",
-       " (u'gamma', 20, 20, u'two'),\n",
-       " (None, None, 40, u'three')]"
+       "[('alpha', 10, 10, 'one'),\n",
+       " ('beta', 20, 20, 'two'),\n",
+       " ('gamma', 20, 20, 'two'),\n",
+       " (None, None, 40, 'three')]"
       ]
      },
-     "execution_count": 16,
+     "execution_count": 14,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1150,10 +1095,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 15,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1205,14 +1148,14 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one'),\n",
-       " (u'beta', 20, 20, u'two'),\n",
-       " (u'gamma', 20, 20, u'two'),\n",
-       " (u'rho', 30, None, None),\n",
-       " (None, None, 40, u'three')]"
+       "[('alpha', 10, 10, 'one'),\n",
+       " ('beta', 20, 20, 'two'),\n",
+       " ('gamma', 20, 20, 'two'),\n",
+       " ('rho', 30, None, None),\n",
+       " (None, None, 40, 'three')]"
       ]
      },
-     "execution_count": 17,
+     "execution_count": 15,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1223,9 +1166,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": 16,
    "metadata": {
-    "collapsed": false,
     "scrolled": true
    },
    "outputs": [
@@ -1291,14 +1233,14 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10, 10, u'one', u'one', u'alpha'),\n",
-       " (None, None, 40, u'three', None, None),\n",
-       " (u'beta', 20, 20, u'two', u'two', u'beta'),\n",
-       " (u'gamma', 20, 20, u'two', u'two', u'beta'),\n",
-       " (u'rho', 30, None, None, None, None)]"
+       "[('alpha', 10, 10, 'one', 'one', 'alpha'),\n",
+       " (None, None, 40, 'three', None, None),\n",
+       " ('beta', 20, 20, 'two', 'two', 'beta'),\n",
+       " ('gamma', 20, 20, 'two', 'two', 'beta'),\n",
+       " ('rho', 30, None, None, None, None)]"
       ]
      },
-     "execution_count": 18,
+     "execution_count": 16,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1319,10 +1261,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 17,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1354,10 +1294,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'alpha', 10), (u'beta', 20), (u'gamma', 20)]"
+       "[('alpha', 10), ('beta', 20), ('gamma', 20)]"
       ]
      },
-     "execution_count": 19,
+     "execution_count": 17,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1378,10 +1318,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 18,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1405,10 +1343,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'rho', 30)]"
+       "[('rho', 30)]"
       ]
      },
-     "execution_count": 20,
+     "execution_count": 18,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1426,34 +1364,25 @@
     "\n",
     "<center><img src=\"https://github.com/umddb/cmsc424-fall2016/raw/master/project0/joins.jpg\" width=600px></center>"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 2",
+   "display_name": "Python 3",
    "language": "python",
-   "name": "python2"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
-    "version": 2
+    "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.6"
+   "pygments_lexer": "ipython3",
+   "version": "3.6.2"
   }
  },
  "nbformat": 4,
diff --git a/jupyter/04-SQL-NULLs-and-UNKNOWN.ipynb b/jupyter/04-SQL-NULLs-and-UNKNOWN.ipynb
index e3fa547..5a71856 100644
--- a/jupyter/04-SQL-NULLs-and-UNKNOWN.ipynb
+++ b/jupyter/04-SQL-NULLs-and-UNKNOWN.ipynb
@@ -11,32 +11,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [
-    {
-     "name": "stderr",
-     "output_type": "stream",
-     "text": [
-      "/usr/local/lib/python2.7/dist-packages/IPython/config.py:13: ShimWarning: The `IPython.config` package has been deprecated. You should import from traitlets.config instead.\n",
-      "  \"You should import from traitlets.config instead.\", ShimWarning)\n",
-      "/usr/local/lib/python2.7/dist-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package.\n",
-      "  warn(\"IPython.utils.traitlets has moved to a top-level traitlets package.\")\n"
-     ]
-    },
-    {
-     "data": {
-      "text/plain": [
-       "u'Connected: vagrant@university'"
-      ]
-     },
-     "execution_count": 1,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
    "source": [
     "%load_ext sql\n",
     "%sql postgresql://vagrant:vagrant@localhost/university"
@@ -45,9 +22,7 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -120,9 +95,7 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -198,9 +171,7 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -272,7 +243,6 @@
    "cell_type": "code",
    "execution_count": 5,
    "metadata": {
-    "collapsed": false,
     "scrolled": true
    },
    "outputs": [
@@ -320,9 +290,7 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -357,9 +325,7 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -409,9 +375,7 @@
   {
    "cell_type": "code",
    "execution_count": 8,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -466,9 +430,7 @@
   {
    "cell_type": "code",
    "execution_count": 9,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -490,7 +452,7 @@
        "</table>"
       ],
       "text/plain": [
-       "[(6L,)]"
+       "[(6,)]"
       ]
      },
      "execution_count": 9,
@@ -505,9 +467,7 @@
   {
    "cell_type": "code",
    "execution_count": 10,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -529,7 +489,7 @@
        "</table>"
       ],
       "text/plain": [
-       "[(4L,)]"
+       "[(4,)]"
       ]
      },
      "execution_count": 10,
@@ -545,9 +505,7 @@
   {
    "cell_type": "code",
    "execution_count": 11,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -572,7 +530,7 @@
        "</table>"
       ],
       "text/plain": [
-       "[(2L,)]"
+       "[(2,)]"
       ]
      },
      "execution_count": 11,
@@ -591,9 +549,7 @@
   {
    "cell_type": "code",
    "execution_count": 12,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -615,7 +571,7 @@
        "</table>"
       ],
       "text/plain": [
-       "[(50L,)]"
+       "[(50,)]"
       ]
      },
      "execution_count": 12,
@@ -631,9 +587,7 @@
   {
    "cell_type": "code",
    "execution_count": 13,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -680,9 +634,7 @@
   {
    "cell_type": "code",
    "execution_count": 14,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -714,7 +666,7 @@
        "</table>"
       ],
       "text/plain": [
-       "[(None, 50L), (20, None), (10, 30L)]"
+       "[(None, 50), (20, None), (10, 30)]"
       ]
      },
      "execution_count": 14,
@@ -735,10 +687,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 16,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -770,10 +720,10 @@
        "</table>"
       ],
       "text/plain": [
-       "[(None, 2L), (20, 1L), (10, 3L)]"
+       "[(None, 2), (20, 1), (10, 3)]"
       ]
      },
-     "execution_count": 15,
+     "execution_count": 16,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -791,9 +741,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
+   "execution_count": 17,
    "metadata": {
-    "collapsed": false,
     "scrolled": true
    },
    "outputs": [
@@ -832,7 +781,7 @@
        " (10, Decimal('15.0000000000000000'))]"
       ]
      },
-     "execution_count": 16,
+     "execution_count": 17,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -853,10 +802,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 18,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -899,7 +846,7 @@
        "[(10, 10, 10, None), (10, 20, 10, None), (10, None, 10, None)]"
       ]
      },
-     "execution_count": 17,
+     "execution_count": 18,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -917,10 +864,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 19,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -1021,7 +966,7 @@
        " (20, None, None, None)]"
       ]
      },
-     "execution_count": 18,
+     "execution_count": 19,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1029,34 +974,25 @@
    "source": [
     "%sql select * from R, S where R.i = S.i or R.i is null or S.i is null;"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 2",
+   "display_name": "Python 3",
    "language": "python",
-   "name": "python2"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
-    "version": 2
+    "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.6"
+   "pygments_lexer": "ipython3",
+   "version": "3.6.2"
   }
  },
  "nbformat": 4,
diff --git a/jupyter/05-Basic-Relational-Algebra.ipynb b/jupyter/05-Basic-Relational-Algebra.ipynb
index 57705e8..f57d6d4 100644
--- a/jupyter/05-Basic-Relational-Algebra.ipynb
+++ b/jupyter/05-Basic-Relational-Algebra.ipynb
@@ -14,9 +14,7 @@
   {
    "cell_type": "code",
    "execution_count": 1,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [],
    "source": [
     "import sys\n",
@@ -34,9 +32,7 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -73,9 +69,7 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -109,9 +103,7 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -143,9 +135,7 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -179,9 +169,7 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -207,9 +195,7 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -233,9 +219,7 @@
   {
    "cell_type": "code",
    "execution_count": 8,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -268,9 +252,7 @@
   {
    "cell_type": "code",
    "execution_count": 9,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -303,9 +285,7 @@
   {
    "cell_type": "code",
    "execution_count": 10,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -325,34 +305,25 @@
     "r4 = join(r, s, \"r.C\", \"==\", \"s.C\")\n",
     "DisplayMultipleTables([r, s, r4])"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 2",
+   "display_name": "Python 3",
    "language": "python",
-   "name": "python2"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
-    "version": 2
+    "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.6"
+   "pygments_lexer": "ipython3",
+   "version": "3.6.2"
   }
  },
  "nbformat": 4,
diff --git a/jupyter/06-SQL-INDEXES-AND-EXPLAIN.ipynb b/jupyter/06-SQL-INDEXES-AND-EXPLAIN.ipynb
index 9080e39..9196c93 100644
--- a/jupyter/06-SQL-INDEXES-AND-EXPLAIN.ipynb
+++ b/jupyter/06-SQL-INDEXES-AND-EXPLAIN.ipynb
@@ -21,30 +21,9 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
-   "metadata": {
-    "collapsed": false
-   },
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "The sql extension is already loaded. To reload it, use:\n",
-      "  %reload_ext sql\n"
-     ]
-    },
-    {
-     "data": {
-      "text/plain": [
-       "u'Connected: vagrant@university'"
-      ]
-     },
-     "execution_count": 20,
-     "metadata": {},
-     "output_type": "execute_result"
-    }
-   ],
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
    "source": [
     "%load_ext sql\n",
     "%sql postgresql://vagrant:vagrant@localhost/university"
@@ -59,10 +38,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 2,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -77,7 +54,7 @@
        "[]"
       ]
      },
-     "execution_count": 5,
+     "execution_count": 2,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -106,10 +83,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 22,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 3,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -126,31 +101,31 @@
        "        <th>QUERY PLAN</th>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>Hash Join  (cost=2.12..8.88 rows=200 width=180)</td>\n",
+       "        <td>Hash Join  (cost=1.27..15.86 rows=19 width=318)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>&nbsp;&nbsp;Hash Cond: ((course.dept_name)::text = (instructor.dept_name)::text)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;-&gt;  Seq Scan on course  (cost=0.00..4.00 rows=200 width=35)</td>\n",
+       "        <td>&nbsp;&nbsp;-&gt;  Seq Scan on course  (cost=0.00..13.20 rows=320 width=222)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;-&gt;  Hash  (cost=1.50..1.50 rows=50 width=154)</td>\n",
+       "        <td>&nbsp;&nbsp;-&gt;  Hash  (cost=1.12..1.12 rows=12 width=154)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on instructor  (cost=0.00..1.50 rows=50 width=154)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on instructor  (cost=0.00..1.12 rows=12 width=154)</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(u'Hash Join  (cost=2.12..8.88 rows=200 width=180)',),\n",
-       " (u'  Hash Cond: ((course.dept_name)::text = (instructor.dept_name)::text)',),\n",
-       " (u'  ->  Seq Scan on course  (cost=0.00..4.00 rows=200 width=35)',),\n",
-       " (u'  ->  Hash  (cost=1.50..1.50 rows=50 width=154)',),\n",
-       " (u'        ->  Seq Scan on instructor  (cost=0.00..1.50 rows=50 width=154)',)]"
+       "[('Hash Join  (cost=1.27..15.86 rows=19 width=318)',),\n",
+       " ('  Hash Cond: ((course.dept_name)::text = (instructor.dept_name)::text)',),\n",
+       " ('  ->  Seq Scan on course  (cost=0.00..13.20 rows=320 width=222)',),\n",
+       " ('  ->  Hash  (cost=1.12..1.12 rows=12 width=154)',),\n",
+       " ('        ->  Seq Scan on instructor  (cost=0.00..1.12 rows=12 width=154)',)]"
       ]
      },
-     "execution_count": 22,
+     "execution_count": 3,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -181,10 +156,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 4,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -201,19 +174,19 @@
        "        <th>QUERY PLAN</th>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>Seq Scan on instructor  (cost=0.00..1.62 rows=1 width=154)</td>\n",
+       "        <td>Seq Scan on instructor  (cost=0.00..1.15 rows=1 width=154)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;Filter: ((id)::text = '4034'::text)</td>\n",
+       "        <td>&nbsp;&nbsp;Filter: ((id)::text = &#x27;4034&#x27;::text)</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(u'Seq Scan on instructor  (cost=0.00..1.62 rows=1 width=154)',),\n",
-       " (u\"  Filter: ((id)::text = '4034'::text)\",)]"
+       "[('Seq Scan on instructor  (cost=0.00..1.15 rows=1 width=154)',),\n",
+       " (\"  Filter: ((id)::text = '4034'::text)\",)]"
       ]
      },
-     "execution_count": 9,
+     "execution_count": 4,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -233,10 +206,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 5,
+   "metadata": {},
    "outputs": [],
    "source": [
     "%%capture v\n",
@@ -247,10 +218,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 6,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -265,7 +234,7 @@
        "[]"
       ]
      },
-     "execution_count": 20,
+     "execution_count": 6,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -276,10 +245,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 21,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 7,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -304,11 +271,11 @@
        "</table>"
       ],
       "text/plain": [
-       "[(u'Index Scan using large_i_index on large  (cost=0.29..8.30 rows=1 width=8)',),\n",
-       " (u'  Index Cond: (i = 500)',)]"
+       "[('Index Scan using large_i_index on large  (cost=0.29..8.30 rows=1 width=8)',),\n",
+       " ('  Index Cond: (i = 500)',)]"
       ]
      },
-     "execution_count": 21,
+     "execution_count": 7,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -333,16 +300,14 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 8,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "9 rows affected.\n"
+      "10 rows affected.\n"
      ]
     },
     {
@@ -353,7 +318,7 @@
        "        <th>QUERY PLAN</th>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>CTE Scan on temp  (cost=1200.00..1245.00 rows=667 width=90)</td>\n",
+       "        <td>CTE Scan on temp  (cost=48.14..58.26 rows=150 width=90)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>&nbsp;&nbsp;Filter: (c &gt; 25)</td>\n",
@@ -362,38 +327,42 @@
        "        <td>&nbsp;&nbsp;CTE temp</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  HashAggregate  (cost=1180.00..1200.00 rows=2000 width=15)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  HashAggregate  (cost=43.64..48.14 rows=450 width=90)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Hash Join  (cost=60.00..1030.00 rows=30000 width=15)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Group Key: s.id</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Hash Join  (cost=20.12..41.29 rows=470 width=116)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hash Cond: ((t.id)::text = (s.id)::text)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on takes t  (cost=0.00..520.00 rows=30000 width=9)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on takes t  (cost=0.00..14.70 rows=470 width=58)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Hash  (cost=35.00..35.00 rows=2000 width=11)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Hash  (cost=14.50..14.50 rows=450 width=82)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on student s  (cost=0.00..35.00 rows=2000 width=11)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on student s  (cost=0.00..14.50 rows=450 width=82)</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(u'CTE Scan on temp  (cost=1200.00..1245.00 rows=667 width=90)',),\n",
-       " (u'  Filter: (c > 25)',),\n",
-       " (u'  CTE temp',),\n",
-       " (u'    ->  HashAggregate  (cost=1180.00..1200.00 rows=2000 width=15)',),\n",
-       " (u'          ->  Hash Join  (cost=60.00..1030.00 rows=30000 width=15)',),\n",
-       " (u'                Hash Cond: ((t.id)::text = (s.id)::text)',),\n",
-       " (u'                ->  Seq Scan on takes t  (cost=0.00..520.00 rows=30000 width=9)',),\n",
-       " (u'                ->  Hash  (cost=35.00..35.00 rows=2000 width=11)',),\n",
-       " (u'                      ->  Seq Scan on student s  (cost=0.00..35.00 rows=2000 width=11)',)]"
+       "[('CTE Scan on temp  (cost=48.14..58.26 rows=150 width=90)',),\n",
+       " ('  Filter: (c > 25)',),\n",
+       " ('  CTE temp',),\n",
+       " ('    ->  HashAggregate  (cost=43.64..48.14 rows=450 width=90)',),\n",
+       " ('          Group Key: s.id',),\n",
+       " ('          ->  Hash Join  (cost=20.12..41.29 rows=470 width=116)',),\n",
+       " ('                Hash Cond: ((t.id)::text = (s.id)::text)',),\n",
+       " ('                ->  Seq Scan on takes t  (cost=0.00..14.70 rows=470 width=58)',),\n",
+       " ('                ->  Hash  (cost=14.50..14.50 rows=450 width=82)',),\n",
+       " ('                      ->  Seq Scan on student s  (cost=0.00..14.50 rows=450 width=82)',)]"
       ]
      },
-     "execution_count": 16,
+     "execution_count": 8,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -447,16 +416,14 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 24,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 9,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "7 rows affected.\n"
+      "8 rows affected.\n"
      ]
     },
     {
@@ -467,39 +434,43 @@
        "        <th>QUERY PLAN</th>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>Hash Join  (cost=2.12..8.88 rows=200 width=180) (actual time=0.029..0.145 rows=483 loops=1)</td>\n",
+       "        <td>Hash Join  (cost=1.27..15.86 rows=19 width=318) (actual time=0.051..0.117 rows=26 loops=1)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "        <td>&nbsp;&nbsp;Hash Cond: ((course.dept_name)::text = (instructor.dept_name)::text)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;-&gt;  Seq Scan on course  (cost=0.00..4.00 rows=200 width=35) (actual time=0.005..0.015 rows=200 loops=1)</td>\n",
+       "        <td>&nbsp;&nbsp;-&gt;  Seq Scan on course  (cost=0.00..13.20 rows=320 width=222) (actual time=0.017..0.018 rows=13 loops=1)</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "        <td>&nbsp;&nbsp;-&gt;  Hash  (cost=1.12..1.12 rows=12 width=154) (actual time=0.019..0.019 rows=12 loops=1)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;-&gt;  Hash  (cost=1.50..1.50 rows=50 width=154) (actual time=0.018..0.018 rows=50 loops=1)</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Buckets: 1024  Batches: 1  Memory Usage: 9kB</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Buckets: 1024  Batches: 1  Memory Usage: 4kB</td>\n",
+       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on instructor  (cost=0.00..1.12 rows=12 width=154) (actual time=0.004..0.006 rows=12 loops=1)</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt;  Seq Scan on instructor  (cost=0.00..1.50 rows=50 width=154) (actual time=0.002..0.009 rows=50 loops=1)</td>\n",
+       "        <td>Planning time: 0.227 ms</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>Total runtime: 0.169 ms</td>\n",
+       "        <td>Execution time: 0.157 ms</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(u'Hash Join  (cost=2.12..8.88 rows=200 width=180) (actual time=0.029..0.145 rows=483 loops=1)',),\n",
-       " (u'  Hash Cond: ((course.dept_name)::text = (instructor.dept_name)::text)',),\n",
-       " (u'  ->  Seq Scan on course  (cost=0.00..4.00 rows=200 width=35) (actual time=0.005..0.015 rows=200 loops=1)',),\n",
-       " (u'  ->  Hash  (cost=1.50..1.50 rows=50 width=154) (actual time=0.018..0.018 rows=50 loops=1)',),\n",
-       " (u'        Buckets: 1024  Batches: 1  Memory Usage: 4kB',),\n",
-       " (u'        ->  Seq Scan on instructor  (cost=0.00..1.50 rows=50 width=154) (actual time=0.002..0.009 rows=50 loops=1)',),\n",
-       " (u'Total runtime: 0.169 ms',)]"
+       "[('Hash Join  (cost=1.27..15.86 rows=19 width=318) (actual time=0.051..0.117 rows=26 loops=1)',),\n",
+       " ('  Hash Cond: ((course.dept_name)::text = (instructor.dept_name)::text)',),\n",
+       " ('  ->  Seq Scan on course  (cost=0.00..13.20 rows=320 width=222) (actual time=0.017..0.018 rows=13 loops=1)',),\n",
+       " ('  ->  Hash  (cost=1.12..1.12 rows=12 width=154) (actual time=0.019..0.019 rows=12 loops=1)',),\n",
+       " ('        Buckets: 1024  Batches: 1  Memory Usage: 9kB',),\n",
+       " ('        ->  Seq Scan on instructor  (cost=0.00..1.12 rows=12 width=154) (actual time=0.004..0.006 rows=12 loops=1)',),\n",
+       " ('Planning time: 0.227 ms',),\n",
+       " ('Execution time: 0.157 ms',)]"
       ]
      },
-     "execution_count": 24,
+     "execution_count": 9,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -521,10 +492,8 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 26,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 10,
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -541,15 +510,15 @@
        "        <th>count</th>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "        <td>483</td>\n",
+       "        <td>26</td>\n",
        "    </tr>\n",
        "</table>"
       ],
       "text/plain": [
-       "[(483L,)]"
+       "[(26,)]"
       ]
      },
-     "execution_count": 26,
+     "execution_count": 10,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -557,34 +526,25 @@
    "source": [
     "%sql select count(*) from instructor natural join course;"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 2",
+   "display_name": "Python 3",
    "language": "python",
-   "name": "python2"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
-    "version": 2
+    "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.6"
+   "pygments_lexer": "ipython3",
+   "version": "3.6.2"
   }
  },
  "nbformat": 4,
diff --git a/jupyter/07-Relational-Database-Design-Normalization.ipynb b/jupyter/07-Relational-Database-Design-Normalization.ipynb
index 02b5eab..073e104 100644
--- a/jupyter/07-Relational-Database-Design-Normalization.ipynb
+++ b/jupyter/07-Relational-Database-Design-Normalization.ipynb
@@ -19,10 +19,13 @@
   {
    "cell_type": "code",
    "execution_count": 1,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "from itertools import chain, combinations\n",
+    "from functools import cmp_to_key\n",
     "\n",
     "# A class to encapsulate a Functional Dependency, and some helper functions\n",
     "class FD:\n",
@@ -37,13 +40,20 @@
     "                return hash(self.lhs) * hash(self.rhs)\n",
     "        def isTrivial(self):\n",
     "                \"\"\"A functional dependency is trivial if the right hand side is a subset of the left h.s.\"\"\"\n",
-    "                return self.lhs >= self.rhs\n"
+    "                return self.lhs >= self.rhs\n",
+    "\n",
+    "            \n",
+    "# implement the old-school cmp in python3 \n",
+    "def cmp(a,b):\n",
+    "    return (a > b) - (a < b)"
    ]
   },
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# The following is not really needed for normalization, but may be useful to get intuitions about FDs\n",
@@ -116,7 +126,9 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "# We need to construct powersets quite frequently.\n",
@@ -135,7 +147,9 @@
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def applyreflexivity(R):\n",
@@ -154,7 +168,9 @@
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def applyaugmentation(F, PW, printflag):\n",
@@ -177,7 +193,9 @@
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def applytransitivity(F, printflag):\n",
@@ -199,7 +217,9 @@
   {
    "cell_type": "code",
    "execution_count": 8,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def findClosure(R, F, printflag = False):\n",
@@ -243,7 +263,7 @@
     "        \"\"\"Candidate keys are minimal -- go over the keys increasing order by size, and add if no subset is present\"\"\"\n",
     "        keys = findKeys(R, FClosure)\n",
     "        ckeys = set()\n",
-    "        for k in sorted(keys, lambda x, y: cmp(len(x), len(y))):\n",
+    "        for k in sorted(keys, key=cmp_to_key(lambda x,y: cmp(len(x), len(y)))):\n",
     "                dontadd = False\n",
     "                for ck in ckeys:\n",
     "                        if(ck <= k):\n",
@@ -283,7 +303,7 @@
     "\n",
     "def findSmallestViolatingFD(R, FClosure, keys):\n",
     "        \"\"\"Same as above, but finds a small FD that violates\"\"\"\n",
-    "        for fd in sorted(FClosure, lambda x, y: cmp( (len(x.lhs), len(x.rhs)), (len(y.lhs), len(y.rhs)))):\n",
+    "        for fd in sorted(FClosure, key=cmp_to_key(lambda x,y: cmp( (len(x.lhs), len(x.rhs)), (len(y.lhs), len(y.rhs))))):\n",
     "                if (not fd.isTrivial()) and (fd.lhs not in keys):\n",
     "                        return fd"
    ]
@@ -299,7 +319,9 @@
   {
    "cell_type": "code",
    "execution_count": 11,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "def DecomposeUsingFD(R, FClosure, fd):\n",
@@ -344,8 +366,10 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
-   "metadata": {},
+   "execution_count": 12,
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": [
     "R = \"ABCD\"\n",
@@ -361,90 +385,90 @@
      "name": "stdout",
      "output_type": "stream",
      "text": [
-      "D -> DB\n",
-      "DCA -> DBA\n",
-      "CA -> BCA\n",
+      "CB -> DA\n",
+      "CDA -> B\n",
+      "A -> B\n",
+      "CA -> CB\n",
+      "CB -> CA\n",
+      "DC -> CDB\n",
       "CB -> A\n",
-      "D -> B\n",
-      "DCA -> BCA\n",
-      "BCA -> DCA\n",
-      "BCA -> DB\n",
-      "CB -> DBA\n",
-      "DC -> DBCA\n",
-      "ACB -> D\n",
+      "D -> DBA\n",
+      "CBA -> DB\n",
+      "CDA -> CBA\n",
+      "CBA -> DAC\n",
+      "CA -> D\n",
+      "CDB -> A\n",
+      "DC -> CB\n",
+      "CB -> DC\n",
+      "CDA -> CDB\n",
+      "CDB -> CDA\n",
+      "CA -> DCA\n",
+      "CBA -> DBAC\n",
       "D -> DA\n",
-      "DA -> B\n",
-      "DCB -> DCA\n",
-      "DCA -> DCB\n",
-      "DB -> A\n",
-      "DCB -> DAB\n",
-      "DC -> A\n",
-      "DC -> DB\n",
-      "DC -> AB\n",
-      "DCB -> DA\n",
-      "CB -> DB\n",
-      "BCA -> DAB\n",
-      "DCA -> BA\n",
+      "DC -> B\n",
+      "CA -> CBA\n",
       "DA -> BA\n",
-      "CB -> ACB\n",
-      "CB -> CA\n",
-      "CA -> CB\n",
-      "DC -> DCB\n",
-      "CA -> BA\n",
-      "DA -> DBA\n",
-      "BCA -> DA\n",
-      "D -> DBA\n",
+      "CA -> DBCA\n",
+      "CD -> A\n",
+      "CBA -> DC\n",
+      "DC -> CBA\n",
+      "D -> BA\n",
+      "CDA -> BA\n",
+      "DC -> BA\n",
+      "CA -> DBA\n",
+      "DC -> DB\n",
+      "D -> DB\n",
+      "CB -> DBA\n",
       "CA -> B\n",
-      "CB -> D\n",
-      "DCB -> ACB\n",
-      "BCA -> DCB\n",
-      "CB -> DA\n",
-      "DC -> B\n",
-      "DCB -> A\n",
-      "DC -> DA\n",
-      "BCA -> DC\n",
-      "DC -> BCA\n",
-      "DB -> AB\n",
-      "DB -> DAB\n",
-      "CB -> DCB\n",
-      "CA -> DB\n",
-      "CA -> DCA\n",
-      "DCA -> DB\n",
+      "CB -> DB\n",
+      "CDA -> CDBA\n",
+      "CDB -> DA\n",
       "D -> A\n",
-      "CA -> D\n",
-      "DCA -> CB\n",
-      "CB -> DCA\n",
+      "DC -> CDA\n",
+      "DB -> BA\n",
+      "CB -> CBA\n",
+      "CB -> DBCA\n",
+      "DA -> B\n",
       "DA -> DB\n",
-      "DC -> DCA\n",
       "DB -> DA\n",
-      "A -> B\n",
-      "DCA -> DBCA\n",
-      "CA -> DBA\n",
-      "DCB -> DACB\n",
-      "D -> BA\n",
-      "BCA -> DACB\n",
-      "CA -> DBCA\n",
-      "CB -> AB\n",
+      "CA -> BA\n",
+      "CD -> DA\n",
+      "CDA -> DBA\n",
+      "D -> B\n",
+      "CBA -> DBA\n",
+      "DB -> DBA\n",
+      "CDA -> DB\n",
+      "DBC -> CBA\n",
+      "CDB -> CA\n",
+      "CBA -> DBC\n",
+      "CA -> DBC\n",
+      "DB -> A\n",
+      "CA -> DB\n",
+      "DC -> CDBA\n",
+      "CB -> BA\n",
+      "DA -> DBA\n",
+      "CB -> DBC\n",
       "A -> BA\n",
-      "DC -> CB\n",
-      "CB -> DC\n",
-      "CB -> DBCA\n",
-      "CA -> DA\n",
-      "DCB -> CA\n",
-      "CA -> DCB\n",
-      "DCA -> B\n",
+      "DC -> DBA\n",
+      "CBA -> D\n",
+      "DBC -> CDBA\n",
       "DC -> CA\n",
-      "DCB -> AB\n",
       "CA -> DC\n",
-      "DC -> DBA\n",
+      "CB -> D\n",
+      "CDB -> BA\n",
+      "CBA -> DA\n",
+      "CDB -> DBA\n",
+      "CA -> DA\n",
+      "CDA -> CB\n",
+      "CB -> CDA\n",
       "Keys are:\n",
-      "BCA\n",
-      "CA\n",
-      "DBCA\n",
-      "DCB\n",
+      "DBC\n",
       "CB\n",
-      "DCA\n",
-      "DC\n"
+      "DC\n",
+      "CDBA\n",
+      "CA\n",
+      "CBA\n",
+      "CDA\n"
      ]
     }
    ],
@@ -472,44 +496,67 @@
    "metadata": {},
    "outputs": [
     {
-     "ename": "TypeError",
-     "evalue": "must use keyword argument for key function",
-     "output_type": "error",
-     "traceback": [
-      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
-      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
-      "\u001b[0;32m<ipython-input-14-f976dc9cf4d4>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mcandidatekeys\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfindCandidateKeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mFclosure\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      2\u001b[0m \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"Candidate Keys are:\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcandidatekeys\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      4\u001b[0m         \u001b[0mprint\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m\"\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
-      "\u001b[0;32m<ipython-input-9-3a26a87149f6>\u001b[0m in \u001b[0;36mfindCandidateKeys\u001b[0;34m(R, FClosure)\u001b[0m\n\u001b[1;32m      7\u001b[0m         \u001b[0mkeys\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfindKeys\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mR\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mFClosure\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      8\u001b[0m         \u001b[0mckeys\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 9\u001b[0;31m         \u001b[0;32mfor\u001b[0m \u001b[0mk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0msorted\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mlambda\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mcmp\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0my\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     10\u001b[0m                 \u001b[0mdontadd\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     11\u001b[0m                 \u001b[0;32mfor\u001b[0m \u001b[0mck\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mckeys\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
-      "\u001b[0;31mTypeError\u001b[0m: must use keyword argument for key function"
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Candidate Keys are:\n",
+      "CA\n",
+      "CB\n",
+      "DC\n"
      ]
     }
    ],
    "source": [
     "candidatekeys = findCandidateKeys(R, Fclosure)\n",
-    "print (\"Candidate Keys are:\")\n",
+    "print(\"Candidate Keys are:\")\n",
     "for i in candidatekeys:\n",
-    "        print (\"\".join(i))"
+    "        print(\"\".join(i))"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 16,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Checking if the schema is in BCNF\n",
+      "Decomposing using B -> C into relations CB and DBA\n"
+     ]
+    }
+   ],
    "source": [
     "print (\"Checking if the schema is in BCNF\")\n",
     "if isInBCNF(R, Fclosure, keys):\n",
     "        print (\"The schema is in BCNF\")\n",
     "\n",
     "(R1, R2, F1Closure, F2Closure) = DecomposeUsingFD(R, Fclosure, FD('B', 'C'))\n",
-    "print \"Decomposing using \" + str(FD('B', 'C')) + \" into relations \" + \"\".join(R1) + \" and \" + \"\".join(R2)"
+    "print(\"Decomposing using \" + str(FD('B', 'C')) + \" into relations \" + \"\".join(R1) + \" and \" + \"\".join(R2))"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 17,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "-------------- Doing a full BCNF Decompisition -------\n",
+      "ABCD is not in BCNF\n",
+      "Decomposing ABCD using A -> B into relations BA and CDA\n",
+      "BA is in BCNF\n",
+      "CDA is not in BCNF\n",
+      "Decomposing CDA using D -> A into relations DA and CD\n",
+      "DA is in BCNF\n",
+      "CD is in BCNF\n",
+      "------------------------------------------------------\n"
+     ]
+    }
+   ],
    "source": [
     "print (\"-------------- Doing a full BCNF Decompisition -------\")\n",
     "BCNFDecomposition(R, Fclosure)\n",
@@ -526,9 +573,34 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 18,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Candidate Keys are:\n",
+      "DE\n",
+      "Checking if the schema is in BCNF\n",
+      "-------------- NO: Doing a full BCNF Decompisition -------\n",
+      "ABCDEH is not in BCNF\n",
+      "Decomposing ABCDEH using A -> B into relations BA and CADEH\n",
+      "BA is in BCNF\n",
+      "CADEH is not in BCNF\n",
+      "Decomposing CADEH using E -> A into relations EA and CDEH\n",
+      "EA is in BCNF\n",
+      "CDEH is not in BCNF\n",
+      "Decomposing CDEH using E -> H into relations EH and CDE\n",
+      "EH is in BCNF\n",
+      "CDE is not in BCNF\n",
+      "Decomposing CDE using E -> C into relations CE and DE\n",
+      "CE is in BCNF\n",
+      "DE is in BCNF\n",
+      "------------------------------------------------------\n"
+     ]
+    }
+   ],
    "source": [
     "R2 = \"ABCDEH\"\n",
     "F2 = {FD('A', 'BC'), FD('E', 'HA')}\n",
@@ -557,165 +629,176 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 19,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "JKL is not in BCNF\n",
+      "Decomposing JKL using L -> K into relations KL and JL\n",
+      "KL is in BCNF\n",
+      "JL is in BCNF\n"
+     ]
+    }
+   ],
    "source": [
     "BCNFDecomposition(\"JKL\", findClosure(\"JKL\", {FD('JK', 'L'), FD('L', 'K')}))"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
+   "execution_count": 20,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "{<__main__.FD at 0x7f765c969588>,\n",
-       " <__main__.FD at 0x7f765c969d30>,\n",
-       " <__main__.FD at 0x7f765c969390>,\n",
-       " <__main__.FD at 0x7f765d1c5898>,\n",
-       " <__main__.FD at 0x7f765c964198>,\n",
-       " <__main__.FD at 0x7f765c9695f8>,\n",
-       " <__main__.FD at 0x7f765c969470>,\n",
-       " <__main__.FD at 0x7f765c964e10>,\n",
-       " <__main__.FD at 0x7f765c9647f0>,\n",
-       " <__main__.FD at 0x7f7660ab2b38>,\n",
-       " <__main__.FD at 0x7f765c9691d0>,\n",
-       " <__main__.FD at 0x7f765d1c5ef0>,\n",
-       " <__main__.FD at 0x7f765c969898>,\n",
-       " <__main__.FD at 0x7f765c964470>,\n",
-       " <__main__.FD at 0x7f765c964748>,\n",
-       " <__main__.FD at 0x7f7660a59f60>,\n",
-       " <__main__.FD at 0x7f765c969b70>,\n",
-       " <__main__.FD at 0x7f765c9852b0>,\n",
-       " <__main__.FD at 0x7f765c9692e8>,\n",
-       " <__main__.FD at 0x7f765d1c5400>,\n",
-       " <__main__.FD at 0x7f765c969128>,\n",
-       " <__main__.FD at 0x7f7660ab2f98>,\n",
-       " <__main__.FD at 0x7f765c969710>,\n",
-       " <__main__.FD at 0x7f765c969630>,\n",
-       " <__main__.FD at 0x7f765c969208>,\n",
-       " <__main__.FD at 0x7f765c964400>,\n",
-       " <__main__.FD at 0x7f765d1c5748>,\n",
-       " <__main__.FD at 0x7f765c9644e0>,\n",
-       " <__main__.FD at 0x7f765c969438>,\n",
-       " <__main__.FD at 0x7f765c9690b8>,\n",
-       " <__main__.FD at 0x7f765c969278>,\n",
-       " <__main__.FD at 0x7f7660ab2a90>,\n",
-       " <__main__.FD at 0x7f765d1c5550>,\n",
-       " <__main__.FD at 0x7f7660ab26d8>,\n",
-       " <__main__.FD at 0x7f765c964f28>,\n",
-       " <__main__.FD at 0x7f7660a59860>,\n",
-       " <__main__.FD at 0x7f765d1c56a0>,\n",
-       " <__main__.FD at 0x7f765c9641d0>,\n",
-       " <__main__.FD at 0x7f765c964828>,\n",
-       " <__main__.FD at 0x7f765c964048>,\n",
-       " <__main__.FD at 0x7f765d1c58d0>,\n",
-       " <__main__.FD at 0x7f765c969940>,\n",
-       " <__main__.FD at 0x7f765d1c5be0>,\n",
-       " <__main__.FD at 0x7f765d1c5940>,\n",
-       " <__main__.FD at 0x7f765c9645c0>,\n",
-       " <__main__.FD at 0x7f765c9696d8>,\n",
-       " <__main__.FD at 0x7f765d1c5dd8>,\n",
-       " <__main__.FD at 0x7f765c9640f0>,\n",
-       " <__main__.FD at 0x7f765c9694e0>,\n",
-       " <__main__.FD at 0x7f765c9692b0>,\n",
-       " <__main__.FD at 0x7f765d1c5e80>,\n",
-       " <__main__.FD at 0x7f765c969e10>,\n",
-       " <__main__.FD at 0x7f765c969080>,\n",
-       " <__main__.FD at 0x7f765c9697b8>,\n",
-       " <__main__.FD at 0x7f765c969f98>,\n",
-       " <__main__.FD at 0x7f765c9694a8>,\n",
-       " <__main__.FD at 0x7f7660ab2f60>,\n",
-       " <__main__.FD at 0x7f765c964da0>,\n",
-       " <__main__.FD at 0x7f765c94de80>,\n",
-       " <__main__.FD at 0x7f7660ab2c50>,\n",
-       " <__main__.FD at 0x7f765c964550>,\n",
-       " <__main__.FD at 0x7f765c969c88>,\n",
-       " <__main__.FD at 0x7f7660a59e80>,\n",
-       " <__main__.FD at 0x7f765c969550>,\n",
-       " <__main__.FD at 0x7f765c969a20>,\n",
-       " <__main__.FD at 0x7f765c964940>,\n",
-       " <__main__.FD at 0x7f765c969908>,\n",
-       " <__main__.FD at 0x7f765d1c52b0>,\n",
-       " <__main__.FD at 0x7f765c964ef0>,\n",
-       " <__main__.FD at 0x7f765c9644a8>,\n",
-       " <__main__.FD at 0x7f765c985278>,\n",
-       " <__main__.FD at 0x7f765c969cf8>,\n",
-       " <__main__.FD at 0x7f765c969320>,\n",
-       " <__main__.FD at 0x7f765c969668>,\n",
-       " <__main__.FD at 0x7f765c969cc0>,\n",
-       " <__main__.FD at 0x7f7660ab29b0>,\n",
-       " <__main__.FD at 0x7f7660ab27b8>,\n",
-       " <__main__.FD at 0x7f765c969828>,\n",
-       " <__main__.FD at 0x7f765c9696a0>,\n",
-       " <__main__.FD at 0x7f765c969240>,\n",
-       " <__main__.FD at 0x7f765c9695c0>,\n",
-       " <__main__.FD at 0x7f765c964278>,\n",
-       " <__main__.FD at 0x7f765d1c5240>,\n",
-       " <__main__.FD at 0x7f765c9697f0>,\n",
-       " <__main__.FD at 0x7f765d1c5f28>,\n",
-       " <__main__.FD at 0x7f765c9640b8>,\n",
-       " <__main__.FD at 0x7f765c94d4a8>,\n",
-       " <__main__.FD at 0x7f765d1c5860>,\n",
-       " <__main__.FD at 0x7f765c969c18>,\n",
-       " <__main__.FD at 0x7f765c969358>,\n",
-       " <__main__.FD at 0x7f765c969978>,\n",
-       " <__main__.FD at 0x7f765c964668>,\n",
-       " <__main__.FD at 0x7f765c985160>,\n",
-       " <__main__.FD at 0x7f765c9693c8>,\n",
-       " <__main__.FD at 0x7f765c969a58>,\n",
-       " <__main__.FD at 0x7f765c969780>,\n",
-       " <__main__.FD at 0x7f765c964f98>,\n",
-       " <__main__.FD at 0x7f765c969748>,\n",
-       " <__main__.FD at 0x7f7660ab2828>,\n",
-       " <__main__.FD at 0x7f765c964e48>,\n",
-       " <__main__.FD at 0x7f765c94d160>,\n",
-       " <__main__.FD at 0x7f765c9698d0>,\n",
-       " <__main__.FD at 0x7f765c969ba8>,\n",
-       " <__main__.FD at 0x7f7660ab2fd0>,\n",
-       " <__main__.FD at 0x7f765c969d68>,\n",
-       " <__main__.FD at 0x7f765d1c5438>,\n",
-       " <__main__.FD at 0x7f765c969160>,\n",
-       " <__main__.FD at 0x7f7660ab2c18>,\n",
-       " <__main__.FD at 0x7f765d1c5518>,\n",
-       " <__main__.FD at 0x7f7660ab28d0>,\n",
-       " <__main__.FD at 0x7f7660ab2e80>,\n",
-       " <__main__.FD at 0x7f765c964898>,\n",
-       " <__main__.FD at 0x7f765c969ac8>,\n",
-       " <__main__.FD at 0x7f765c964fd0>,\n",
-       " <__main__.FD at 0x7f765d1c5c50>,\n",
-       " <__main__.FD at 0x7f765c969048>,\n",
-       " <__main__.FD at 0x7f765c969518>,\n",
-       " <__main__.FD at 0x7f765c969400>,\n",
-       " <__main__.FD at 0x7f765c969b00>,\n",
-       " <__main__.FD at 0x7f765c969dd8>,\n",
-       " <__main__.FD at 0x7f765c9649b0>,\n",
-       " <__main__.FD at 0x7f765c9699b0>,\n",
-       " <__main__.FD at 0x7f765d1c5cc0>,\n",
-       " <__main__.FD at 0x7f765c9642b0>,\n",
-       " <__main__.FD at 0x7f765c969860>,\n",
-       " <__main__.FD at 0x7f765c969198>,\n",
-       " <__main__.FD at 0x7f765c9690f0>,\n",
-       " <__main__.FD at 0x7f765c969a90>,\n",
-       " <__main__.FD at 0x7f765c985208>,\n",
-       " <__main__.FD at 0x7f765da3e0f0>,\n",
-       " <__main__.FD at 0x7f765c969da0>,\n",
-       " <__main__.FD at 0x7f765c964630>,\n",
-       " <__main__.FD at 0x7f765da3e160>,\n",
-       " <__main__.FD at 0x7f765c964588>,\n",
-       " <__main__.FD at 0x7f765c969b38>,\n",
-       " <__main__.FD at 0x7f7660ab26a0>,\n",
-       " <__main__.FD at 0x7f765c964eb8>,\n",
-       " <__main__.FD at 0x7f765c964dd8>,\n",
-       " <__main__.FD at 0x7f765c985240>,\n",
-       " <__main__.FD at 0x7f765c9699e8>,\n",
-       " <__main__.FD at 0x7f765c969be0>}"
+       "{<__main__.FD at 0x10ccafa58>,\n",
+       " <__main__.FD at 0x10caee9e8>,\n",
+       " <__main__.FD at 0x10cb01828>,\n",
+       " <__main__.FD at 0x10caeec50>,\n",
+       " <__main__.FD at 0x10cca8b00>,\n",
+       " <__main__.FD at 0x10ccaf518>,\n",
+       " <__main__.FD at 0x10cc9a780>,\n",
+       " <__main__.FD at 0x10cc92fd0>,\n",
+       " <__main__.FD at 0x10ccaf438>,\n",
+       " <__main__.FD at 0x10ccaf048>,\n",
+       " <__main__.FD at 0x10cca8630>,\n",
+       " <__main__.FD at 0x10ccaf5c0>,\n",
+       " <__main__.FD at 0x10ccafe48>,\n",
+       " <__main__.FD at 0x10cc92b70>,\n",
+       " <__main__.FD at 0x10cc9a4a8>,\n",
+       " <__main__.FD at 0x10cb07198>,\n",
+       " <__main__.FD at 0x10cc922e8>,\n",
+       " <__main__.FD at 0x10ccaf6a0>,\n",
+       " <__main__.FD at 0x10caee860>,\n",
+       " <__main__.FD at 0x10ccaf6d8>,\n",
+       " <__main__.FD at 0x10ccaf390>,\n",
+       " <__main__.FD at 0x10ccaf208>,\n",
+       " <__main__.FD at 0x10cca87b8>,\n",
+       " <__main__.FD at 0x10ccaf2b0>,\n",
+       " <__main__.FD at 0x10cc92940>,\n",
+       " <__main__.FD at 0x10cc92f28>,\n",
+       " <__main__.FD at 0x10cc6b860>,\n",
+       " <__main__.FD at 0x10cca8f98>,\n",
+       " <__main__.FD at 0x10ccaf780>,\n",
+       " <__main__.FD at 0x10ccc90f0>,\n",
+       " <__main__.FD at 0x10cc9a390>,\n",
+       " <__main__.FD at 0x10cc92a58>,\n",
+       " <__main__.FD at 0x10ccaf160>,\n",
+       " <__main__.FD at 0x10cc9a978>,\n",
+       " <__main__.FD at 0x10ccaf4e0>,\n",
+       " <__main__.FD at 0x10ccaf1d0>,\n",
+       " <__main__.FD at 0x10cb01d30>,\n",
+       " <__main__.FD at 0x10cc9a630>,\n",
+       " <__main__.FD at 0x10cc9a320>,\n",
+       " <__main__.FD at 0x10ccaf550>,\n",
+       " <__main__.FD at 0x10ccaf3c8>,\n",
+       " <__main__.FD at 0x10caee630>,\n",
+       " <__main__.FD at 0x10cb01438>,\n",
+       " <__main__.FD at 0x10ccaf748>,\n",
+       " <__main__.FD at 0x10cb01cc0>,\n",
+       " <__main__.FD at 0x10cca8dd8>,\n",
+       " <__main__.FD at 0x10cc9a9b0>,\n",
+       " <__main__.FD at 0x10cc9a198>,\n",
+       " <__main__.FD at 0x10ccc9128>,\n",
+       " <__main__.FD at 0x10cb01c18>,\n",
+       " <__main__.FD at 0x10cc92dd8>,\n",
+       " <__main__.FD at 0x10cc9ae10>,\n",
+       " <__main__.FD at 0x10ccaf5f8>,\n",
+       " <__main__.FD at 0x10ccafda0>,\n",
+       " <__main__.FD at 0x10cb07438>,\n",
+       " <__main__.FD at 0x10ccaf4a8>,\n",
+       " <__main__.FD at 0x10cc9a710>,\n",
+       " <__main__.FD at 0x10cc9a898>,\n",
+       " <__main__.FD at 0x10cb070f0>,\n",
+       " <__main__.FD at 0x10ccc9160>,\n",
+       " <__main__.FD at 0x10cc9ae80>,\n",
+       " <__main__.FD at 0x10ccaf400>,\n",
+       " <__main__.FD at 0x10ccaf080>,\n",
+       " <__main__.FD at 0x10cc92b38>,\n",
+       " <__main__.FD at 0x10ccc92e8>,\n",
+       " <__main__.FD at 0x10cc9afd0>,\n",
+       " <__main__.FD at 0x10ccaf0b8>,\n",
+       " <__main__.FD at 0x10cc9ab70>,\n",
+       " <__main__.FD at 0x10cca82e8>,\n",
+       " <__main__.FD at 0x10cc92978>,\n",
+       " <__main__.FD at 0x10cc9a2b0>,\n",
+       " <__main__.FD at 0x10cc6b9b0>,\n",
+       " <__main__.FD at 0x10cca8f60>,\n",
+       " <__main__.FD at 0x10ccaf198>,\n",
+       " <__main__.FD at 0x10cb01ac8>,\n",
+       " <__main__.FD at 0x10ccaf320>,\n",
+       " <__main__.FD at 0x10ccaf710>,\n",
+       " <__main__.FD at 0x10cc9a400>,\n",
+       " <__main__.FD at 0x10cc9af28>,\n",
+       " <__main__.FD at 0x10cc9a358>,\n",
+       " <__main__.FD at 0x10caeeeb8>,\n",
+       " <__main__.FD at 0x10ccaf470>,\n",
+       " <__main__.FD at 0x10cc9abe0>,\n",
+       " <__main__.FD at 0x10cca8588>,\n",
+       " <__main__.FD at 0x10ccc9358>,\n",
+       " <__main__.FD at 0x10cca8128>,\n",
+       " <__main__.FD at 0x10caeef98>,\n",
+       " <__main__.FD at 0x10cc92588>,\n",
+       " <__main__.FD at 0x10cc9aeb8>,\n",
+       " <__main__.FD at 0x10ccaf0f0>,\n",
+       " <__main__.FD at 0x10ccaf358>,\n",
+       " <__main__.FD at 0x10cc9a7f0>,\n",
+       " <__main__.FD at 0x10ccaf7b8>,\n",
+       " <__main__.FD at 0x10cc92710>,\n",
+       " <__main__.FD at 0x10cc92ef0>,\n",
+       " <__main__.FD at 0x10cb074a8>,\n",
+       " <__main__.FD at 0x10cb015f8>,\n",
+       " <__main__.FD at 0x10cc9a0f0>,\n",
+       " <__main__.FD at 0x10ccaf240>,\n",
+       " <__main__.FD at 0x10cc92080>,\n",
+       " <__main__.FD at 0x10ccaf668>,\n",
+       " <__main__.FD at 0x10cc9ad68>,\n",
+       " <__main__.FD at 0x10cb07048>,\n",
+       " <__main__.FD at 0x10cc9ad30>,\n",
+       " <__main__.FD at 0x10cca86d8>,\n",
+       " <__main__.FD at 0x10cc92208>,\n",
+       " <__main__.FD at 0x10caee668>,\n",
+       " <__main__.FD at 0x10cca8e80>,\n",
+       " <__main__.FD at 0x10caee940>,\n",
+       " <__main__.FD at 0x10cc9a5f8>,\n",
+       " <__main__.FD at 0x10cc9a3c8>,\n",
+       " <__main__.FD at 0x10cb01e48>,\n",
+       " <__main__.FD at 0x10cb07390>,\n",
+       " <__main__.FD at 0x10cb01da0>,\n",
+       " <__main__.FD at 0x10cca8a90>,\n",
+       " <__main__.FD at 0x10ccaf630>,\n",
+       " <__main__.FD at 0x10caee898>,\n",
+       " <__main__.FD at 0x10cc9a470>,\n",
+       " <__main__.FD at 0x10cc9af98>,\n",
+       " <__main__.FD at 0x10cc9aac8>,\n",
+       " <__main__.FD at 0x10cc92c50>,\n",
+       " <__main__.FD at 0x10cb019b0>,\n",
+       " <__main__.FD at 0x10caee780>,\n",
+       " <__main__.FD at 0x10cb072e8>,\n",
+       " <__main__.FD at 0x10caeeef0>,\n",
+       " <__main__.FD at 0x10cc9a908>,\n",
+       " <__main__.FD at 0x10cc9a9e8>,\n",
+       " <__main__.FD at 0x10cb01668>,\n",
+       " <__main__.FD at 0x10cc6be48>,\n",
+       " <__main__.FD at 0x10cb01080>,\n",
+       " <__main__.FD at 0x10ccaf128>,\n",
+       " <__main__.FD at 0x10cca8e10>,\n",
+       " <__main__.FD at 0x10cc9aef0>,\n",
+       " <__main__.FD at 0x10cc92e80>,\n",
+       " <__main__.FD at 0x10ccaf2e8>,\n",
+       " <__main__.FD at 0x10cca8d30>,\n",
+       " <__main__.FD at 0x10ccc9198>,\n",
+       " <__main__.FD at 0x10ccaf588>,\n",
+       " <__main__.FD at 0x10cb07470>,\n",
+       " <__main__.FD at 0x10ccafa20>,\n",
+       " <__main__.FD at 0x10cc9a8d0>}"
       ]
      },
-     "execution_count": 15,
+     "execution_count": 20,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -726,7 +809,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
+   "execution_count": 21,
    "metadata": {},
    "outputs": [
     {
@@ -735,7 +818,7 @@
        "'ABCD'"
       ]
      },
-     "execution_count": 16,
+     "execution_count": 21,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -746,18 +829,18 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
+   "execution_count": 22,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "{<__main__.FD at 0x7f765d1c5390>,\n",
-       " <__main__.FD at 0x7f765d1c54e0>,\n",
-       " <__main__.FD at 0x7f765d1c5cf8>}"
+       "{<__main__.FD at 0x10cb01828>,\n",
+       " <__main__.FD at 0x10cb01ac8>,\n",
+       " <__main__.FD at 0x10cb01080>}"
       ]
      },
-     "execution_count": 19,
+     "execution_count": 22,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -768,30 +851,23 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
+   "execution_count": 24,
    "metadata": {},
    "outputs": [
     {
-     "ename": "SyntaxError",
-     "evalue": "unexpected EOF while parsing (<ipython-input-20-92c25cba582c>, line 1)",
-     "output_type": "error",
-     "traceback": [
-      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-20-92c25cba582c>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m    FD('A', 'B'\u001b[0m\n\u001b[0m               ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m unexpected EOF while parsing\n"
-     ]
+     "data": {
+      "text/plain": [
+       "<__main__.FD at 0x10cb010b8>"
+      ]
+     },
+     "execution_count": 24,
+     "metadata": {},
+     "output_type": "execute_result"
     }
    ],
    "source": [
-    "FD('A', 'B'"
+    "FD('A', 'B')"
    ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": []
   }
  ],
  "metadata": {
@@ -810,7 +886,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.5.2"
+   "version": "3.6.2"
   }
  },
  "nbformat": 4,
-- 
GitLab