Pergunta de entrevista da empresa Oracle

Write an SQL query to fetch the second-highest salary from the employees table. How would you retrieve duplicate records from a table without using DISTINCT? Explain the difference between JOIN, LEFT JOIN, and RIGHT JOIN. When would you use each? How do you optimize an SQL query for better performance? What strategies would you use? What are indexes in Oracle, and how do they improve query performance?