Answer 1
The first sample of vendors by the city name, sorted by age would look like this:
select
s.Name, s.Years, c.City
from
Sellers s
left join
City c
ON.
c.CityID = s.CityID
where
c.City = 'city'
order by s.years desc - if the field is the age of years
- order by s.years asc - and if this is the year of birth as
The second sample, if I correctly understand the conditions will be such:
select
b.Name
from
Buyers b
left join
([Buyers shops] bs, Shops s)
ON.
(Bs.BuyersID = b.BuyersID and s.ShopsID = bs.ShopID)
where
s.ShopsID in (
select
bs1.ShopID
from
[Buyers shops] bs1
left join
Buyers b1
ON.
bs1.BuyersID = b1.BuyersID
where
b1.name = 'name of the buyer'
)