File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 208
208
"cell_type" : " markdown" ,
209
209
"metadata" : {},
210
210
"source" : [
211
- " ### Run a slightly more complex query \n " ,
211
+ " ### Run slightly more complex queries \n " ,
212
212
" How many entries in the `Close` field are higher than 500?"
213
213
]
214
214
},
234
234
" count_greater_500 = spark1.sql(\" SELECT COUNT(Close) FROM stock WHERE Close > 500\" ).show()"
235
235
]
236
236
},
237
+ {
238
+ "cell_type" : " markdown" ,
239
+ "metadata" : {},
240
+ "source" : [
241
+ " What is the average `Open` values of all the entries where `Volume` is either greater than 120 million or less than 110 million?"
242
+ ]
243
+ },
244
+ {
245
+ "cell_type" : " code" ,
246
+ "execution_count" : 36 ,
247
+ "metadata" : {},
248
+ "outputs" : [
249
+ {
250
+ "name" : " stdout" ,
251
+ "output_type" : " stream" ,
252
+ "text" : [
253
+ " +------------------+\n " ,
254
+ " | avg(Open)|\n " ,
255
+ " +------------------+\n " ,
256
+ " |309.12406365290224|\n " ,
257
+ " +------------------+\n " ,
258
+ " \n "
259
+ ]
260
+ }
261
+ ],
262
+ "source" : [
263
+ " avg_1 = spark1.sql(\" SELECT AVG(Open) FROM stock WHERE Volume > 120000000 OR Volume < 110000000\" ).show()"
264
+ ]
265
+ },
237
266
{
238
267
"cell_type" : " markdown" ,
239
268
"metadata" : {},
You can’t perform that action at this time.
0 commit comments