0
Tennis Tournament what I am missing?
I wrote a query and according to the test, its bringing the results desired by not in the order test as expecting, the weird thing is that the expected result are not ordered at all. -- select players` names and the total points as Total SELECT player_name, SUM(set_1 + set_2 + set_3) as total FROM matches GROUP BY player_name
14 ответов
+ 6
Check the description of the task again, read carefully and understand.
Hints:
• what are the query requirements & does it asks you to include "GROUP BY" clause for solving query?
• Does the task ask you aggregating the total using "SUM()" function?
• Your query asks to add total points aliasing it "AS Total."
+ 3
• It's conventional to make all SQL statements uppercased and from the comments it should be "Total" not "total" so correct thing is "AS Total".
• Since you're talking about sorting here or ordering the right statement to use is "ORDER BY" not "GROUP BY" cause each player has a distinct name so you can't group them by names.
+ 2
if someone completes this code and writes to me, thank you
+ 2
SELECT player_name, SUM(set_1, set_2, set_3) as total
FROM matches
ORDER BY player_name
+ 2
it doesn't give input I tried this before thanks my friend
+ 2
SELECT player_name, set_1 + set_2 + set_3 AS total FROM matches
+ 2
thanks don't working
+ 2
SELECT player_name , set_1 + set_2 + set_3 AS Total
FROM matches
this is the solution
+ 2
hey guys Online Bookstore sql
SELECT *
FROM books
WHERE author = 'Fiction'
what's wrong
+ 1
If you look closely you will see the order of names in the table is the same as the result order, which suggest you don’t need to specific the ordering on the result.
You are very close to pass the test, give it another try.
+ 1
SELECT player_name, SUM(set_1 + set_2 + set_3) AS total
FROM matches
GROUP BY player_name;
the order for the output is wrong i am not sure what is wrong
player_name,total
Sophia Davis,18
John Smith,19
Michael Johnson,16
Emily Thompson,20
Daniel Wilson,16
the actual output
player_name,total
John Smith,19
Michael Johnson,16
Emily Thompson,20
Daniel Wilson,16
Sophia Davis,18
0
AMIR H R A<ヾ(@^▽^@)ノ >LION 💪
It is a different question.
Please open a new post, or use the search function first.
0
This is the correct code:-
-- select players` names and the total points as Total
SELECT player_name, CONCAT(set_1 + set_2 + set_3) as total
FROM matches
0
-- select players` names and the total points as Total
Select player_name , (set_1+ set_2+set_3) as total
FROM matches