0% found this document useful (0 votes)
10 views

Company Database Query

The document outlines various SQL queries for managing employee and project data, including salary adjustments, employee retrieval based on specific criteria, and departmental statistics. It includes tasks such as calculating sums and averages of salaries, filtering employees by attributes like dependents and location, and updating or deleting records. The queries are structured to extract meaningful insights from the employee database while ensuring data integrity.

Uploaded by

Putta Swamy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Company Database Query

The document outlines various SQL queries for managing employee and project data, including salary adjustments, employee retrieval based on specific criteria, and departmental statistics. It includes tasks such as calculating sums and averages of salaries, filtering employees by attributes like dependents and location, and updating or deleting records. The queries are structured to extract meaningful insights from the employee database while ensuring data integrity.

Uploaded by

Putta Swamy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Show the resulting salaries if every employee working on the ‘ProductX’ project is given a 10 percent

raise

2. Retrieve all employees in department 5 whose salary is between Rs. 30,000 and Rs. 40,000

3. Retrieve a list of employees and the projects they are working on, ordered by department and, within

each department, ordered alphabetically by last name, first name.

1. Retrieve the name of each employee who has a dependent with the same first name and same sex as the

employee

2. Retrieve the social security numbers of all employees who work on project number 1, 2 or 3

3. Retrieve the names of all employees who do not have supervisors

1. Find the sum of the salaries of all employees, the maximum salary, the minimum salary, and the

average salary

2. Find the sum of the salaries of all employees of the ‘Research’ department, as well as the maximum

salary, the minimum salary, and the average salary in this department

3. Retrieve the total number of employees in the company

1. Retrieve the number of employees in the ‘Research’ department

2. Count the number of distinct salary values in the database

3. For each department, retrieve the department number, the number of employees in the department, and

their average salary

1. For each project, retrieve the project number, the project name, and the number of employees who work

on that project

2. For each project on which more than two employees work, retrieve the project number, the project

name, and the number of employees who work on the project

3. For each project, retrieve the project number, the project name, and the number of employees from

department 5 who work on the project


1. For each department that has more than five employees, retrieve the department number and the

number of its employees who are making more than £40,000

2. Retrieve all employees whose address is in Houston, Texas

3. Find all employees who were born during the 1950s

1. For each employee, retrieve the employee’s first and last name, and the first and last name of his or her

immediate supervisor.

2. List the names of managers who have at least one dependent.

3. Retrieve the names of employees who have no dependents

1. Retrieve the names of all employees who have two or more dependents.

2. Make a list of project numbers for projects that involve an employee whose last name is ‘Smith’, either

as a worker or as a manager of the department that controls the project

3. For every project located in ‘Stafford’, list the project number, the controlling department number and

the department manager’s last name, address and birthdate

1. Retrieve all the attributes of an EMPLOYEE and the attributes of the DEPARTMENT he or she works

in for every employee of the ‘Research’ department

2. Retrieve the birthdate and address of the employee(s) whose name is ‘John B Smith’

3. Retrieve the name and address of all employees who work for the ‘Research’ department

1. get the manager’s name, we need to com bine each department tuple with the employee tuple whose

Ssn value matches the Mgr_ssn value in the department tuple.

2. Update the dnum 10 where dname is research.

3. Delete employee tuple whose ssn 101 and living in mandya

You might also like