{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "NOTE:\n", "-----\n", "\n", "진행하기 전에 다음의 셀을 실행시키고 가자.\n", "\n", "Please run the below cells first before proceeding- you'll need them soon!" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false, "slideshow": { "slide_type": "skip" } }, "outputs": [ { "data": { "text/plain": [ "'Connected: @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": [ "활동 3c\n", "------------\n", "한정자, NULL 값, 그리고 Outer Joins\n", "\n", "Quantifiers, NULLs, and Outer Joins" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "문제 #1\n", "-----------\n", "\n", "앞에서 사용한 테이블들을 다시 보자:\n", "\n", "Recall that the tables we just looked at:\n", "\n", "\n", "`bagel` 베이글 회사들이 생산하는 베이글의 종류:\n", "\n", "`bagel`, which describes types of bagels made by the different bagel companies:\n", "\n", "> * name STRING\n", "> * price FLOAT\n", "> * made_by STRING\n", "\n", "그리고 `purchase`:\n", "\n", "And `purchase`:\n", "\n", "> * bagel_name STRING\n", "> * franchise STRING\n", "> * date INT\n", "> * quantity INT\n", "> * purchaser_age INT\n", "\n", "`purchase.bagel_name` 는 `bagel.name` 을 참조하고 `purchase.franchise` 는`bagel.made_by` 참조한다.\n", "\n", "Where `purchase.bagel_name` references `bagel.name` and `purchase.franchise` references `bagel.made_by`.\n", "\n", "\n", "**회사의 공식 목록(i.e. `bagel` 테이블) 중에 포함되지 않은 제품을 구매한 경우가 있었는지 찾아 볼 수 있는가? 단, 하나의 질의문으로 구성**\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", "\n", "질의문을 아래에 작성한다:\n", "\n", "Write your query here:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%%sql\n" ] } ], "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.5" } }, "nbformat": 4, "nbformat_minor": 2 }