Write a query to output all teams which conceded the least number of goals in the league ordered by scored goals in descending o | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

Can anyone please help me with the answer. I am new learner to SQL and tried many times but the code is showing error. SELECT team FROM league WHERE conceded_goals = (MIN(conceded_goals from league)) ORDER BY scored_goals DESC;

4th Jan 2022, 9:50 AM
SHIKHA PATHAK
6 Answers
0
no @Simba. I can't.
4th Jan 2022, 9:52 AM
SHIKHA PATHAK
+ 3
/*Try this*/ SELECT * FROM league WHERE conceded_goals = (SELECT MIN(conceded_goals) from league) ORDER BY scored_goals DESC;
4th Jan 2022, 10:03 AM
Simba
Simba - avatar
+ 2
Can we see your code?
4th Jan 2022, 9:51 AM
Simba
Simba - avatar
+ 2
It's OK. Me neither 👋
4th Jan 2022, 9:54 AM
Simba
Simba - avatar
0
GOT correct code from a post :) SELECT * FROM league WHERE conceded_goals = (SELECT MIN(conceded_goals) FROM league) ORDER BY scored_goals DESC; Thanks!
4th Jan 2022, 10:03 AM
SHIKHA PATHAK
- 1
oh..sorry I got it wrong :P CODE is posted below my question.
4th Jan 2022, 9:55 AM
SHIKHA PATHAK