- 1

Please anyone help me out to solve the below SQL query!!!

Write a query to output all teams which conceded the least number of goals in the league ordered by scored goals in descending order.

21st Apr 2021, 5:59 PM
Mano Anand
Mano Anand - avatar
7 Réponses
+ 16
try this SELECT * FROM league WHERE conceded_goals = (SELECT MIN(conceded_goals) FROM league) ORDER BY scored_goals DESC;
18th May 2021, 8:59 PM
Stella Dee
Stella Dee - avatar
+ 2
SELECT teamname,country FROM teams WHERE country IN('Germany','England','Spain')
21st Aug 2022, 8:39 AM
Abdul Bari Rahmani
Abdul Bari Rahmani - avatar
0
I get various non-descript errors on this one too. I can't figure our where my problem is. Any clues? select team, scored_goals, (Min(conceded_goals)) from league Order by scored_goals; Returns the following error: ERROR: column "league.team" must appear in the GROUP BY clause or be used in an aggregate function
10th May 2021, 6:47 PM
Dave Wiener
Dave Wiener - avatar
0
I feel SoloLearn does not do a good job conveying how to string all these phrases together. Especially as a first timer with no previous experience it can be very difficult to get a grasp on something if it is not being conveyed clearly. There seems to be a lot of assumption that being told the bare minimum will suffice but it is quite the contrary for a new student to SQL. Earlier sections were easy but I do not recall being taught how to string everything together after each section. Wish this app was more intuitive for newbies..
22nd Aug 2021, 5:23 PM
Josh Playing Games
- 1
SELECT * FROM league WHERE conceded_goals = (SELECT MIN(conceded_goals) FROM league) ORDER BY scored_goals DESC;
16th Apr 2022, 12:13 PM
RATHIS KUMAR R
- 3
Post your code first
21st Apr 2021, 6:14 PM
Atul [Inactive]
- 5
Select team, scored_goals,min(conceded_goals) as as conceded_goals from league ORDER by scored_goals DESC;
21st Apr 2021, 6:17 PM
Mano Anand
Mano Anand - avatar