¡GoConqr estrena diseño! Cuéntanos qué te parece.

Apuntes

Sin título

pradosa patnaik Inglés 1 página

Contenido del apunte (1)

Página 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

Información

Descripción
Apunte sobre Sin título, creado por pradosa patnaik el 14/07/2018.
Creado por
pradosa patnaik
Visitas
1
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?