QuestionQuestion

Use the bank database you created to perform the following
1. Write a query that returns the account ID for each nonbusiness customer.cust_type_cd =' 'I') along with the customer's federal ID customer.fed_id). Run the query using MySQL Workbench and R.
2. Now modify the same query to add the name of the product on which the account is based (product.name).
3. Construct a query that finds all employees whose supervisor is assigned to a different department. Retrieve the employees' ID, first name, and last name.
4. Write a query that returns all product names along with the accounts based on that product (use the product cd column in the account table to link to the product table). Include all products, even if no accounts have been opened for that product.
5. Outer-join the account table to both the individual and business tables (via the account. cust id column) such that the result set contains one row per account.
Columns to include are account.account_id, account.product_cd, individual.fname individual.Iname, and business.name. Run query in both MySQL Workbench and R
6. Write a compound query that finds the first and last names of all individual customers along with the first and last names of all employees sorted in descending order by first name and last name
7. Write a query that returns the 17th through 25th characters of the string 'Please find the substring in this string'.
8. Write a query to return just the month portion of the current date
9. Find the total available balance by product and branch where there is more than one account per product and branch. Order the results by total balance (highest to lowest).
10. Construct a query against the account table that uses a filter condition with a subquery against the product table to find all loan accounts product.product type cd = 'LOAN'). Retrieve the account ID, product code, customer ID, and available balance.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

-- 1.
SELECT
    A.account_id, C.fed_id
FROM
    Bank.customer C
       INNER JOIN
    Bank.account A ON C.cust_id = A.cust_id
WHERE
    C.cust_type_cd="I";
   
   
-- 2.   
SELECT
    A.account_id, C.fed_id, P.name
FROM
    Bank.customer C
       INNER JOIN
    Bank.account A ON C.cust...
$30.00 for this solution

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

Find A Tutor

View available Programming (Dynamic, Linear, Non-linear, etc.) 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