nasiflower / My-Coursework-Planner

0 stars 0 forks source link

[TECH ED] SQL Problems using Google Sheets #25

Open nasiflower opened 1 month ago

nasiflower commented 1 month ago

Link to the coursework

https://docs.google.com/spreadsheets/d/1zPeHxhKkYmdiqXNhMwhfC1A0o1wI0zNiD5Gsks2SYoc/template/preview

Why are we doing this?

To practice how to use Google Sheets to store and query data. This should make sure we understand the basics of SQL and how to use it to query data.

We're going to practice extracting data from a database, using SQL. We will use the same data set we used in the Learn about Google Sheets coursework.

Please complete the following tasks:

  1. Emily Smith would like to be able to quickly see how many deals she's made. She only cares about Deal Value and Expected Close date to see when she'll be paid. Create a query that will give only this information.
  2. As the accountant working for this business, I need to work out the total sales we've made in each country to pay our taxes. Write a query to return a list of each closed deal (they have status of "Closed Won") and sort them by country so we can work this out easily.
  3. As the accountant for this business, I need to find out how much we’ve sold in each country to pay our taxes. Deals are only complete when they have the status "Closed Won", so we should only include those deals. To make the data easier to work with, we can sort them by country. Can you write a query to get this information?

Acceptance criteria

Maximum time in hours

1

How to get help

Share your blockers in the ITP Slack.

How to submit

  1. The work should be in the same Google Sheet as the "Learn about Google Sheets" coursework.
  2. Share a link to your Google Sheet. Make sure to give read access to your sheet, you can do this by clicking the "Share" button, then change "Restricted" to "Anyone with the link".
nasiflower commented 1 month ago

https://docs.google.com/spreadsheets/d/1UpVnzufF7njnVsnsCaff9Gp8m6UXt8kos00-v5NWAgo/edit?usp=sharing

1-=QUERY(Sales_data!A1:H ,"SELECT Col5, Col6") 2-=QUERY(Sales_data!A1:H ,"SELECT C, SUM(E) WHERE G = 'Closed Won' GROUP BY C ORDER BY C ASC") 3-=QUERY(Sales_data!A1:H ,"SELECT C,E,G WHERE G = 'Closed Won' ORDER BY C,E ,G desc ") =QUERY({Sales_data!A1:H;Sales_data2!A1:H},"SELECT * WHERE Col1 is not null")