GoConqr has a new look! Let us know what you think.

Notes

Untitled

pradosa patnaik English 1 page

Content of the notes (1)

Page 1

Quesions ON JOIN

Q1) 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.

SELECT a.primary_poc, w.channel, w.occurred_At , a.name FROM accounts as a JOIN web_events as w ON a.id=w.account_id WHERE a.name='Walmart'

Q2) Provide a table that provides the region for each sales_rep along with their associated accounts. 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.

SELECT r.name as region_name, s.name as sales_rep_name, a.name as accounts_name FROM region as r JOIN sales_reps as s ON r.id=s.region_id JOIN accounts as a ON a.sales_rep_id=s.id ORDER BY accounts_name

Information

Description
Note on Untitled, created by pradosa patnaik on 14/07/2018.
Created by
pradosa patnaik
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?