Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the SQL query of the below question which can be written in python (pyspark). Q1 - Is there a correlation between neighborhood, zip

I need the SQL query of the below question which can be written in python (pyspark).

Q1 - Is there a correlation between neighborhood, zip code, and number of fire calls?

Attaching sample of data and the column names for reference.

StructField('CallNumber', IntegerType(), True),

StructField('UnitID', StringType(), True),

StructField('IncidentNumber', IntegerType(), True),

StructField('CallType', StringType(), True),

StructField('CallDate', StringType(), True),

StructField('WatchDate', StringType(), True),

StructField('CallFinalDisposition', StringType(), True),

StructField('AvailableDtTm', StringType(), True),

StructField('Address', StringType(), True),

StructField('City', StringType(), True),

StructField('Zipcode', IntegerType(), True),

StructField('Battalion', StringType(), True),

StructField('StationArea', StringType(), True),

StructField('Box', StringType(), True),

StructField('OriginalPriority', StringType(), True),

StructField('Priority', StringType(), True),

StructField('FinalPriority', IntegerType(), True),

StructField('ALSUnit', BooleanType(), True),

StructField('CallTypeGroup', StringType(), True),

StructField('NumAlarms', IntegerType(), True),

StructField('UnitType', StringType(), True),

StructField('UnitSequenceInCallDispatch', IntegerType(), True),

StructField('FirePreventionDistrict', StringType(), True),

StructField('SupervisorDistrict', StringType(), True),

StructField('Neighborhood', StringType(), True),

StructField('Location', StringType(), True),

StructField('RowID', StringType(), True),

StructField('Delay', FloatType(), True)])

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions