0% found this document useful (0 votes)
216 views3 pages

RDBMS HandsOn

Uploaded by

Mahesh S Gour
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)
216 views3 pages

RDBMS HandsOn

Uploaded by

Mahesh S Gour
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/ 3

COPYRIGHT NOTICE

© 2017 Infosys Limited, Bangalore, India. All Rights Reserved.


Infosys believes the information in this document is accurate as of its publication date;
such information is subject to change without notice. Infosys acknowledges the
proprietary rights of other companies to the trademarks, product names and such other
intellectual property rights mentioned in this document. Except as expressly permitted,
neither this documentation nor any part of it may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, electronic, mechanical, printing,
photocopying, recording or otherwise, without the prior permission of Infosys Limited
and/ or any named intellectual property rights holders under this document.

Education, Training and Assessment Department


Infosys Limited
Electronics City
Hosur Road
Bangalore – 561 229, India.

Tel: 91 80 852 0261-270


Fax: 91 80 852 0362
www.infosys.com
mailto:[email protected]
Problem Description

Employee Management System

iNext Ltd, a product based company with more than 50000 employees, that provides product
solutions to large number of clients from different countries. It uses a software product to
maintain their employee’s information and their project allocation details. The application is used
by the following user groups:

 Employees
 Consultants
 Project Manager

Few table structures are given below.

Employee:

Column Name Data Type and Size Constraints Description


empid Number(10) PRIMARY KEY Unique Id of the
employee
empname VARCHAR2(30) Name of the
employee
typeofemp VARCHAR2 (30) Type of employee –
can be Permanent or
Consultant
skillset VARCHAR2(30) Skill set of employee
worksfor VARCHAR2(30) FOREIGN KEY Existing project id
present in Project
table
salary Number(10) Salary of employee
e-mailid VARCHAR2(30) E-mail id of employee

Other constraints to be given as applicable.

Project:

Column Name Data Type and Size Constraints Description


projectid VARCHAR2(30) PRIMARY KEY Unique Id of the
project
projectname VARCHAR2(30) Name of the project
projecttechnology VARCHAR2(30) Technology used in
the project
projectmanagerid Number(10) FOREIGN KEY Existing empid
present in employee
table

Other constraints to be given as applicable.

Write SQL queries for the scenarios listed below. (Maximum Marks: 40)

1. Display the employee id, employee name and salary for all Consultants who are drawing
a salary in the range of 50000 to 100000. (3 marks)
2. Display the employee id, employee name, project id of all Permanent employees who
are allocated to ‘JavaEE’ technology. (3 marks)
3. Get the names of all employees who are project managers along with their project id. (5
marks)
4. For each project, display the project id, project name and number of employees who are
allocated to it. Display ‘NA’ if no employees are allocated to a project. (5 marks)
5. List the employee id, employee name of all employees who are managing two or more
projects. (3 marks)
6. Retrieve the employee name, employee id of all employees who are working for the
same project as the employee with name – ‘John’. Do not display the record of John in
the result. (5 marks)
7. Retrieve the employee id, employee name, employee type and salary of those
employees who are drawing the maximum salary in each employee type. (5 marks)
8. Identify the employees who are working for the same project. Display the employee id
and employee name of those employees without any duplicate rows. (5 marks)
9. Find the average salary of different types of employees - Permanent employees and
Consultants. Display the type and average salary if the identified average salary is more
than 50000. (3 marks)
10. Display the employee type, project id and average salary of employees belonging to
projects with project id ‘P1001’ or ‘P1002’. (3 marks)

You might also like