From cd3bfd36d6037d1955851a15250ef9bf9040d0cc Mon Sep 17 00:00:00 2001 From: Chris Yealy Date: Wed, 27 Dec 2023 18:29:25 -0500 Subject: [PATCH] finish sql --- 02-sql/SQL Wizard.ipynb | 665 +++++----------------------------------- 1 file changed, 76 insertions(+), 589 deletions(-) diff --git a/02-sql/SQL Wizard.ipynb b/02-sql/SQL Wizard.ipynb index 41584a2..280c500 100644 --- a/02-sql/SQL Wizard.ipynb +++ b/02-sql/SQL Wizard.ipynb @@ -16,10 +16,17 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "id": "ae40bab8", "metadata": {}, "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[32mDeploy AI and data apps for free on Ploomber Cloud! Learn more: https://docs.cloud.ploomber.io/en/latest/quickstart/signup.html\u001b[0m\n" + ] + }, { "data": { "text/html": [ @@ -75,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "id": "45e2c86e", "metadata": {}, "outputs": [ @@ -124,304 +131,15 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "cf28b6f1-c215-405c-afbf-c65cac1c2b7c", "metadata": { "scrolled": true }, - "outputs": [ - { - "data": { - "text/html": [ - "Running query in 'sqlite:///properties.db'" - ], - "text/plain": [ - "Running query in 'sqlite:///properties.db'" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
idnamelatitudelongitudeprioritize_listingmin_rental_agepromoteproperty_search_priorityaccess_typesfeatured_amenitieshome_typeneighborhoodall_amenitiesurlreviews_countreviews_ratingbathsbedstotal_occupantsshared_baths
e2el5x-rci-571Abbot's Bliss39.514008-79.28963502400[\"Lake Front\"][\"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Home Office\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"][\"House\"][\"Carmel Cove\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"Dog Friendly\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Charcoal)\", \"Grill (Gas)\", \"Home Office\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/abbots-bliss324.34384616None
e2el5x-rci-572Absolute Delight39.50175-79.3229602400[\"Lake Front\"][\"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"][\"House\"][\"Glendale Rd.\"][\"A/C (Central)\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Charcoal)\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/absolute-delight404.656825[\"1\"]
e2el5x-rci-573Ace's Chalet39.545776-79.3788902400[\"Limited Lake Access\", \"Ski In/Ski Out\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"][\"House\"][\"North Camp\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"All Bedrooms Are Suites\", \"Fireplace\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/aces-chalet484.33336516[\"1\"]
e2el5x-rci-574Adventure Bound39.53931-79.3539102400[\"Lake Front\", \"Ski Area\"][\"Provides Firewood (Valid: 9/15 - 4/15)\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"][\"House\"][\"Marsh Hill Rd.\"][\"Provides Firewood (Valid: 9/15 - 4/15)\", \"Dog Friendly\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Charcoal)\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/adventure-bound463.9133514None
e2el5x-rci-581Altitude Adjustment39.53566-79.3708702400[\"Golf Area\", \"Lake Area\"][\"Signature Collection Home\", \"CARC\", \"A/C\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\", \"EV Charging\"][\"House\"][\"Biltmore at Lodestone\"][\"A/C (Central)\", \"Signature Collection Home\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"All Bedrooms Are Suites\", \"Fireplace\", \"Fireplace (Gas)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\", \"Electric Vehicle Charging Station\"]https://www.deepcreek.com/vacation-rentals/altitude-adjustment824.84155514[\"1\"]
e2el5x-rci-585American Eagle Lodge39.55831-79.3563502400[\"Lake Front\", \"Ski Area\"][\"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Swimming Pool\", \"WIFI\", \"Sauna\"][\"House\"][\"Deep Creek Drive\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"WIFI\", \"Sauna\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/american-eagle-lodge414.41467826[\"2\"]
e2el5x-rci-589Almost Aspen39.501404-79.3232102400[\"Lake Front\"][\"Signature Collection Home\", \"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"][\"House\"][\"Glendale Rd.\"][\"A/C (Central)\", \"Signature Collection Home\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/almost-aspen554.69096720[\"1\"]
e2el5x-rci-592At Lake's Edge39.50574-79.27785502400[\"Golf Area\", \"Lake Front\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\"][\"House\"][\"Waterfront Greens\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/lakes-edge374.37847820[\"1\"]
e2el5x-rci-594Awesome View39.501785-79.3208702400[\"Lake Front\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"WIFI\"][\"House\"][\"Glendale Rd.\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/awesome-view334.06066824[\"1\"]
e2el5x-rci-606Beyond Bliss39.50577-79.2795602400[\"Golf Area\", \"Lake Front\"][\"Signature Collection Home\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Home Theater\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"Weddings Considered (Fees Apply)\", \"WIFI\"][\"House\"][\"Waterfront Greens\"][\"A/C (Central)\", \"Signature Collection Home\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"All Bedrooms Are Suites\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Home Theater\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/beyond-bliss374.27039820[\"1\"]
\n", - "Truncated to displaylimit of 10." - ], - "text/plain": [ - "+----------------+----------------------+-----------+------------+--------------------+----------------+---------+--------------------------+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+---------------+----------------+-------+------+-----------------+--------------+\n", - "| id | name | latitude | longitude | prioritize_listing | min_rental_age | promote | property_search_priority | access_types | featured_amenities | home_type | neighborhood | all_amenities | url | reviews_count | reviews_rating | baths | beds | total_occupants | shared_baths |\n", - "+----------------+----------------------+-----------+------------+--------------------+----------------+---------+--------------------------+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+---------------+----------------+-------+------+-----------------+--------------+\n", - "| e2el5x-rci-571 | Abbot's Bliss | 39.514008 | -79.289635 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Home Office\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"] | [\"House\"] | [\"Carmel Cove\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"Dog Friendly\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Charcoal)\", \"Grill (Gas)\", \"Home Office\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/abbots-bliss | 32 | 4.3438 | 4 | 6 | 16 | None |\n", - "| e2el5x-rci-572 | Absolute Delight | 39.50175 | -79.32296 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"] | [\"House\"] | [\"Glendale Rd.\"] | [\"A/C (Central)\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Charcoal)\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/absolute-delight | 40 | 4.65 | 6 | 8 | 25 | [\"1\"] |\n", - "| e2el5x-rci-573 | Ace's Chalet | 39.545776 | -79.37889 | 0 | 24 | 0 | 0 | [\"Limited Lake Access\", \"Ski In/Ski Out\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"] | [\"House\"] | [\"North Camp\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"All Bedrooms Are Suites\", \"Fireplace\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/aces-chalet | 48 | 4.3333 | 6 | 5 | 16 | [\"1\"] |\n", - "| e2el5x-rci-574 | Adventure Bound | 39.53931 | -79.35391 | 0 | 24 | 0 | 0 | [\"Lake Front\", \"Ski Area\"] | [\"Provides Firewood (Valid: 9/15 - 4/15)\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"] | [\"House\"] | [\"Marsh Hill Rd.\"] | [\"Provides Firewood (Valid: 9/15 - 4/15)\", \"Dog Friendly\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Charcoal)\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/adventure-bound | 46 | 3.913 | 3 | 5 | 14 | None |\n", - "| e2el5x-rci-581 | Altitude Adjustment | 39.53566 | -79.37087 | 0 | 24 | 0 | 0 | [\"Golf Area\", \"Lake Area\"] | [\"Signature Collection Home\", \"CARC\", \"A/C\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\", \"EV Charging\"] | [\"House\"] | [\"Biltmore at Lodestone\"] | [\"A/C (Central)\", \"Signature Collection Home\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"All Bedrooms Are Suites\", \"Fireplace\", \"Fireplace (Gas)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\", \"Electric Vehicle Charging Station\"] | https://www.deepcreek.com/vacation-rentals/altitude-adjustment | 82 | 4.8415 | 5 | 5 | 14 | [\"1\"] |\n", - "| e2el5x-rci-585 | American Eagle Lodge | 39.55831 | -79.35635 | 0 | 24 | 0 | 0 | [\"Lake Front\", \"Ski Area\"] | [\"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Swimming Pool\", \"WIFI\", \"Sauna\"] | [\"House\"] | [\"Deep Creek Drive\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"WIFI\", \"Sauna\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/american-eagle-lodge | 41 | 4.4146 | 7 | 8 | 26 | [\"2\"] |\n", - "| e2el5x-rci-589 | Almost Aspen | 39.501404 | -79.32321 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"Signature Collection Home\", \"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\"] | [\"House\"] | [\"Glendale Rd.\"] | [\"A/C (Central)\", \"Signature Collection Home\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/almost-aspen | 55 | 4.6909 | 6 | 7 | 20 | [\"1\"] |\n", - "| e2el5x-rci-592 | At Lake's Edge | 39.50574 | -79.277855 | 0 | 24 | 0 | 0 | [\"Golf Area\", \"Lake Front\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\"] | [\"House\"] | [\"Waterfront Greens\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/lakes-edge | 37 | 4.3784 | 7 | 8 | 20 | [\"1\"] |\n", - "| e2el5x-rci-594 | Awesome View | 39.501785 | -79.32087 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"WIFI\"] | [\"House\"] | [\"Glendale Rd.\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/awesome-view | 33 | 4.0606 | 6 | 8 | 24 | [\"1\"] |\n", - "| e2el5x-rci-606 | Beyond Bliss | 39.50577 | -79.27956 | 0 | 24 | 0 | 0 | [\"Golf Area\", \"Lake Front\"] | [\"Signature Collection Home\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Home Theater\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"Weddings Considered (Fees Apply)\", \"WIFI\"] | [\"House\"] | [\"Waterfront Greens\"] | [\"A/C (Central)\", \"Signature Collection Home\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"All Bedrooms Are Suites\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Home Theater\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/beyond-bliss | 37 | 4.2703 | 9 | 8 | 20 | [\"1\"] |\n", - "+----------------+----------------------+-----------+------------+--------------------+----------------+---------+--------------------------+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+---------------+----------------+-------+------+-----------------+--------------+\n", - "Truncated to displaylimit of 10." - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%%sql\n", - "# Add your select statement here\n", - "SELECT * from all_railey_properties" + "# Add your select statement here" ] }, { @@ -548,311 +266,80 @@ "# Your SQL goes here" ] }, + { + "cell_type": "markdown", + "id": "51787413-b452-4c8f-97ce-fd8983f2300b", + "metadata": {}, + "source": [ + "### I LIKE you <3\n", + "\n", + "SQL also has some other boolean operators besides the classics. The most important of these which we'll cover is LIKE. LIKE allows you to search for strings which match a particular pattern. As an example, take our hypothetical taxi example from before. Imagine we have a column called `destination_address`. We could use a LIKE statement to search for all destinations which are on a particular street. I'll show you what it looks like and then we'll go from there:\n", + "\n", + "`SELECT * FROM cab_rides WHERE destination_address LIKE '%Main St%'`\n", + "\n", + "This SQL query will match entries like \"122 Main Street\", \"57 Main St.\", and \"3232 Main Street\". The `%` sign means match any characters. So here we tell the database to search for address which start with any characters, then are followed by \"Main St\", and finally has any number of characters at the end. This can be useful to have some basic search engine type functionality." + ] + }, + { + "cell_type": "markdown", + "id": "c4a3a89c-448c-41cc-82e7-0b911def9fc6", + "metadata": {}, + "source": [ + "### Exercise 6: WHERE is the person I LIKE?\n", + "\n", + "Now use your knowledge of LIKE to write a SQL query to pull out all deep creek homes which have \"Lake\" in the house's `name` column." + ] + }, { "cell_type": "code", - "execution_count": 11, - "id": "fbece4d1-877e-4bc9-991e-54374da179b0", + "execution_count": null, + "id": "659ee93a-e99a-4168-8c51-53e385b092d3", + "metadata": {}, + "outputs": [], + "source": [ + "%%sql\n", + "# Your SQL goes here" + ] + }, + { + "cell_type": "markdown", + "id": "b61ec4d0-b45a-4ec5-b47e-3732e4df086b", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "Running query in 'sqlite:///properties.db'" - ], - "text/plain": [ - "Running query in 'sqlite:///properties.db'" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
idnamelatitudelongitudeprioritize_listingmin_rental_agepromoteproperty_search_priorityaccess_typesfeatured_amenitieshome_typeneighborhoodall_amenitiesurlreviews_countreviews_ratingbathsbedstotal_occupantsshared_baths
e2el5x-rci-592At Lake's Edge39.50574-79.27785502400[\"Golf Area\", \"Lake Front\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\"][\"House\"][\"Waterfront Greens\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/lakes-edge374.37847820[\"1\"]
e2el5x-rci-625Chalet By The Lake39.55737-79.3598602400[\"Ski Area\", \"Lake Access\"][\"CARC\", \"A/C\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"WIFI\"][\"House\"][\"Lake Pointe\"][\"A/C (Central)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"All Bedrooms Are Suites\", \"Fireplace\", \"Fireplace (Gas)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/chalet-lake334.5758338None
e2el5x-rci-647Enchanted Lakefront39.501686-79.3218802400[\"Lake Front\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"][\"House\"][\"Glendale Rd.\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/enchanted-lakefront364.38897822[\"1\"]
e2el5x-rci-672Lake Chalet39.50114-79.3145302400[\"Lake Area\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\", \"Cabin\"]None[\"Yellowstone\"][\"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C (Central)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Fireplace\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Charcoal)\", \"Hot Tub\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/lake-chalet364.44444412None
e2el5x-rci-675Lake 'N Logs39.499172-79.2866503000[\"Lake Front\"][\"Signature Collection Home\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"][\"House\"][\"Beckman's Peninsula\"][\"Signature Collection Home\", \"A/C (Central)\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/lake-n-logs324.90633514[\"1\"]
e2el5x-rci-683Lake Effect39.500214-79.2733702400[\"Lake Front\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"][\"House\"][\"Harvey's Peninsula\"][\"A/C (Partial)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/lake-effect434.55813310None
e2el5x-rci-738The Lakehouse39.501854-79.3200502400[\"Lake Front\"][\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"][\"House\"][\"Silver Tree Landing\"][\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/lakehouse134.53856822[\"1\"]
e2el5x-rci-826On Lake Time39.498966-79.3266202400[\"Lake Area\"][\"Signature Collection Home\", \"A/C\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Pool Table\", \"WIFI\"][\"Duplex\"][\"Timberlake\"][\"A/C (Central)\", \"Signature Collection Home\", \"A/C\", \"Fireplace\", \"Fireplace (Gas)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/lake-time504.444512[\"1\"]
e2el5x-rci-830Traditions on the Lake39.516163-79.3247702400[\"Lake Front\"][\"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Streaming Capable TVs\", \"WIFI\"][\"House\"][\"Route 219 (Garrett Hwy)\"][\"A/C (Central)\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Streaming Service Capable TVs\", \"WIFI\", \"Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/traditions-lake374.37843514[\"1\"]
e2el5x-rci-849Castle at the Lake39.50537-79.27914402400[\"Golf Area\", \"Lake Front\"][\"Signature Collection Home\", \"A/C\", \"Dock\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Swimming Pool\", \"Weddings Considered (Fees Apply)\", \"WIFI\"][\"House\"][\"Waterfront Greens\"][\"A/C (Central)\", \"Signature Collection Home\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"]https://www.deepcreek.com/vacation-rentals/castle-lake614.47545514[\"1\"]
\n", - "Truncated to displaylimit of 10." - ], - "text/plain": [ - "+----------------+------------------------+-----------+------------+--------------------+----------------+---------+--------------------------+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+---------------+----------------+-------+------+-----------------+--------------+\n", - "| id | name | latitude | longitude | prioritize_listing | min_rental_age | promote | property_search_priority | access_types | featured_amenities | home_type | neighborhood | all_amenities | url | reviews_count | reviews_rating | baths | beds | total_occupants | shared_baths |\n", - "+----------------+------------------------+-----------+------------+--------------------+----------------+---------+--------------------------+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+---------------+----------------+-------+------+-----------------+--------------+\n", - "| e2el5x-rci-592 | At Lake's Edge | 39.50574 | -79.277855 | 0 | 24 | 0 | 0 | [\"Golf Area\", \"Lake Front\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\"] | [\"House\"] | [\"Waterfront Greens\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/lakes-edge | 37 | 4.3784 | 7 | 8 | 20 | [\"1\"] |\n", - "| e2el5x-rci-625 | Chalet By The Lake | 39.55737 | -79.35986 | 0 | 24 | 0 | 0 | [\"Ski Area\", \"Lake Access\"] | [\"CARC\", \"A/C\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"WIFI\"] | [\"House\"] | [\"Lake Pointe\"] | [\"A/C (Central)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"All Bedrooms Are Suites\", \"Fireplace\", \"Fireplace (Gas)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/chalet-lake | 33 | 4.5758 | 3 | 3 | 8 | None |\n", - "| e2el5x-rci-647 | Enchanted Lakefront | 39.501686 | -79.32188 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"] | [\"House\"] | [\"Glendale Rd.\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/enchanted-lakefront | 36 | 4.3889 | 7 | 8 | 22 | [\"1\"] |\n", - "| e2el5x-rci-672 | Lake Chalet | 39.50114 | -79.31453 | 0 | 24 | 0 | 0 | [\"Lake Area\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\", \"Cabin\"] | None | [\"Yellowstone\"] | [\"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C (Central)\", \"CARC Indoor Pool & Fitness Membership\", \"A/C\", \"Fireplace\", \"Fireplace (Wood)\", \"Game Table\", \"Grill\", \"Grill (Charcoal)\", \"Hot Tub\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/lake-chalet | 36 | 4.4444 | 4 | 4 | 12 | None |\n", - "| e2el5x-rci-675 | Lake 'N Logs | 39.499172 | -79.28665 | 0 | 30 | 0 | 0 | [\"Lake Front\"] | [\"Signature Collection Home\", \"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"] | [\"House\"] | [\"Beckman's Peninsula\"] | [\"Signature Collection Home\", \"A/C (Central)\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/lake-n-logs | 32 | 4.9063 | 3 | 5 | 14 | [\"1\"] |\n", - "| e2el5x-rci-683 | Lake Effect | 39.500214 | -79.27337 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"] | [\"House\"] | [\"Harvey's Peninsula\"] | [\"A/C (Partial)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/lake-effect | 43 | 4.5581 | 3 | 3 | 10 | None |\n", - "| e2el5x-rci-738 | The Lakehouse | 39.501854 | -79.32005 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"CARC\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"A/C\", \"Dock\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"WIFI\"] | [\"House\"] | [\"Silver Tree Landing\"] | [\"A/C (Central)\", \"Provides Firewood (Valid: 9/15 - 4/15)\", \"CARC Indoor Pool & Fitness Membership\", \"Dog Friendly\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Fireplace\", \"Fireplace (Gas)\", \"Fireplace (Wood)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/lakehouse | 13 | 4.5385 | 6 | 8 | 22 | [\"1\"] |\n", - "| e2el5x-rci-826 | On Lake Time | 39.498966 | -79.32662 | 0 | 24 | 0 | 0 | [\"Lake Area\"] | [\"Signature Collection Home\", \"A/C\", \"Fireplace\", \"Grill\", \"Hot Tub\", \"Pool Table\", \"WIFI\"] | [\"Duplex\"] | [\"Timberlake\"] | [\"A/C (Central)\", \"Signature Collection Home\", \"A/C\", \"Fireplace\", \"Fireplace (Gas)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Pool Table\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/lake-time | 50 | 4.44 | 4 | 5 | 12 | [\"1\"] |\n", - "| e2el5x-rci-830 | Traditions on the Lake | 39.516163 | -79.32477 | 0 | 24 | 0 | 0 | [\"Lake Front\"] | [\"A/C\", \"Dock\", \"Fireplace\", \"Game Table\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Streaming Capable TVs\", \"WIFI\"] | [\"House\"] | [\"Route 219 (Garrett Hwy)\"] | [\"A/C (Central)\", \"A/C\", \"Dock\", \"Dock (Private)\", \"Fireplace\", \"Fireplace (Gas)\", \"Game Table\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Streaming Service Capable TVs\", \"WIFI\", \"Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/traditions-lake | 37 | 4.3784 | 3 | 5 | 14 | [\"1\"] |\n", - "| e2el5x-rci-849 | Castle at the Lake | 39.50537 | -79.279144 | 0 | 24 | 0 | 0 | [\"Golf Area\", \"Lake Front\"] | [\"Signature Collection Home\", \"A/C\", \"Dock\", \"Grill\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Capable TVs\", \"Swimming Pool\", \"Weddings Considered (Fees Apply)\", \"WIFI\"] | [\"House\"] | [\"Waterfront Greens\"] | [\"A/C (Central)\", \"Signature Collection Home\", \"A/C\", \"Dock\", \"Dock (Slip)\", \"Grill\", \"Grill (Gas)\", \"Hot Tub\", \"Outdoor Fireplace or Fire Pit\", \"Pool Table\", \"Streaming Service Capable TVs\", \"Swimming Pool\", \"Swimming Pool (Private)\", \"Weddings Considered (Fees Apply)\", \"WIFI\", \"No Bunk Beds\"] | https://www.deepcreek.com/vacation-rentals/castle-lake | 61 | 4.4754 | 5 | 5 | 14 | [\"1\"] |\n", - "+----------------+------------------------+-----------+------------+--------------------+----------------+---------+--------------------------+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+---------------+----------------+-------+------+-----------------+--------------+\n", - "Truncated to displaylimit of 10." - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "source": [ + "### Sorting with ORDER BY\n", + "\n", + "Right now the SQL results returned to you are unsorted, but you can absolutely choose the sorting method that the database can use before it returns the rows to you. To accomplish this with SQL one should use the ORDER BY directive at the end of the SELECT statement. Imagine I would like to sort all hypothetical taxi rides by total_miles_traveled when they are returned. I can write a query which looks like this: `SELECT * FROM cab_rides ORDER BY total_miles_traveled DESC`. After you specify the column name you'd like to use to sort, you can also specify ASC or DESC to sort in ascending or decending order. By defualt, SQL databases with use an ascending sort but you can change that.\n", + "\n", + "You can also specify multiple ORDER BY clauses to sort by multiple columns at the same time, just like in excel. For example you could hit the SQL database with one of these to first sort by last name and then sort by first name when pulling records out: `SELECT * FROM cab_rides ORDER BY last_name ORDER BY first_name`. " + ] + }, + { + "cell_type": "markdown", + "id": "5dbcfa6c-cb23-4d88-b208-386c3b20c81e", + "metadata": {}, + "source": [ + "### Exercise 7: Where are the beds?\n", + "\n", + "Let's try another exercise, this time to sort the results by the amount of `beds` they have. Make sure you sort it so that we see the properties with the largest number of beds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5677985f-7a94-4df6-adc9-c5c0ebad48f0", + "metadata": {}, + "outputs": [], "source": [ "%%sql\n", - "SELECT * from all_railey_properties WHERE name LIKE '%Lake%'" + "# Your SQL goes here" ] } ], "metadata": { "kernelspec": { - "display_name": "jupyterwithpackages", + "display_name": ".venv", "language": "python", - "name": "jupyterwithpackages" + "name": ".venv" }, "language_info": { "codemirror_mode": { @@ -864,7 +351,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.11.6" }, "toc-autonumbering": true, "toc-showmarkdowntxt": false