Interview Questions - 2021
Interview Questions - 2021
Using the generated file, please provide code to answer the following requirements:
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).
5. Write a query that would show the employee/s with the highest ranking salary of each 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:
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:
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.
COUNTRIES table:
COUNTRY_ID COUNTRY_NAME
1 ROMANIA
2 IRELAND
3 US
EMPLOYESS table:
WORKING_CENTERS table:
EMPLOYEES_WC table:
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)?