Ok so I\'m working on my homework and am having trouble figuring out how to multiply with SQL and how to get this to order correctly.
I am supposed to \"create a que
Why are you grouping by? Do you mean order by?
SELECT player_name, player_salary, player_salary * 1.1 AS NewSalary
FROM players
ORDER BY player_salary, player_name;
You don't need to use GROUP BY but using it won't change the outcome. Just add an ORDER BY line at the end to sort your results.
SELECT player_name, player_salary, SUM(player_salary*1.1) AS NewSalary
FROM players
GROUP BY player_salary, player_name;
ORDER BY SUM(player_salary*1.1) DESC
Here it is:
select player_name, player_salary, (player_salary * 1.1) as player_newsalary
from player
order by player_name, player_salary, player_newsalary desc
You don't need to "group by" if there is only one instance of a player in the table.
Why use GROUP BY at all?
SELECT player_name, player_salary, player_salary*1.1 AS NewSalary
FROM players
ORDER BY player_salary DESC