Ebay Interview Question for Analysts


Country: United States
Interview Type: Phone Interview




Comment hidden because of low score. Click to expand.
6
of 6 vote

SELECT 
  avg(table1.price), 
  table2.zipcode
FROM 
  table1, 
  table2
WHERE 
  table1.transaction_id = table2.transaction_id
GROUP BY table2.zipcode
Having avg(table1.price)>5;

- vijay.edella August 26, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
3
of 3 vote

This sql is based on MS-SQL

Select a.zipcode as Zipcode , AVG(b.price) as averagePrice
From [Table2] a inner join [Table1] b on a.transaction_id = b.transaction_id
Group by a.zipcode
--upto here, Question 1
Having AVG(b.price) > 5
--above line is for Question 2

- yunjin.choi.sa August 26, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

-- To find average price per zipcode
select 
t2.zipcode
, avg(t1.price) as avgprice
from table1 t1 join table2 t2
on t1.transactionid = t2.transactionid
group by t2.zipcode

-- To find zipcode having avg price > $5
select 
t2.zipcode
, avg(t1.price) as avgprice
from table1 t1 join table2 t2
on t1.transactionid = t2.transactionid
group by t2.zipcode
having avg(t1.price) > 5

- Niraj September 05, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

select zipcode avg(price) from table 2 join table 1 on table 1.id=table 2.id group by zipcode
having avg(price)>5

- Anonymous May 09, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

select t2.zip_code,avg(t1.price) from table2 t2
left outer join table1 t1 on
t2.transaction_id=t1.transaction_id
group by t2.zip_code
having avg(t1.price) > 5

- itsmeashishsingh February 07, 2019 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More