Hello, help plz, already nothing climbs into the head

Task: 19 (training) For each manufacturer, find the average screen size of the notebook PCs they produce. Output: maker, average screen size.

select ol.maker, AVG(ol.screen) from (select pr.maker as maker, pr.model as model_1, l.model as model_2, l.screen as screen from laptop l, product pr where pr.maker = 'A' and l.model = pr.model ) as OL group by ol.maker union all select ol.maker, AVG(ol.screen) from (select pr.maker as maker, pr.model as model_1, l.model as model_2, l.screen as screen from laptop l, product pr where pr.maker = 'B' and l.model = pr.model ) as OL group by ol.maker union all select ol.maker, AVG(ol.screen) from (select pr.maker as maker, pr.model as model_1, l.model as model_2, l.screen as screen from laptop l, product pr where pr.maker = 'C' and l.model = pr.model ) as OL group by ol.maker union all select ol.maker, AVG(ol.screen) from (select pr.maker as maker, pr.model as model_1, l.model as model_2, l.screen as screen from laptop l, product pr where pr.maker = 'D' and l.model = pr.model ) as OL group by ol.maker union all select ol.maker, AVG(ol.screen) from (select pr.maker as maker, pr.model as model_1, l.model as model_2, l.screen as screen from laptop l, product pr where pr.maker = 'E' and l.model = pr.model ) as OL group by ol.maker 

Your request returned the correct data on the main database, but did not pass the test on the test database.

  • Incorrect number of entries (less than 4)

What am I doing wrong?

  • Look towards HAVING. - avp
  • four
    I would ban for such questions, as everyone immediately wanted to become certified with the advent of hashcode.ru. Or do you think the respondents here do not understand where the questions come from? Will you indicate in the certificate that a group of professionals worked with hashcode.ru? - SoftR
  • Dear SoftR, especially for YOU: ... who decided all the rating exercises up to # 64 inclusive ... The rules are not violated, you first read what is written question 19 (TRAINING), and then say something about Ban - Mihail
  • @ Mikhail Matveyev, I repeat, especially for you. I would get banned for asking for help when trying to certify, if you want to have certification, study, practice and hand over, rather than go all over the internet to find a solution. I don’t care deeply about the rules of that resource, but as a person who has more than one certification on different topics, it’s not nice that a person wants to get a crust (to satisfy his ego) using the knowledge of others. - SoftR
  • one
    @SoftR, so what about trolling? He asked a question, you know the answer - answer, you do not know, do not answer, everything is simple, and if for what purpose he asks for these answers - what do you care? Let him study - Gorets

1 answer 1

Do not believe this decision!

 select maker, avg(screen) from product, laptop where product.model = laptop.model group by maker 
  • Well, you see, and there was no need to post it all and wash your noodles about “learning” ... - Zowie
  • And, I remember, there is a sign for the answer to your question)) Another vote will turn out. - Dem
  • And what a sign? - Mihail
  • Self-Taught - An answer was given to your question with 3 votes in favor - Dem
  • ATP) I will know - Mihail