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

SQL (Aum)

The document provides instructions for writing SQL queries to retrieve information from an Employees table. It includes 13 questions asking to write queries to display employee names, unique department IDs, ordered employee details, names, salaries and PF, ordered salaries, total salaries, maximum and minimum salaries, average salary and employee count, employee count, job count, names starting with D, names and manager IDs matching specific job IDs, and employee count per job ID.

Uploaded by

Aum Shukla
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

SQL (Aum)

The document provides instructions for writing SQL queries to retrieve information from an Employees table. It includes 13 questions asking to write queries to display employee names, unique department IDs, ordered employee details, names, salaries and PF, ordered salaries, total salaries, maximum and minimum salaries, average salary and employee count, employee count, job count, names starting with D, names and manager IDs matching specific job IDs, and employee count per job ID.

Uploaded by

Aum Shukla
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

SQL Assessment

Table structure for table Employees

CREATE TABLE employees (


EMPLOYEE_ID int(3) PRIMARY KEY,
FIRST_NAME varchar(20) NOT NULL,
LAST_NAME varchar(20) NOT NULL,
EMAIL varchar(20) NOT NULL,
PHONE_NUMBER varchar(11) NOT NULL,
HIRE_DATE date NOT NULL,
JOB_ID varchar(20) NOT NULL,
SALARY int(6) NOT NULL,
COMMISSION_PCT int(5) DEFAULT NULL,
MANAGER_ID int(5) DEFAULT NULL,
DEPARTMENT_ID int(5) NOT NULL
);

1. Write a query to display the names (first_name, last_name) using alias name “First Name",
"Last Name"

2. Write a query to get unique department ID from employee table

3. Write a query to get all employee details from the employee table order by first name,
descending
4. Write a query to get the names (first_name, last_name), salary, PF of all the employees (PF is
calculated as 15% of salary)

5. Write a query to get the employee ID, names (first_name, last_name), salary in ascending
order of salary

6. Write a query to get the total salaries payable to employees

7. Write a query to get the maximum and minimum salary from employees table.
8. Write a query to get the average salary and number of employees in the employees table.

9. Write a query to get the number of employees working with the company.

10. Write a query to get the number of jobs available in the employees table.

11. Write a query to get the name of employees whose name starts from D.
12. Write a query to get the name and manager id of employee whose job Id is AD_VP or
FI_ACCOUNT.

13. List the number of employees with each job_id.

You might also like