Question

In: Computer Science

Retrieve the SSN and salary of the employee who work for the headquarter department. 2. List...

  1. Retrieve the SSN and salary of the employee who work for the headquarter department.

2. List all the departments name , the manager’s name of each department and the location of each department.

  1. List the last name of each employee whose salary is more than 30,000 and the last name of his/her supervisor

Solutions

Expert Solution

Since your question does not have table structure I am adding this table str and trying to resolve your question:
If you have different table str write your query according else post that table str also.
Thanks in advance.

create table dept
(
dept_no int not null,
dept_name varchar(100) not null,
dept_location varchar(100) not null,
);

create table employee
(
SSN int not null,
emp_first_name varchar(100),
emp_last_name varchar(100),
mgr_emp_id int,
salary int;
dept_no int not null,
primary key (emp_id),
);

create table manager
(
mgr_emp_id int,
mgr_first_name varchar(100),
mgr_last_name varchar(100),
salary int;
dept_no int not null,
)

1. Retrieve the SSN and salary of the employee who work for the headquarter department.
SELECT SSN, salary FROM employee e, dept d
where e.dept_no = d.dept_no
and dept_name = 'headquarter';

2. List all the departments name , the manager’s name of each department and the location of each department.
select
dept.dept_name,
manager.mgr_first_name,
dept.dept_location
from dept, manager
where dept.dept_no=manager.dept_no;


3.List the last name of each employee whose salary is more than 30,000 and the last name of his/her supervisor,
--assuming here supervisior is niothing but manager

Select e.emp_last_name,m.mgr_last_name from employee,manager
where e.mgr_emp_id = m.mgr_emp_id
and e.salary>30000 ;


Related Solutions

Retrieve the names of employees whose salary is within $20,000 of the salary of the employee...
Retrieve the names of employees whose salary is within $20,000 of the salary of the employee who is paid the most in the company (e.g., if the highest salary in the company is $80,000, retrieve the names of all employees that make at least $60,000) Based on the following table: -- drop tables DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; DROP TABLE DEPARTMENT CASCADE CONSTRAINTS; DROP TABLE DEPT_LOCATIONS CASCADE CONSTRAINTS; DROP TABLE PROJECT CASCADE CONSTRAINTS; DROP TABLE WORKS_ON CASCADE CONSTRAINTS; DROP TABLE...
USE ORACLE - SQL List the name and salary of employees who work for division 3....
USE ORACLE - SQL List the name and salary of employees who work for division 3. List the name of project whose budget is between 5000-7000 List the total number of employee whose initial of name is 's'. (hint, using LIKE operator and wildcard character) List the total number of employee whose initial of name is NOT 's' for each division, including division ID List the total project budget for each division, including division ID. List the ID of the...
List department name, employee id, and employee name for all employees in department name order. Repeat...
List department name, employee id, and employee name for all employees in department name order. Repeat for department #10 only. List the course ID, course name, section, instructor name, day, time, and room for all course sections. List the course ID, course name, section, student ID, and student name for CRN 1003. Display the list in ascending order of student last and first names. DROP TABLE registration; DROP TABLE sections; DROP TABLE courses; DROP TABLE students; DROP TABLE instructors; CREATE...
Develop an algorithm to implement an employee list with employee ID ,name designation and department using...
Develop an algorithm to implement an employee list with employee ID ,name designation and department using link list and perform the following operation on the list i)add employee details based on department ii)remove employee details iv)count the number of employee in each department
Wendy O"neil (SSN 412-34-5670), who is single, work full time as the director at a local...
Wendy O"neil (SSN 412-34-5670), who is single, work full time as the director at a local charity. She resides at 1501 Front St Highland, AZ 85711 for the year. she had the following on her w2 wages 46200 federal withholding 6930 social security wages 46200 social security withholding 2864 medicare withholding 670 state withholding 2310 other information 1099-int 300 1099 div ordinary 400 qualified 400 itemized state income 2310 state income tax paid with the 2016 return 100 real estate...
Aimee is a salaried nonexempt employee who earns an annual salary of $54,000 for a 35-hour...
Aimee is a salaried nonexempt employee who earns an annual salary of $54,000 for a 35-hour workweek, paid biweekly. The employer pays overtime for any hours worked in excess of 35 per week. During a pay period, she worked 73.5 hours. She has requested that she take compensatory time in lieu of paid overtime. How much compensatory time should she receive, assuming that her firm approves the compensatory time? 3.5 hours 2.75 hours 5.25 hours 10.25 hours
Company organized into DEPARTMENT. Each department has unique name and a particular employee who manages the...
Company organized into DEPARTMENT. Each department has unique name and a particular employee who manages the department. Start date for the manager is recorded. Department may have several locations.  A department controls a number of PROJECTS. Projects have a unique name, number and a single location.  Company’s EMPLOYEE name, ssno, address, salary, sex and birth date are recorded. An employee is assigned to one department, but may work for several projects (not necessarily controlled by her dept). Number...
The Payroll Department keeps a list of employee information for each pay period in a text...
The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular format with the appropriate header. Each line should contain: An employee’s name The hours worked The wages paid...
73 graduates who went on to work in Marketing have a mean salary of £48,286 with...
73 graduates who went on to work in Marketing have a mean salary of £48,286 with a standard deviation of £9,690, while the 202 graduates who went on to work in Finance have a mean salary of £61,130 with a standard deviation of £10,284. Assume you are advising students to take jobs in Marketing as opposed to Finance jobs upon graduation: i. Set up the hypothesis to test in order to achieve your objective and explain why you selected it....
Explain how salary caps work in American sports. Be sure to explain who gains, who loses,...
Explain how salary caps work in American sports. Be sure to explain who gains, who loses, and the effects on competitive balance. (15 points)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT