Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

My question here would be simple and has 2 parts, THE LANGUAGE BEING USED HERE IS R! For the easier one, my question asks of

My question here would be simple and has 2 parts, THE LANGUAGE BEING USED HERE IS R!

For the easier one, my question asks of me to calculate the total number of record in the specific query? How to calculcate that? Should I use nrows multiply by ncol to get the answer?

Second is more coding,

image text in transcribed

The second part of this question says to calculcate the sum of all latitudes. Now, I have all latitude numbers, which are from around 32 different variables. How do I get the sum of them from the table I have created? My function to get the result was ==>

q2_sql = "SELECT city, state, zip_code FROM zip WHERE state == 'IL'" head(dbGetQuery(dbcon, q2_sql))

Thanks!

Note that I've made the query string more readable through the use of whitespace. Question 3a, (2 points): Build an SQL query that joins both the 'zip' and the tickets' tables on the 'zip_code' field, and restricts the results to tickets where the fine_level_1 amount is more than $100. What is the sum of the latitudes of all of the records in this query? Note that this sum should not include records for which the latitude is not recorded. (Exercise: why aren't some latitudes recorded after the join?) Note that I've made the query string more readable through the use of whitespace. Question 3a, (2 points): Build an SQL query that joins both the 'zip' and the tickets' tables on the 'zip_code' field, and restricts the results to tickets where the fine_level_1 amount is more than $100. What is the sum of the latitudes of all of the records in this query? Note that this sum should not include records for which the latitude is not recorded. (Exercise: why aren't some latitudes recorded after the join?)

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_2

Step: 3

blur-text-image_3

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

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions

Question

Why should policy makers think about the incentives?

Answered: 1 week ago

Question

What is the relationship between humans and nature?

Answered: 1 week ago