QuestionQuestion

Please organize all your code and outputs in one pdf file. Also submit a csv file for very long output if required.

1 Select Query
• Import data from banks al 2001.csv
Count the number of banks whose equity is over 10% of its asset in the first quarter(hint: equity = asset-liability).
What is the average liability value for banks whose asset is higher than average asset value in first quarter.
• Display certs for top five largest banks for each quarter
• Count number of banks for each quarter with one query

2 Querying Multiple Tables
What is the difference between inner join and intersect? Please give an example.
• Delete duplicate rows from banks sec 2002
Import data from banks sec 2002 and banks al 2002.csv. How many banks having security over 20% of its’ asset in the first quarter of both 2001 and 2002.
How many banks have liability over 90% of assets in last quarter of 2001 but goes below 90% in first quarter of 2002.
Import data from banks sec 2002.csv. Get banks’ asset and security whose security is over average in first quarter of 2002. Export the result to a csv file.
Create a new table banks al. Copy all the records from the any two existing tables in database to this new table. Then set a primary key for the table.

3 API
• Use R API to run a SELECT query to extract records from banks al 2001.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

setwd("~/Documents/24/Josh")
my_data<-read.csv("ckd.csv")
View(my_data)
str(my_data)

levels(my_data$famhist)
my_data$chd<-as.factor(my_data$chd)
my_data$age<-as.numeric(my_data$age)
my_data$sbp<-as.numeric(my_data$sbp)
my_data$typea<-as.numeric(my_data$typea)
str(my_data)
summary(my_data)


require(knitr)
require(dplyr)
require(ggplot2)
require(readr)
require(gridExtra)
#Bivariate plots
list_chd <- list()

for (var in colnames(my_data) ){
if (class(my_data[,var]) %in% c("factor") ) {
    list_chd[[var]] <- ggplot(data =my_data) +
      geom_bar( aes_string(x = var, fill ="chd" ), position = "fill") +
      theme_linedraw() +
      xlab(var)...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$90.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Statistics-R Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats