Ana sayfa
/
Teknoloji
/
Uples to answer the following questions by SQL commands. employee (ssn fname address, city,dob, salary,job code) (job code, job position) a) Concatenate and display the first name and last name of all employees. List them in a descending order according to their salary. (4 points) SELECT CONCAT _WS(", "fname', "Iname') AS FullName FROM employee ORDER BY FullName DESC; b) List all employees first name and last name who was born between 2000 and 2005 (4 points) SELECT fname , Iname FROM employee WHERE BORN BETWEEN 2000 AND 2005; c) List the SSN and salary of all employees who carn more than 5000 Change the column name of salary to MANAGERS. (4 points) SELECT SSN , salary AS MANAGERS FROM employee WHERE MANAGERS >5000; d) Find the total amount of salary each employee will earn at the end of 1 year (4 points) e) List the number of employees in each job. Display those which has less than 3 in the group.(7 points)

Soru

Uples to answer the following questions by SQL commands.
employee (ssn fname address, city,dob, salary,job code)
(job code, job position)
a) Concatenate and display the first name and last name of all employees. List them in a descending order according
to their salary. (4 points)
SELECT CONCAT _WS(", "fname', "Iname') AS FullName
FROM employee
ORDER BY FullName DESC;
b) List all employees first name and last name who was born between 2000 and 2005 (4 points)
SELECT fname , Iname
FROM employee
WHERE BORN BETWEEN 2000 AND 2005;
c) List the SSN and salary of all employees who carn more than 5000 Change the column name of salary to
MANAGERS. (4 points)
SELECT SSN , salary AS MANAGERS
FROM employee
WHERE MANAGERS >5000;
d) Find the total amount of salary each employee will earn at the end of 1 year (4 points)
e) List the number of employees in each job. Display those which has less than 3 in the group.(7 points)

Uples to answer the following questions by SQL commands. employee (ssn fname address, city,dob, salary,job code) (job code, job position) a) Concatenate and display the first name and last name of all employees. List them in a descending order according to their salary. (4 points) SELECT CONCAT _WS(", "fname', "Iname') AS FullName FROM employee ORDER BY FullName DESC; b) List all employees first name and last name who was born between 2000 and 2005 (4 points) SELECT fname , Iname FROM employee WHERE BORN BETWEEN 2000 AND 2005; c) List the SSN and salary of all employees who carn more than 5000 Change the column name of salary to MANAGERS. (4 points) SELECT SSN , salary AS MANAGERS FROM employee WHERE MANAGERS >5000; d) Find the total amount of salary each employee will earn at the end of 1 year (4 points) e) List the number of employees in each job. Display those which has less than 3 in the group.(7 points)

Çözüm

4.6239 Voting
avatar
Özge
Usta · 5 yıl öğretmeni
Uzman doğrulaması

Cevap

a) Concatenate and display the first name and last name of all employees. List them in a descending order according to their salary.<br /><br />```sql<br />SELECT CONCAT(fname, ', lname) AS FullName, salary<br />FROM employee<br />ORDER BY salary DESC;<br />```<br /><br />b) List all employees first name and last name who was born between 2000 and 2005.<br /><br />```sql<br />SELECT fname, lname<br />FROM employee<br />WHERE dob BETWEEN '2000-01-01' AND '2005-12-31';<br />```<br /><br />c) List the SSN and salary of all employees who earn more than $5000. Change the column name of salary to MANAGERS.<br /><br />```sql<br />SELECT SSN, salary AS MANAGERS<br />FROM employee<br />WHERE MANAGERS > 5000;<br />```<br /><br />d) Find the total amount of salary each employee will earn at the end of 1 year.<br /><br />```sql<br />SELECT SSN, salary * 12 AS TotalSalary<br />FROM employee;<br />```<br /><br />e) List the number of employees in each job. Display those which have less than 3 in the group.<br /><br />```sql<br />SELECT job_code, COUNT(*) AS EmployeeCount<br />FROM employee<br />GROUP BY job_code<br />HAVING EmployeeCount < 3;<br />```
Derecelendirmek için tıklayın: