Preparing material for Version 5 novice release
[swc-sql.git] / sql / novice / 02-sort-dup.ipynb
index 44d1335ab9b5f51e58cde18430199d5e1ebc65f9..8ffe0dbeab69b6cbaf9486c78c51d8a4cdde1ff7 100644 (file)
@@ -9,12 +9,26 @@
    "cells": [
     {
      "cell_type": "heading",
-     "level": 1,
+     "level": 2,
      "metadata": {},
      "source": [
       "Sorting and Removing Duplicates"
      ]
     },
+    {
+     "cell_type": "markdown",
+     "metadata": {
+      "cell_tags": [
+       "objectives"
+      ]
+     },
+     "source": [
+      "#### Objectives\n",
+      "\n",
+      "*   Write queries that display results in a particular order.\n",
+      "*   Write queries that eliminate duplicate values from data."
+     ]
+    },
     {
      "cell_type": "markdown",
      "metadata": {},
@@ -77,7 +91,7 @@
        "metadata": {},
        "output_type": "display_data",
        "text": [
-        "<IPython.core.display.HTML at 0x1023cbe10>"
+        "<IPython.core.display.HTML at 0x102358c90>"
        ]
       }
      ],
        "metadata": {},
        "output_type": "display_data",
        "text": [
-        "<IPython.core.display.HTML at 0x1023cbf10>"
+        "<IPython.core.display.HTML at 0x102358d90>"
        ]
       }
      ],
        "metadata": {},
        "output_type": "display_data",
        "text": [
-        "<IPython.core.display.HTML at 0x1023cbf10>"
+        "<IPython.core.display.HTML at 0x102353c90>"
        ]
       }
      ],
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "### Challenges\n",
+      "#### Challenges\n",
       "\n",
       "1.  Write a query that selects distinct dates from the `Site` table."
      ]
        "metadata": {},
        "output_type": "display_data",
        "text": [
-        "<IPython.core.display.HTML at 0x1023cbe90>"
+        "<IPython.core.display.HTML at 0x102353b10>"
        ]
       }
      ],
        "metadata": {},
        "output_type": "display_data",
        "text": [
-        "<IPython.core.display.HTML at 0x1023cbe10>"
+        "<IPython.core.display.HTML at 0x102353c50>"
        ]
       }
      ],
        "metadata": {},
        "output_type": "display_data",
        "text": [
-        "<IPython.core.display.HTML at 0x1023c4090>"
+        "<IPython.core.display.HTML at 0x1023557d0>"
        ]
       }
      ],
        "metadata": {},
        "output_type": "display_data",
        "text": [
-        "<IPython.core.display.HTML at 0x1023c96d0>"
+        "<IPython.core.display.HTML at 0x102353b10>"
        ]
       }
      ],
      "cell_type": "markdown",
      "metadata": {},
      "source": [
-      "### Challenges\n",
+      "#### Challenges\n",
+      "\n",
+      "1.  Write a query that returns the distinct dates in the `Visited` table.\n",
+      "\n",
+      "2.  Write a query that displays the full names of the scientists in the `Person` table, ordered by family name."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {
+      "cell_tags": [
+       "keypoints"
+      ]
+     },
+     "source": [
+      "#### Key Points\n",
       "\n",
-      "FIXME"
+      "*   The records in a database table are not intrinsically ordered:\n",
+      "    if we want to display them in some order,\n",
+      "    we must specify that explicitly.\n",
+      "*   The values in a database are not guaranteed to be unique:\n",
+      "    if we want to eliminate duplicates,\n",
+      "    we must specify that explicitly as well."
      ]
     }
    ],