Write the SQL statements for each question below Display all


Write the SQL statements for each question below. Display all information on employees between 18- JUL-97 and 08- NOV-00 Display job code and descriptor where the Job charge hour is greater than 55.00 Display the First and last name of every Database designer. Display the count of employees that are programmers. Display the EMP_NUM of all employees that worked on project # 18 or # 25. Change the project named Starflight to moon flight. Insert project number 32 that is named Walmart with a value of 2, 525, 489.00 and a balance of 1, 222, 389 and is managed by employee number 108 Display the number of employees that worked on at least one project Display the average balance of all projects. Display the project name of all projects whose balance is lower than the average balance of all projects. What Is die maximum number of hours worked on any project? What is the total project value of all project? Display the name of projects that have a total value less than the average value of all projects. Display the employee number of each employee whose total hours assigned is greater than the average of employee total assigned hoers Display each project number and total assigned charges for the project.

Solution

Your database tables are not clearly visible. The pixels are breaking when zooming. Here I am assuming four table.. Plz enter table name and column name by yourself as per requirement.I am giving syntax for your queries.

1. SELECT employees FROM table_name

NOTE:--(Table is the name of your table)

2. select job_code, description from table_name

WHERE charge hour>>55.00;

NOTE:--if description is given in job_code column then remove description from the query)

3. select suser_sname(owner_sid) from sys.databases;

4. select count(*) employees from table_name

WHERE employees=programmers;

5. select EMP_NUM

from workson

GROUPBY 18,25;

6. RENAME table \'StarFlight\' to \'MoonFlight\';

7. UPDATE Table_name

WHERE Project_id=32

set Pro_name=\'walmart\'

value=5,525,489.00

balance=1,222,389

8.SELECT E.employees, W.ProjectID
from employee E inner join workon w on e.employees = w.ProjectID
where e.employees in (select EMPID from workon GROUP BY employees HAVING COUNT(employees) = 1);

9. select SELECT AVG(balance) FROM table_name_1,table_name_2,table_name_3,table_name_4

GROUPBY Project_id;

NOTE:-- if project_id is given to every project then write project_id otherwise anything which is unique in every project, you have to use in query.

10. SELECT Project_name WHERE balance < (SELECT AVG(balance) FROM * table_name_1,table_name_2,table_name_3,table_name_4 )

GROUPBY project_id;

11. select count(*) HoursWorked from table_name_a, table_name_b,table_name_c,table_name_d

GROUP BY project_id_1, project_id_2, project_id_3, project_id_4;

12. select sum(total) as mytotal,project_id

)

GROUP BY Project_id;

13. SELECT Project_name WHERE value < (SELECT AVG(value) FROM * table_name_1,table_name_2,table_name_3,table_name_4)
GROUPBY project_id;

14.select EMP_NUM from table_name

WHERE EMP_TOTAL_HOURS>TABLE_TOTAL HOURS;

15. SELECT p.proj_no, COUNT(c.assigned_charges)
FROM table_name_1, table_name_2
WHERE p.c.assigned_charges1 = a.c.assigned_charges1 AND p.proj_no = a.proj_no
GROUP p.Proj_no, c.assigned_charges1;

 Write the SQL statements for each question below. Display all information on employees between 18- JUL-97 and 08- NOV-00 Display job code and descriptor where
 Write the SQL statements for each question below. Display all information on employees between 18- JUL-97 and 08- NOV-00 Display job code and descriptor where

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site