{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "NOTE:\n", "-----\n", "\n", "Please run the below cells first before proceeding- you'll need them soon!" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "slideshow": { "slide_type": "skip" } }, "outputs": [ { "data": { "text/plain": [ "'Connected: None@dataset_1.db'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%load_ext sql\n", "%sql sqlite:///dataset_1.db" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Activity 3-3\n", "------------\n", "Quantifiers, NULLs, and Outer Joins" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "Exercise #1\n", "-----------\n", "\n", "Recall that the tables we just looked at:\n", "\n", "`bagel`, which describes types of bagels made by the different bagel companies:\n", "> * name STRING\n", "> * price FLOAT\n", "> * made_by STRING\n", "\n", "And `purchase`:\n", "> * bagel_name STRING\n", "> * franchise STRING\n", "> * date INT\n", "> * quantity INT\n", "> * purchaser_age INT\n", "\n", "Where `purchase.bagel_name` references `bagel.name` and `purchase.franchise` references `bagel.made_by`.\n", "\n", "**Can you find out if there were any purchases of products not on one of the company's official lists (i.e. the `bagel` table), using a single SQL query?**\n", "\n", "Write your query here:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 1 }