0

I'm having a really hard time trying to figure out how to make the following search:

"Find the sellers specialized in selling cars of the year (They can only sell cars produced during a specific year, example 2010).

The tables I have are:

Seller: {Seller_Id, Name, City_Residence}
Business: {Car_Id,Seller_Id,Year_car_Produced, Business_Date, Price}
Car: {Car_Id, Model, Brand, Country, Table_Price}

I was thinking about doing a DISTINCT for the Year_car_Produced but that doesn't mean the Seller couldn't sell cars in different years. I would only get the different cars he sold per year.

Can someone help me?

I'd really appreciate it.

Edited by Diogo Martinho: n/a

2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by Diogo Martinho
0

I want to find the name of the Seller who sell cars only during a specific year.
For example, I have three sellers:

John - John sold two cars (no matter the model), one in 2007 and another in 2008.
Gary - Gary sold three cars (no matter the model), all in 2009
Peter - Peter sold one car in 2010

After the SQL search only the names of Gary and Peter would show up in the results since they were the only ones who were sold cars during a single year, 2009 for Gary and 2010 for Peter.

0

In that case you need to join the tables Seller and Business on Seller_Id and filter by Year_car_Produced.

0

In that case you need to join the tables Seller and Business on Seller_Id and filter by Year_car_Produced.

That would be possible if I was working with static values.
I don't know the years included in the table so I can't say:

Select s.name, s.Year_car_Produced from Sellers s, Car c, Bussiness b
Where s.Seller_id = b.Seller_id and b.Car_Id = c.Car_Id
Group By s.Year_car_Produced

0

Never mind.
I thank you for all the help but I realized there is no need to work over this anymore.

Thanks debasisdas

Edited by Diogo Martinho: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.