The document contains a series of questions and answers related to analyzing data from various tables in a database including orders, accounts, web_events, and sales_reps tables. It explores queries to retrieve, filter, aggregate, and analyze data from these tables on metrics like total sales amounts, order quantities, account and sales rep information, and event channels. Examples of more complex queries include ranking customers and sales reps by sales amounts, joining tables, using window functions like NTILE, and deriving new columns from existing data.
Q4 Survival Guide: How to Turn Objections into CommissionSales Hacker
What’s the biggest blocker from closing Q4 deals?
How you handle objections.
World-class sales people are masterful when it comes to handling objections, but most sellers lose deals by falling short.
After analyzing 10M+ sales conversations, Gong shared to us how to overcome objections that turns uncertainty into revenue – and it’s all backed by data.
너의 기분 이모지(emoji)? - 감정기반 이모지 추천 시스템 관련 없는 이모티콘(이하 이모지) 단순 나열은 가라! 최근 썼던 이모지를 자동으로 띄워주는 방식 대신, 실제 발화에 해당하는 감정과 사물 이모지를 자동으로 추천해주는 모델을 만들었습니다. 메신저계를 강타할 메가톤급 이모지 추천 서비스 모지모지(MOJIMOJI)로 재밌고 편리하게 메시지를 보내보세요!
Q4 Survival Guide: How to Turn Objections into CommissionSales Hacker
What’s the biggest blocker from closing Q4 deals?
How you handle objections.
World-class sales people are masterful when it comes to handling objections, but most sellers lose deals by falling short.
After analyzing 10M+ sales conversations, Gong shared to us how to overcome objections that turns uncertainty into revenue – and it’s all backed by data.
너의 기분 이모지(emoji)? - 감정기반 이모지 추천 시스템 관련 없는 이모티콘(이하 이모지) 단순 나열은 가라! 최근 썼던 이모지를 자동으로 띄워주는 방식 대신, 실제 발화에 해당하는 감정과 사물 이모지를 자동으로 추천해주는 모델을 만들었습니다. 메신저계를 강타할 메가톤급 이모지 추천 서비스 모지모지(MOJIMOJI)로 재밌고 편리하게 메시지를 보내보세요!
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COMalber22po
Write-Up Questions for the Tanpin Kanri Case
Your Name:
Length Requirement:
While quality answers are the ultimate basis for my grading on this assignment, the following
important length requirement may help ensure that enough effort, thoughts, and details are
demonstrated in the answers. Please input your answers in this document and limit your answer
to about 3 single-spaced pages, using size 12 of Times New Roman font and leave 1-inch margin
As with all projects in this course, your program’s output wil.docxrandymartin91030
As with all projects in this course, your program’s output will display your name, your EUID, your e-mail address, the department name, and course number. This means that your program will print this information to the terminal (see the sample output).
Declare and initialize the following constants and variables.
A global floating-point constant of type double to store the minimum balance for the
business account initialized to 10000.00.
A global floating-point constant to of type double to store the minimum balance for the
personal account initialized to 1000.00.
A global integer constant of type integer to store the length of account number and
initialize it to 6.
A global integer constant of type integer to store the maximum number of transactions
and initialize it to 20.
Declare an enumeration constant with values Business and Personal and assign integer values 0
and 1 to the data items, respectively. They represent the type of bank account.
Declare another enumeration constant with values Process, Display and Quit, and assign suitable integer values 1, 2 and 3 to the data items, respectively. They represent menu choice presented
to the user.
Write a
• •
•
•
Write a
• •
function named
getName
which gets the name on the bank account. Inside the function: Using a suitable message, prompt the user for the name on the account. The name can have multiple words.
Only alphabets (A-Z or a-z) and whitespaces are permitted in the account name.
o If the user enters any other characters in the name, you need to generate an error message and ask for the name again.
o Yourprogrammustkeeponaskingtheusertoenterthenameuntiltheuserentersit correctly.
(SEE SAMPLE OUTPUT 1)
The user may type the name in either uppercase or lowercase, but you need to convert every initial to uppercase.
(SEE SAMPLE OUTPUTS)
This function will be called by the
main
function.
function named
getAccountNumber
which get the account number. Inside the function: Using a suitable message, prompt the user for the number of the account.
The account number must be a 6-digit number.
If the user enters an account number with more than 6 digits generate an error message and ask the user to enter the number again.
Only numbers 0-9 are permitted in the account number. If the user enters an account number with non-numeric characters, generate an error message, and ask the user to enter the number again.
Your program must keep on asking the user to enter the number until the user enters it correctly.
(SEE SAMPLE OUTPUTS 1 and 2)
This function will be called by the
main
function.
7. Write a function named
encrypt_num
. This function must receive the account number using a string variable and encrypt the account number. Inside this function:
Declare an array of integers with size equal to the length of the account number.
Using a loop of your choice, populate the array with seeded .
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docxSHIVA101531
Link to Coffee Shop-- http://extmedia.kaplan.edu/business/Media/AB299/Tims_Coffee_Shop/index.html
Go to The Coffee Shop’s and look in the back office. Inside the file drawer labeled “Business” is the Coffee Shop’s Income Statement for the year for 2011. This is the most recent record the coffee shop has. This year, several large businesses are moving in around his coffee shop and he expects business to increase. You need to create a pro forma profit and loss (income) statement for this year, and you need to help him. In this assignment, discuss whether each area in the pro forma income statement will increase, decrease or stay the same due to large businesses moving into the neighboring buildings into his area and explain your rationale why that line item will increase, decrease or stay the same.
Remember, the coffee shop serves coffee to many people who work in the area, so he would certainly expect a major increase in his business volume.
This assignment is not looking for dollar figures, but primarily your justification on why the line items will change and what direction they will change, if any. You may make assumptions based on the increased sales volume and how it will affect income and expenses, if and when you do make these assumptions, please describe them and their effects on each line item.
These are the line items:
Income earned:
Expenses include:
Salaries
Rent
Depreciation
Supplies
Lease (on your refrigerator)
Tax
Interest (on loans currently held)
Insurance
Checklist:
If and when you made assumptions, based on the increased sales volume and how it will affect income and expenses, please describe them and their effects on each line item.
Given what you have assumed and projected, will the total expenses increase or decrease? Why?
Given what you have assumed and projected, will the net profit increase or decrease? Why?
Directions
Respond to the line items above and the Questions provided in a minimum of 2 pages double-spaced in a Word document, written in APA.
Cover PageComplete and copy the following to Word for your cover page. Be sure that the document is stapled properly. Do not use a plastic cover or folder.In the Footer of the Word documents, add the Now() function to show what day and time the documents were printed.Submit the Excel file to CANVAS as: lastname_firstname.xls. Hand-in the Word document immediately prior to Exam 1.Although students are encouraged to ask questions for clarification, this exercise is intended to be well within the capability of students at the 3000 level and studentsshould be able to complete the project with minimal assistance. Instructions are included on each worksheet but feel free to request clarification.ACG 3401 Accounting Information SystemsExcel AssignmentSubmitted By:Name Last: First:<-- Only use this for cover page.Spring 2015By submitting this document, I affirm that the work is the product of my own effo ...
Statement of Operations and Financial StatementsSubmit written r.docxwhitneyleman54422
Statement of Operations and Financial Statements
Submit written responses to these questions.
This assignment needs to be in APA style, plagiarism free, and each to understand.
1. List several efforts that have been enacted by payors to control costs.
2. Explain the ramifications of allowing/disallowing an individual to be able to sue his or her HMO.
3. What are each of the financial statements commonly called in for-profit health care organizations and in not for-profit care organizations?
The following questions relate to the statement of operations of not for-profit health care organizations.
1. What is the analogous for-profit statement called? What are the main sections of the statement of operations?
2. What are revenues, gains, and other support?
3. What are expenses and losses?
4. Funds released from restricted net assets to unrestricted net assets are presented in what section of the statement of revenue, expenses and other activities?
The following questions relate to the statement of changes in net assets.
1. What is the traditional name for this statement?
2. What is the purpose of this statement?
3. What are the main sections of this statement?
4. Discuss the difference between permanently restricted and temporarily restricted net assets.
The following questions relate to the statement of cash flows of a not-profit health care organization.
1. What are its main sections?
2. What is the purpose of this statement?
3. Where in the financial statements would there be important explanatory information?
4. In what financial statement would one identify the purchase of long-term investments?
5. How does the accrual basis of accounting differ from the cash basis of accounting?
1
Foundations of Technical Programming
ASSIGNMENT (25%)
Q.1 Computers are often used for data analysis to compile and analyze the results of
surveys and opinion polls. You are asked to write a complete C program to use array
response initialized with 99 responses to a survey. Each response is a number from
1 to 9. The program computes the mean, median and mode of the 99 values. In your
program, you need to
(i) Define a function mean() to compute the mean by totalling 99 elements and
dividing the result by 99.
(ii) Define a function median(), to determine the median, that sorts the array of
responses into ascending order, then picking the middle element of the
sorted array.
(iii) Define a function mode() to determine the mode by counting the number of
responses of each type then selecting the value with the greatest count.
(iv) Print out the responses, frequencies and the corresponding histogram.
The following shows the sample run of your program:
The unsorted array of responses is
7875616546578352447
87987869874649352765
35798989872989787876
98798989877878939876
87878959879898789876
The sorted array is
9999999999999999999
88888888888888888888
88888887777777777777
77777777776666666665
55555554444433332.
Week 5 & 6 Query Project Open the CUSTOMER file .docxmelbruce90096
Week 5 & 6 Query Project
Open the CUSTOMER file
Create a Query screen with the CUST table and perform the following queries. Save the query as query1,
query2 etc. there will be 16 queries at the end.
Save the database file with your name, or change the file name to your name, and upload using the assignment
tool “drop-box”, for grading.
1 Last name beginning with "S" and first name
beginning with "R" from California
1
2 California with prices between $500 and $1000 1
3 Everyone who lives on a drive (meaning “Dr.” in
Street address)
1
4 Street name beginning with W (remember that
there is a number in front of the street name that
you do not know) It’s tricky but try it. Think of the
“pieces” that makeup the address.
3
5 California customers except for San Francisco 1
6 Parameter query (the interactive one with the [
prompt ] that requests “please enter the state
name” .
1
7 Zip code beginning with 9 and ending with 0 1
8 The states NY, CA and WA only 1
9 Qty 4 and higher and from CA, NY and WA 1
10 Smith from CA as well as WA, along with anyone
with a price over $300
2
11 Make another parameter query so the user can
enter a Street name without knowing the “house
number” Example: Pine. If more than one record
show for “Pine”, the query is not correct!
3
12 Sort by STATE, LAST and FIRST. One step. One
sort.
1
13 Calculate the Total (PRICE * QTY)
Calculate a 10% discount
Calculate the new Total
3
14 Create a new column, CUSTOMER as shown with both
Last name, First Name:
2
Open CUST2 for the following queries. You will be using the second customer table provided for these queries.
The field contents have been modified slightly so that corrections are needed. There is a CITY_STATE field that
contains both city and state. This is a common occurrence, although I don’t know why companies insist on doing
this.
15 Your task is to separate out the state as shown below.
4
16
Can you separate out the City as shown above?
You would need to extract from the left, correct? Use the LEFT function (LEFT(fieldname,# of
characters), but the LEFT function needs to know exactly how many characters you want, and
obviously the number of characters you want, changes based on the length of the city name. So
what to do? In the second argument of the LEFT function, instead of specifying an actual number,
maybe you could use something that can give you the exact length of the contents of the field,
and you can subtract the two character state, space and comma?)
6
17.
Extra-
Credit
for the
brave
and
curious
Can you separate out the street name so you can sort by street name? This is a very common
problem that not many can do. This is just for fun and curiosity. I will of course explain the whole
thing after you have had time to think, chat, and sadly, get it from the internet. Well at least it
shows persistence.
5
Unit 4
.
Techniques to optimize the pagerank algorithm usually fall in two categories. One is to try reducing the work per iteration, and the other is to try reducing the number of iterations. These goals are often at odds with one another. Skipping computation on vertices which have already converged has the potential to save iteration time. Skipping in-identical vertices, with the same in-links, helps reduce duplicate computations and thus could help reduce iteration time. Road networks often have chains which can be short-circuited before pagerank computation to improve performance. Final ranks of chain nodes can be easily calculated. This could reduce both the iteration time, and the number of iterations. If a graph has no dangling nodes, pagerank of each strongly connected component can be computed in topological order. This could help reduce the iteration time, no. of iterations, and also enable multi-iteration concurrency in pagerank computation. The combination of all of the above methods is the STICD algorithm. [sticd] For dynamic graphs, unchanged components whose ranks are unaffected can be skipped altogether.
Explore our comprehensive data analysis project presentation on predicting product ad campaign performance. Learn how data-driven insights can optimize your marketing strategies and enhance campaign effectiveness. Perfect for professionals and students looking to understand the power of data analysis in advertising. for more details visit: https://bostoninstituteofanalytics.org/data-science-and-artificial-intelligence/
FIN 540 WRITE-UP QUESTIONS FOR THE TANPIN KANRI CASE/ TUTORIALOUTLET DOT COMalber22po
Write-Up Questions for the Tanpin Kanri Case
Your Name:
Length Requirement:
While quality answers are the ultimate basis for my grading on this assignment, the following
important length requirement may help ensure that enough effort, thoughts, and details are
demonstrated in the answers. Please input your answers in this document and limit your answer
to about 3 single-spaced pages, using size 12 of Times New Roman font and leave 1-inch margin
As with all projects in this course, your program’s output wil.docxrandymartin91030
As with all projects in this course, your program’s output will display your name, your EUID, your e-mail address, the department name, and course number. This means that your program will print this information to the terminal (see the sample output).
Declare and initialize the following constants and variables.
A global floating-point constant of type double to store the minimum balance for the
business account initialized to 10000.00.
A global floating-point constant to of type double to store the minimum balance for the
personal account initialized to 1000.00.
A global integer constant of type integer to store the length of account number and
initialize it to 6.
A global integer constant of type integer to store the maximum number of transactions
and initialize it to 20.
Declare an enumeration constant with values Business and Personal and assign integer values 0
and 1 to the data items, respectively. They represent the type of bank account.
Declare another enumeration constant with values Process, Display and Quit, and assign suitable integer values 1, 2 and 3 to the data items, respectively. They represent menu choice presented
to the user.
Write a
• •
•
•
Write a
• •
function named
getName
which gets the name on the bank account. Inside the function: Using a suitable message, prompt the user for the name on the account. The name can have multiple words.
Only alphabets (A-Z or a-z) and whitespaces are permitted in the account name.
o If the user enters any other characters in the name, you need to generate an error message and ask for the name again.
o Yourprogrammustkeeponaskingtheusertoenterthenameuntiltheuserentersit correctly.
(SEE SAMPLE OUTPUT 1)
The user may type the name in either uppercase or lowercase, but you need to convert every initial to uppercase.
(SEE SAMPLE OUTPUTS)
This function will be called by the
main
function.
function named
getAccountNumber
which get the account number. Inside the function: Using a suitable message, prompt the user for the number of the account.
The account number must be a 6-digit number.
If the user enters an account number with more than 6 digits generate an error message and ask the user to enter the number again.
Only numbers 0-9 are permitted in the account number. If the user enters an account number with non-numeric characters, generate an error message, and ask the user to enter the number again.
Your program must keep on asking the user to enter the number until the user enters it correctly.
(SEE SAMPLE OUTPUTS 1 and 2)
This function will be called by the
main
function.
7. Write a function named
encrypt_num
. This function must receive the account number using a string variable and encrypt the account number. Inside this function:
Declare an array of integers with size equal to the length of the account number.
Using a loop of your choice, populate the array with seeded .
Link to Coffee Shop-- httpextmedia.kaplan.edubusinessMediaAB.docxSHIVA101531
Link to Coffee Shop-- http://extmedia.kaplan.edu/business/Media/AB299/Tims_Coffee_Shop/index.html
Go to The Coffee Shop’s and look in the back office. Inside the file drawer labeled “Business” is the Coffee Shop’s Income Statement for the year for 2011. This is the most recent record the coffee shop has. This year, several large businesses are moving in around his coffee shop and he expects business to increase. You need to create a pro forma profit and loss (income) statement for this year, and you need to help him. In this assignment, discuss whether each area in the pro forma income statement will increase, decrease or stay the same due to large businesses moving into the neighboring buildings into his area and explain your rationale why that line item will increase, decrease or stay the same.
Remember, the coffee shop serves coffee to many people who work in the area, so he would certainly expect a major increase in his business volume.
This assignment is not looking for dollar figures, but primarily your justification on why the line items will change and what direction they will change, if any. You may make assumptions based on the increased sales volume and how it will affect income and expenses, if and when you do make these assumptions, please describe them and their effects on each line item.
These are the line items:
Income earned:
Expenses include:
Salaries
Rent
Depreciation
Supplies
Lease (on your refrigerator)
Tax
Interest (on loans currently held)
Insurance
Checklist:
If and when you made assumptions, based on the increased sales volume and how it will affect income and expenses, please describe them and their effects on each line item.
Given what you have assumed and projected, will the total expenses increase or decrease? Why?
Given what you have assumed and projected, will the net profit increase or decrease? Why?
Directions
Respond to the line items above and the Questions provided in a minimum of 2 pages double-spaced in a Word document, written in APA.
Cover PageComplete and copy the following to Word for your cover page. Be sure that the document is stapled properly. Do not use a plastic cover or folder.In the Footer of the Word documents, add the Now() function to show what day and time the documents were printed.Submit the Excel file to CANVAS as: lastname_firstname.xls. Hand-in the Word document immediately prior to Exam 1.Although students are encouraged to ask questions for clarification, this exercise is intended to be well within the capability of students at the 3000 level and studentsshould be able to complete the project with minimal assistance. Instructions are included on each worksheet but feel free to request clarification.ACG 3401 Accounting Information SystemsExcel AssignmentSubmitted By:Name Last: First:<-- Only use this for cover page.Spring 2015By submitting this document, I affirm that the work is the product of my own effo ...
Statement of Operations and Financial StatementsSubmit written r.docxwhitneyleman54422
Statement of Operations and Financial Statements
Submit written responses to these questions.
This assignment needs to be in APA style, plagiarism free, and each to understand.
1. List several efforts that have been enacted by payors to control costs.
2. Explain the ramifications of allowing/disallowing an individual to be able to sue his or her HMO.
3. What are each of the financial statements commonly called in for-profit health care organizations and in not for-profit care organizations?
The following questions relate to the statement of operations of not for-profit health care organizations.
1. What is the analogous for-profit statement called? What are the main sections of the statement of operations?
2. What are revenues, gains, and other support?
3. What are expenses and losses?
4. Funds released from restricted net assets to unrestricted net assets are presented in what section of the statement of revenue, expenses and other activities?
The following questions relate to the statement of changes in net assets.
1. What is the traditional name for this statement?
2. What is the purpose of this statement?
3. What are the main sections of this statement?
4. Discuss the difference between permanently restricted and temporarily restricted net assets.
The following questions relate to the statement of cash flows of a not-profit health care organization.
1. What are its main sections?
2. What is the purpose of this statement?
3. Where in the financial statements would there be important explanatory information?
4. In what financial statement would one identify the purchase of long-term investments?
5. How does the accrual basis of accounting differ from the cash basis of accounting?
1
Foundations of Technical Programming
ASSIGNMENT (25%)
Q.1 Computers are often used for data analysis to compile and analyze the results of
surveys and opinion polls. You are asked to write a complete C program to use array
response initialized with 99 responses to a survey. Each response is a number from
1 to 9. The program computes the mean, median and mode of the 99 values. In your
program, you need to
(i) Define a function mean() to compute the mean by totalling 99 elements and
dividing the result by 99.
(ii) Define a function median(), to determine the median, that sorts the array of
responses into ascending order, then picking the middle element of the
sorted array.
(iii) Define a function mode() to determine the mode by counting the number of
responses of each type then selecting the value with the greatest count.
(iv) Print out the responses, frequencies and the corresponding histogram.
The following shows the sample run of your program:
The unsorted array of responses is
7875616546578352447
87987869874649352765
35798989872989787876
98798989877878939876
87878959879898789876
The sorted array is
9999999999999999999
88888888888888888888
88888887777777777777
77777777776666666665
55555554444433332.
Week 5 & 6 Query Project Open the CUSTOMER file .docxmelbruce90096
Week 5 & 6 Query Project
Open the CUSTOMER file
Create a Query screen with the CUST table and perform the following queries. Save the query as query1,
query2 etc. there will be 16 queries at the end.
Save the database file with your name, or change the file name to your name, and upload using the assignment
tool “drop-box”, for grading.
1 Last name beginning with "S" and first name
beginning with "R" from California
1
2 California with prices between $500 and $1000 1
3 Everyone who lives on a drive (meaning “Dr.” in
Street address)
1
4 Street name beginning with W (remember that
there is a number in front of the street name that
you do not know) It’s tricky but try it. Think of the
“pieces” that makeup the address.
3
5 California customers except for San Francisco 1
6 Parameter query (the interactive one with the [
prompt ] that requests “please enter the state
name” .
1
7 Zip code beginning with 9 and ending with 0 1
8 The states NY, CA and WA only 1
9 Qty 4 and higher and from CA, NY and WA 1
10 Smith from CA as well as WA, along with anyone
with a price over $300
2
11 Make another parameter query so the user can
enter a Street name without knowing the “house
number” Example: Pine. If more than one record
show for “Pine”, the query is not correct!
3
12 Sort by STATE, LAST and FIRST. One step. One
sort.
1
13 Calculate the Total (PRICE * QTY)
Calculate a 10% discount
Calculate the new Total
3
14 Create a new column, CUSTOMER as shown with both
Last name, First Name:
2
Open CUST2 for the following queries. You will be using the second customer table provided for these queries.
The field contents have been modified slightly so that corrections are needed. There is a CITY_STATE field that
contains both city and state. This is a common occurrence, although I don’t know why companies insist on doing
this.
15 Your task is to separate out the state as shown below.
4
16
Can you separate out the City as shown above?
You would need to extract from the left, correct? Use the LEFT function (LEFT(fieldname,# of
characters), but the LEFT function needs to know exactly how many characters you want, and
obviously the number of characters you want, changes based on the length of the city name. So
what to do? In the second argument of the LEFT function, instead of specifying an actual number,
maybe you could use something that can give you the exact length of the contents of the field,
and you can subtract the two character state, space and comma?)
6
17.
Extra-
Credit
for the
brave
and
curious
Can you separate out the street name so you can sort by street name? This is a very common
problem that not many can do. This is just for fun and curiosity. I will of course explain the whole
thing after you have had time to think, chat, and sadly, get it from the internet. Well at least it
shows persistence.
5
Unit 4
.
Techniques to optimize the pagerank algorithm usually fall in two categories. One is to try reducing the work per iteration, and the other is to try reducing the number of iterations. These goals are often at odds with one another. Skipping computation on vertices which have already converged has the potential to save iteration time. Skipping in-identical vertices, with the same in-links, helps reduce duplicate computations and thus could help reduce iteration time. Road networks often have chains which can be short-circuited before pagerank computation to improve performance. Final ranks of chain nodes can be easily calculated. This could reduce both the iteration time, and the number of iterations. If a graph has no dangling nodes, pagerank of each strongly connected component can be computed in topological order. This could help reduce the iteration time, no. of iterations, and also enable multi-iteration concurrency in pagerank computation. The combination of all of the above methods is the STICD algorithm. [sticd] For dynamic graphs, unchanged components whose ranks are unaffected can be skipped altogether.
Explore our comprehensive data analysis project presentation on predicting product ad campaign performance. Learn how data-driven insights can optimize your marketing strategies and enhance campaign effectiveness. Perfect for professionals and students looking to understand the power of data analysis in advertising. for more details visit: https://bostoninstituteofanalytics.org/data-science-and-artificial-intelligence/
1. Question: Write a query that displays the order ID, account ID, and total dollar amount for
all the orders, sorted first by the account ID (in ascending order), and then by the total
amount (in descending order).
Answer:
Question: Pulls the first 5 rows and all columns from the orders table that have a dollar amount o f
gloss_amt_usd greater than or equal to 1000.
Answer:
2. Question: Filter the accounts table to include the company name, website, and the primary point of
contact (primary_poc) just for the Exxon Mobil company in the accounts table.
Answer:
3. Questions: Create a column that divides the standard_amt_usd by the standard_qty to find the unit
price for standard paper for each order. Limit the results to the first 10 orders, and include
the id and account_id fields.
Answer:
Question: All the companies whose names start with 'C'.
Answer:
4. Question: All companies whose names contain the string 'one' somewhere in the name.
Answer:
Question: All companies whose names end with 's'.
Answer:
5. Question: Use the web_events table to find all information regarding individuals who were
contacted via the channel of organic or adwords.
Answer:
Question: Write a query that returns all the orders where the standard_qty is over 1000,
the poster_qty is 0, and the gloss_qty is 0.
Answer:
6. Question: When you use the BETWEEN operator in SQL, do the results include the values of your
endpoints, or not? Figure out the answer to this important question by writing a query that displays
the order date and gloss_qty data for all orders where gloss_qty is between 24 and 29. Then look
at your output to see if the BETWEEN operator included the begin and end values or not.
Answer:
Question: You will notice that using BETWEEN is tricky for dates! While BETWEEN is generally
inclusive of endpoints, it assumes the time is at 00:00:00 (i.e. midnight) for dates. This is the reason
why we set the right-side endpoint of the period at '2017-01-01'.
7. Answer:
Question: Write a query that returns a list of orders where the standard_qty is zero and either
the gloss_qty or poster_qty is over 1000.
Answer:
Question: Find all the company names that start with a 'C' or 'W', and the primary
contact contains 'ana' or 'Ana', but it doesn't contain 'eana'.
8. Answer:
Question: Try pulling standard_qty, gloss_qty, and poster_qty from the orders table, and
the website and the primary_poc from the accounts table.
Answer:
ERD diagram:
9. Question: Provide a table for all web_events associated with account name of Walmart. There
should be three columns. Be sure to include the primary_poc, time of the event, and the channel for
each event. Additionally, you might choose to add a fourth column to assure only Walmart events
were chosen.
Answer:
10. Question: Provide the name for each region for every order, as well as the account name and
the unit price they paid (total_amt_usd/total) for the order. Your final table should have 3
columns: region name, account name, and unit price. A few accounts have 0 for total, so I divided
by (total + 0.01) to assure not dividing by zero.
Answer:
Question: Provide a table that provides the region for each sales_rep along with their
associated accounts. This time only for accounts where the sales rep has a first name starting
with S and in the Midwest region. Your final table should include three columns: the region name,
the sales rep name, and the account name. Sort the accounts alphabetically (A-Z) according to
account name.
11. Answer:
1.
Question: Provide the name for each region for every order, as well as the account name and
the unit price they paid (total_amt_usd/total) for the order. However, you should only provide the
results if the standard order quantity exceeds 100 and the poster order quantity exceeds 50.
Your final table should have 3 columns: region name, account name, and unit price. Sort for the
smallest unit price first. In order to avoid a division by zero error, adding .01 to the denominator
here is helpful (total_amt_usd/(total+0.01).
Answer:
12. Question: What are the different channels used by account id 1001? Your final table should have
only 2 columns: account name and the different channels. You can try SELECT DISTINCT to
narrow down the results to only the unique values.
Answer:
Question: Find all the orders that occurred in 2015. Your final table should have 4
columns: occurred_at, account name, order total, and order total_amt_usd.
Answer:
13. Question: Find the total amount spent on standard_amt_usd and gloss_amt_usd paper for
each order in the orders table. This should give a dollar amount for each order in the table.
Answer:
Question : Find the mean (AVERAGE) amount spent per order on each paper type, as well
as the mean amount of each paper type purchased per order. Your final answer should have
6 values - one for each paper type for the average number of sales, as well as the average
amount.
14. Answer:
Question: Who was the primary contact associated with the earliest web_event?
Answer:
Question: What was the smallest order placed by each account in terms of total usd.
Provide only two columns - the account name and the total usd. Order from smallest dollar
amounts to largest
Answer:
15. Question: Find the number of sales reps in each region. Your final table should have two
columns - the region and the number of sales_reps. Order from fewest reps to most reps.
Answer:
Question: Determine the number of times a particular channel was used in
the web_events table for each region. Your final table should have three columns -
the region name, the channel, and the number of occurrences. Order your table with the
highest number of occurrences first.
16. Answer:
Question : How many of the sales reps have more than 5 accounts that they manage?
Answer:
Question : How many accounts have more than 20 orders?
Answer:
17. Question: Which account has the most orders?
Answer:
Question : How many accounts spent more than 30,000 usd total across all orders?
Answer :
18. Question : How many accounts spent less than 1,000 usd total across all orders?
Answer :
Question : Which account has spent the most with us?
19. Answer :
Question : Which accounts used facebook as a channel to contact customers more than 6
times?
Answer :
20. Question : Which account used facebook most as a channel?
Answer:
Question : Which channel was most frequently used by most accounts?
Answer :
21. Question : Find the sales in terms of total dollars for all orders in each year, ordered from
greatest to least. Do you notice any trends in the yearly sales totals?
Answer :
Question : In which month of which year did Walmart spend the most on gloss paper in
terms of dollars?
Answer:
22. Question : We would now like to perform a similar calculation to the first, but we want to
obtain the total amount spent by customers only in 2016 and 2017. Keep the same levels as
in the previous question. Order with the top spending customers listed first.
Answer :
Question : The previous didn't account for the middle, nor the dollar amount associated
with the sales. Management decides they want to see these characteristics represented as
well. We would like to identify top performing sales reps, which are sales reps associated
with more than 200 orders or more than 750000 in total sales. The middle group has
any rep with more than 150 orders or 500000 in sales. Create a table with the sales rep
name, the total number of orders, total sales across all orders, and a column
with top, middle, or low depending on this criteria. Place the top sales people based on
dollar amount of sales first in your final table.
Answer :
23. Question : Provide the name of the sales_rep in each region with the largest amount
of total_amt_usd sales.
Answer:
First, I wanted to find the total_amt_usd totals associated with each sales rep, and I also
wanted the region in which they were located. The query below provided this information.
Next, I pulled the max for each region, and then we can use this to pull those rows in
our final result.
24. Essentially, this is a JOIN of these two tables, where the region and amount match.
25. Question : How many accounts had more total purchases than the account name which
has bought the most standard_qty paper throughout their lifetime as a customer?
Answer :
First, we want to find the account that had the most standard_qty paper. The query here
pulls that account, as well as the total amount:
Now, I want to use this to pull all the accounts with more total sales:
This is now a list of all the accounts with more total orders. We can get the count with just
another simple subquery.
26. Question : For the customer that spent the most (in total over their lifetime as a
customer) total_amt_usd, how many web_events did they have for each channel.
Answer :
Here, we first want to pull the customer with the most spent in lifetime value.
Now, we want to look at the number of events on each channel this company had, which we
can match with just the id.
27. Question : What is the lifetime average amount spent in terms of total_amt_usd for the top
10 total spending accounts?
Answer :
First, we just want to find the top 10 accounts in terms of highest total_amt_usd.
Now, we just want the average of these 10 amounts.
28. Question : What is the lifetime average amount spent in terms of total_amt_usd, including
only the companies that spent more per order, on average, than the average of all orders.
Answer :
First, we want to pull the average of all accounts in terms of total_amt_usd
Then, we want to only pull the accounts with more than this average amount.
29. Finally, we just want the average of these values
Question : There are 350 company names that start with a letter and 1 that starts with a
number. This gives a ratio of 350/351 that are company names that start with a letter or
99.7%.
Answer :
30. Question : There are 80 company names that start with a vowel and 271 that start with
other characters. Therefore 80/351 are vowels or 22.8%. Therefore, 77.2% of company
names do not start with vowels.
Answer:
Question : Use the accounts table to create first and last name columns that hold the first and last
names for the primary_poc
Answer :
31. Question : We would also like to create an initial password, which they will change after
their first log in. The first password will be the first letter of the primary_poc's first name
(lowercase), then the last letter of their first name (lowercase), the first letter of their last
name (lowercase), the last letter of their last name (lowercase), the number of letters in
their first name, the number of letters in their last name, and then the name of the company
they are working with, all capitalized with no spaces.
Answer:
32. Question : Use the NTILE functionality to divide the accounts into 4 levels in terms of the
amount of standard_qty for their orders. Your resulting table should have the account_id,
the occurred_at time for each order, the total amount of standard_qty paper purchased,
and one of four levels in a standard_quartile column.
Answer :
Question : Use the NTILE functionality to divide the accounts into two levels in terms of the
amount of gloss_qty for their orders. Your resulting table should have the account_id,
the occurred_at time for each order, the total amount of gloss_qty paper purchased, and
one of two levels in a gloss_half column.
Answer :
33. Question : What is the relationship
between accounts.primary_poc and sales_reps.name?
Answer: