+ 2
SELECT CONCAT (FirstName, ' , ' , LastName) AS fullname (salary*12)+(experience*500) AS total FROM staff
Each employee receives a bonus once a year. The bonus for each employee is equal to their years of experience multiplied by 500. Write a query to output the firstname and lastname columns into one column named fullname separated by space, and the total annual salary for each employee keeping in mind bonuses named 'total'. Sort by the 'total' column.
7 Antworten
+ 1
Select CONCAT (firstname,' ', lastname) AS fullname,
salary*12+experience*500 AS total From staff
Order by total;
0
Thank you
0
SELECT CONCAT (firstname,' ',lastname) AS fullname, salary*12+experience*500 AS Total FROM staff ORDER BY Total;
0
I have done all this but the first name and last name comes out as fullname without space in between the first and last name
Someone please explain further cause am new to this SQL and it's driving me nuts
0
SELECT CONCAT (firstname, ' , ' , lastname)
AS fullname
(salary*12)+(experience*500) AS total
FROM staff
ORDER BY total
0
SELECT CONCAT (firstname, ' ' ,lastname)
AS fullname ,salary*12+experience*500 AS total
FROM staff
ORDER BY total
working
- 1
SELECT CONCAT (FirstName, ' , ' , LastName)
AS fullname
(salary*12)+(experience*500) AS total
FROM staff
ORDER BY total;