This Top 50 SQL Tricky Interview Questions book contains tricky and nasty SQL interview questions that an interviewer asks. It is a compilation of advanced SQL interview questions after attending dozens of technical interviews in top-notch companies like- Oracle, Google, Ebay, Amazon etc.
Each question is accompanied with an answer because you want to save your time while preparing for an interview.
The difficulty rating on these Questions varies from a Junior level programmer to Architect level.
Sample Questions are:
How can we retrieve alternate records from a table in Oracle?
Given a list of student names and grade. Write a query to print a comma separated list of student names in a grade.
Write SQL Query to get Student Name and number of Students in same grade.
Write SQL query to delete duplicate rows in a table?
Write SQL query to get the second highest salary among all Employees?
Write SQL Query to get Employee Name, Manager ID and number of employees in the department?
Write SQL query to get the nth highest salary among all Employees.
Given an Employee table with Manager_ID as column, print First name, Manager ID and Level of employees in Organization Structure?
Why is the difference between NVL and NVL2 functions in SQL?
What is the difference between UNION and UNION ALL?
What are the reasons for de-normalizing the data?
What is a Pseudocolumn?
How can you find 10 employees with Odd number as Employee ID?
What is the difference between DELETE and TRUNCATE in SQL?
Which SQL feature can be used to view data in a table sequentially?
What are the differences between CASE and DECODE in SQL?
Write a SQL Query to get the Quarter from date.