# Oracle Interview Questions with Answers

6 previously-asked interview questions from Oracle's hiring process, each with the correct answer and a worked explanation. Written against the company's actual test pattern.

_Source: Astra (https://useastra.in). Updated 2026-09-05._

### 1. What is a view in SQL and why would you use one?

**Answer:** A view is a virtual table defined by a stored query. It simplifies complex queries, provides an abstraction and security layer (exposing only certain columns or rows), and promotes reuse. It does not store data itself unless it is materialised.

**Explanation:** A stored query acting as a virtual table for reuse and security.

### 2. What is a stored procedure and what are its advantages?

**Answer:** A stored procedure is precompiled SQL logic stored in the database. Advantages include reuse, reduced network traffic, better performance from precompilation, centralised business logic, and improved security through controlled access.

**Explanation:** Precompiled reusable SQL; faster, secure, centralised.

### 3. What is database indexing and how does it improve performance?

**Answer:** An index is a data structure (often a B-tree) on one or more columns that lets the database find rows without scanning the whole table, speeding up reads and lookups. The trade-off is extra storage and slower writes as indexes must be maintained.

**Explanation:** Speeds reads by avoiding full scans; costs storage and write time.

### 4. What is a deadlock in a database and how is it handled?

**Answer:** A database deadlock is when two transactions each hold a lock the other needs, waiting forever. Databases detect deadlocks and roll back one transaction (the victim). Prevention includes consistent lock ordering and keeping transactions short.

**Explanation:** Mutual lock waiting; the DB rolls back a victim transaction.

### 5. What is the difference between UNION and UNION ALL in SQL?

**Answer:** UNION combines the results of two queries and removes duplicate rows, which requires a sort or hash and is slower. UNION ALL combines them and keeps all rows including duplicates, which is faster. Use UNION ALL when duplicates are acceptable or impossible.

**Explanation:** UNION removes duplicates; UNION ALL keeps them and is faster.

### 6. Tell me about yourself.

**Answer:** Give a concise 60 to 90 second overview: your degree, key skills (especially databases and programming), a relevant project, and why Oracle interests you. Keep it structured.

**Explanation:** Structured pitch: background, skills, project, fit.

More Oracle preparation, including the full recruitment process: https://useastra.in/campus/oracle
