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

Interview Questions - 2021

Uploaded by

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

Interview Questions - 2021

Uploaded by

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

Problem Set 1

Run install script “PS1 – Install.SQL” from annex.

Sample of the TST_EMP table created:

Using the generated file, please provide code to answer the following requirements:

1. Please identify any duplicate employees from the table.

2. Please provide the script to remove all the duplicate rows (only duplicates)

3. Using the provided TST_EMP table, please provide a list of all employees and their current total
income (consider commission is provided as percentage of base salary).

4. Write an SQL to identify all employees which are also manager

5. Write a query that would show the employee/s with the highest ranking salary of each department

6. Write a query that would return the cumulative salaries by department

7. Please write a query that would return the employees in the format from bellow output,
independently of the number of leafs the hierarchy might have (please note the solution requires a
hierarchical query)

-------------------------------------------------------

KING

KOCHHAR

DE HAAN

HUNOLD


Following exhibit is from table TST_SAL_RANGE created by install script:

8. Please display the table structure.

9. Please provide SQL to display the names of all employees whose salaries belong to GRADE 3.

Problem Set 2

1. Write a PL/SQL procedure that receives as a parameter the department id and it will update in
the TST_EMP the salaries of the employees of that department with +5% of the average
department salary.

All errors need to be logged in the ADM_LOG table with the following structure:

LOG_ID LOG_DATE ERROR_CODE ERROR_MESSAGE

In case of an error no data should be committed except for the one entered in ADM_LOG.

2. Enhance the above procedure to use a function that receives as a parameter the department id
and returns the average department salary. Write the function as well.
3. If you would want to automatically populate LOG_ID and LOG_DATE from the ADM_LOG table
at each operation on it, how would you do it?

Problem Set 3

You work for a company that has locations worldwide and employees from different countries.

The company data is organized as follows

COUNTRIES table:

COUNTRY_ID COUNTRY_NAME
1 ROMANIA
2 IRELAND
3 US
EMPLOYESS table:

EMP_ID FIRST_NAME LAST_NAME COUNTRY_ORIGIN_ID BIRTH_DATA


1 JANE KING 1 1990-12-18
2 MARK JONES 3 1995-08-10
3 LUKE ADAMS 2 2000-11-05

WORKING_CENTERS table:

WC_ID NAME ADDRESS COUNTRY_ID


1 EUROPE BRANCH 13,WELSH DRIVE, 2
DUBLIN
2 ASIA PACIFIC BRANCH 13424,KING 3
CIRCLE,NEW YORK

EMPLOYEES_WC table:

EMP_ID WC_ID START_DATE END_DATE


1 2 2018-10-05
2 2 2020-03-11 2021-01-20

1. Write a SQL query that would list the employees that are currently working in countries
different than their original countries.
2. Write a SQL query that would list the countries and the employees that have worked in that
country for more than a year.
3. Write a SQL statement that would delete all employees working in Ireland
4. How would you implement a soft delete mechanism on the EMPLOYEES tables?
5. Design an interface for an application page that would allow you to insert a new row in the
EMPLOYEES_WC table. Try to make it as user friendly as possible. You can use any tool to draw
the interface and send us a print screen.
6. In an application that would allow manipulations of all of these tables what kind of validations
would you do to ensure data consistency (For example at insert into EMPLOYEES_WC or when
deleting an employee)?

You might also like