please help me out with these SQL problems:
1. Create a treewalking list of every employee's last name, his manager's last name, and his position in the company. – The top level manager has position 1, this manager's subordinates position 2, their subordinates position 3, and so on. – Start the listing with employee number 100.
2. create the list of department names and the departmental costs (salaries added up). – Include only departments whose salary costs are between 15000 and 31000, and sort the listing by the cost.
3. Create a list of department names, the manager id, manager name (employee last name) of that department, and the average salary in each department.
4. Show the highest average salary for the departments in the employees table. Round the result to the nearest whole number.
5.– Create a list of department names and their monthly costs (salaries added up). • Tables Used: – Employees, Departments
6. Create a list of department names, and job_ids. Calculate the monthly salary cost for each job_id within a department, for each department, and for all departments added together. • Tables Used: – Employees, Departments
7. Create a list of department names, and job_ids. Calculate the monthly salary cost for each job_id within a department, for each department, for each group of job_ids irrespective of the department, and for all departments added together. (Hint: Cube). • Tables Used: – Employees, Departments
8. Expand the previous list (number 7) to also show if the department_id or job_id was used to create the subtotals shown in the output. (Hint: Cube, Grouping) • Tables Used: – Employees, Departments
9. Create a list that includes the monthly salary costs for each job title within a department. – In the same list, display the monthly salary cost per city. (Hint: Grouping Sets) • Tables Used: – Employees, Departments, Locations
10. Create a list of employee names as shown and department ids. – In the same report, list the department ids and department names. And finally, list the cities. – The rows should not be joined, just listed in the same report. (Hint: Union) . Tables Used: – Employees, Departments, Locations
Sql queries are:
4.Select Round(max(avg(sal))) from emp group by dept_name;
2.select deptname,departmnet cost from departments where sal>15000 and sal<31000 order by sal;
please help me out with these SQL problems: 1. Create a treewalking list of every employee's...
Write SQL Queries for the following Select the employee name and no of departments each employee works for Select the employee names with salary greater than average salary of all employees Select the department names with no manager assigned yet. Select the employee names who work for more than 1 department. Select the employee names and their manager names (keep in mind, one employee works for multiple departments so they will have multiple managers). Select the name and salary of...
The following ERD and two tables represent a partial model similar to what we used in class. Answer all questions by writing SQL syntax to solve each. If a question requires more time, please move on to the next. Employee EmpNo (PK) Ename Job ManagerID HireDate Salary Commission DeptNo (FK) Department DeptNo Dname Location 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON Department DeptNo (PK) Dname Location 1400 Employee Monthly EmpNo Ename Job ManagerID HireDate...
You must exercise a number of classes while using the inheritance rules we have learned.In each department must be realized, in addition to what is detailed below:.get, set methods-Property for all variables.ToString () -Equals () -- Builders of three types we learned.1. Write an Employee Department that represents a regular employee. For the department to keep theThe following data:Employee's nameBase salary (integer).behavior:Wage calculation method (equal to base salary).2. SalesEmployee Department - Represents a sales employee. For a sales employee keep...
Write a C program that does/has the following: 1) Create a structure named “employee” that contains the following fields: name (string), id (int), salary (float) and a pointer to the next list item. 2) Create a structure that extends the “employee” structure named “manager” that will contain an additional field for an array of pointers that will point to the employees that they manage, each manager will manage 3 employees. 3) Read the text file provided with this assignment to...
database and sql problme
THE QUESTIONS 3, 4,5 and 6 REFER TO THE RELATIONAL TABLES LISTED BELOW CREATE TABLE Department ( DECIMAL(5) VARCHAR(30) CHAR(5) DATE NOT NULL NOT NULL NOT NULL * Department number /*Department name * Department manager number */ /Manager start date DNumber DName Manager MSDate CONSTRAINT Department_PK PRIMARY KEY(DNumber) CONSTRAINT Department_CK UNIQUE(DName) CREATE TABLE DeptLocation DECIMAL(5) VARCHAR(50) NOT NULL NOT NULL DNumber * Department number */ * Department location */ Address CONSTRAINT DeptLocation_PK PRIMARY KEY(DNumber, Address) CONSTRAINT...
If possible please just send the SQL statement. Thank you
Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top of each page. Also, using a 12-point font, include the SQL statement and then provide a screen shot of each query. The screen shots must include both the SQL statement and the results for each item below based on the data entered in...
I have already turned in my HW, I need some understanding of the
below SQL queries.
1. Find the number of employees in each department.
2. List the names of departments that have more than 5 employees
working there.
3. Retrieve the lowest and highest salary in each department.
Output the department name in alphabetical order.
Consider the following relational schema. An employee can work in more than on department; also, the percentTime field of the Works relations shows the...
ANSWER a
PLEASE USE MS ACCESS TO ANSWER (a)
EMPLOYEE X Name Adams, James Angel, Kathy Ashley, Jane Bosa, Victor Ching, Kam Hoong Collins, Giovanni Corning, Sandra Corovic, Jose Davidson Kaye Dixon, James T Dixon, Eleonor Drew, Richard Duong, Linda Goston, Sayeh Jordan, Matthew Lane, Brandon Lee, Brandon Lunden, Haley Menstell,Lori Lee Pham, Mary Quigly, James Ray, Tony Rikki, Nicole Ryan, Mark Scott, Bryan Scott, Rex Spenser, William UTran,Diem Thi Warrem, Jason Wei, Guang * - Department Accounting IS Marketing...
Please fill in the remaining code necessary and follow the instructions below this is an abstract class; it represents an department in the company. This class cannot be instantiated (objects created), but it serves as the parent for other classes. Department – This class represents a department within the company. 1. Provide the implementation (the body) for the following methods: public int getDepartmentID()) public String getDepartmentName()) public Manager getManager()) 2. Fix the implementation for the following method– substitute “blah” with...
Write SQL code please. Tables are attached with their
appropriate fields for reference.
The Marketing Department requires a vendor listing that shows the following fields: 1. - Vendor Name Vendor Contact First Name - Vendor Contact Last Name - Vendor City - Vendor State - Vendor Zip Code Note: Sort by vendor state The Finance Department requires a report that shows payment totals greater than $50.00. List the following fields 2. - Vendorid - Payment Total - Payment Date The...