|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 |
| - "execution_count": 4, |
| 5 | + "execution_count": 1, |
6 | 6 | "metadata": {},
|
7 | 7 | "outputs": [
|
8 | 8 | {
|
|
21 | 21 | },
|
22 | 22 | {
|
23 | 23 | "cell_type": "code",
|
24 |
| - "execution_count": 5, |
| 24 | + "execution_count": 2, |
25 | 25 | "metadata": {},
|
26 |
| - "outputs": [ |
27 |
| - { |
28 |
| - "name": "stdout", |
29 |
| - "output_type": "stream", |
30 |
| - "text": [ |
31 |
| - "The sql extension is already loaded. To reload it, use:\n", |
32 |
| - " %reload_ext sql\n" |
33 |
| - ] |
34 |
| - } |
35 |
| - ], |
| 26 | + "outputs": [], |
36 | 27 | "source": [
|
37 | 28 | "%load_ext sql "
|
38 | 29 | ]
|
39 | 30 | },
|
40 | 31 | {
|
41 | 32 | "cell_type": "code",
|
42 |
| - "execution_count": 6, |
| 33 | + "execution_count": 3, |
43 | 34 | "metadata": {},
|
44 | 35 | "outputs": [
|
45 | 36 | {
|
|
134 | 125 | " ('9', '11987', '144', '1 oz')]"
|
135 | 126 | ]
|
136 | 127 | },
|
137 |
| - "execution_count": 6, |
| 128 | + "execution_count": 3, |
138 | 129 | "metadata": {},
|
139 | 130 | "output_type": "execute_result"
|
140 | 131 | }
|
|
144 | 135 | "select * from composition limit 10"
|
145 | 136 | ]
|
146 | 137 | },
|
| 138 | + { |
| 139 | + "cell_type": "code", |
| 140 | + "execution_count": 4, |
| 141 | + "metadata": {}, |
| 142 | + "outputs": [ |
| 143 | + { |
| 144 | + "name": "stdout", |
| 145 | + "output_type": "stream", |
| 146 | + "text": [ |
| 147 | + " * postgresql://antoniopenta:***@goldsmith.clb2mudtmvnt.eu-central-1.rds.amazonaws.com:5432/goldsmiths\n", |
| 148 | + "5 rows affected.\n" |
| 149 | + ] |
| 150 | + }, |
| 151 | + { |
| 152 | + "data": { |
| 153 | + "text/html": [ |
| 154 | + "<table>\n", |
| 155 | + " <tr>\n", |
| 156 | + " <th>stralcoholic</th>\n", |
| 157 | + " </tr>\n", |
| 158 | + " <tr>\n", |
| 159 | + " <td>None</td>\n", |
| 160 | + " </tr>\n", |
| 161 | + " <tr>\n", |
| 162 | + " <td>Alcoholic</td>\n", |
| 163 | + " </tr>\n", |
| 164 | + " <tr>\n", |
| 165 | + " <td>Optional alcohol</td>\n", |
| 166 | + " </tr>\n", |
| 167 | + " <tr>\n", |
| 168 | + " <td>Non alcoholic</td>\n", |
| 169 | + " </tr>\n", |
| 170 | + " <tr>\n", |
| 171 | + " <td>Non Alcoholic</td>\n", |
| 172 | + " </tr>\n", |
| 173 | + "</table>" |
| 174 | + ], |
| 175 | + "text/plain": [ |
| 176 | + "[(None,),\n", |
| 177 | + " ('Alcoholic',),\n", |
| 178 | + " ('Optional alcohol',),\n", |
| 179 | + " ('Non alcoholic',),\n", |
| 180 | + " ('Non Alcoholic',)]" |
| 181 | + ] |
| 182 | + }, |
| 183 | + "execution_count": 4, |
| 184 | + "metadata": {}, |
| 185 | + "output_type": "execute_result" |
| 186 | + } |
| 187 | + ], |
| 188 | + "source": [ |
| 189 | + "%sql select distinct stralcoholic from cocktail;" |
| 190 | + ] |
| 191 | + }, |
| 192 | + { |
| 193 | + "cell_type": "code", |
| 194 | + "execution_count": 5, |
| 195 | + "metadata": {}, |
| 196 | + "outputs": [ |
| 197 | + { |
| 198 | + "name": "stdout", |
| 199 | + "output_type": "stream", |
| 200 | + "text": [ |
| 201 | + " * postgresql://antoniopenta:***@goldsmith.clb2mudtmvnt.eu-central-1.rds.amazonaws.com:5432/goldsmiths\n", |
| 202 | + "5 rows affected.\n", |
| 203 | + "+------------------+\n", |
| 204 | + "| stralcoholic |\n", |
| 205 | + "+------------------+\n", |
| 206 | + "| None |\n", |
| 207 | + "| Alcoholic |\n", |
| 208 | + "| Optional alcohol |\n", |
| 209 | + "| Non alcoholic |\n", |
| 210 | + "| Non Alcoholic |\n", |
| 211 | + "+------------------+\n" |
| 212 | + ] |
| 213 | + } |
| 214 | + ], |
| 215 | + "source": [ |
| 216 | + "result = %sql select distinct stralcoholic from cocktail;\n", |
| 217 | + "print(result)" |
| 218 | + ] |
| 219 | + }, |
| 220 | + { |
| 221 | + "cell_type": "code", |
| 222 | + "execution_count": 6, |
| 223 | + "metadata": {}, |
| 224 | + "outputs": [ |
| 225 | + { |
| 226 | + "name": "stdout", |
| 227 | + "output_type": "stream", |
| 228 | + "text": [ |
| 229 | + " * postgresql://antoniopenta:***@goldsmith.clb2mudtmvnt.eu-central-1.rds.amazonaws.com:5432/goldsmiths\n", |
| 230 | + "5 rows affected.\n", |
| 231 | + "['stralcoholic']\n" |
| 232 | + ] |
| 233 | + } |
| 234 | + ], |
| 235 | + "source": [ |
| 236 | + "result = %sql select distinct stralcoholic from cocktail;\n", |
| 237 | + "print(result.keys)" |
| 238 | + ] |
| 239 | + }, |
147 | 240 | {
|
148 | 241 | "cell_type": "code",
|
149 | 242 | "execution_count": null,
|
150 | 243 | "metadata": {},
|
151 | 244 | "outputs": [],
|
152 |
| - "source": [] |
| 245 | + "source": [ |
| 246 | + "result = %sql select distinct stralcoholic from cocktail;\n", |
| 247 | + "df=pd." |
| 248 | + ] |
153 | 249 | }
|
154 | 250 | ],
|
155 | 251 | "metadata": {
|
|
0 commit comments