Oracle Database Interview Questions & Answers Set-8

«« Previous
Next »»

1. What is the difference between TRANSLATE and REPLACE?
Ans: Translate is used for character by character substitution and Replace is used substitute a single character with a word.

2. How do we display rows from the table without duplicates?
Ans: Duplicate rows can be removed by using the keyword DISTINCT in the select statement.

3. What is the usage of Merge Statement?
Ans: Merge statement is used to select rows from one or more data source for updating and insertion into a table or a view. It is used to combine multiple operations.

4. What is NULL value in oracle?
Ans: NULL value represents missing or unknown data. This is used as a place holder or represented it in as default entry to indicate that there is no actual data present.

5. What is USING Clause and give example?
Ans: The USING clause is used to specify with the column to test for equality when two tables are joined.

[sql]Select * from employee join salary using employee ID[/sql]

Employee tables join with the Salary tables with the Employee ID.

6. What is key preserved table?
Ans: A table is set to be key preserved table if every key of the table can also be the key of the result of the join. It guarantees to return only one copy of each row from the base table.

Ans: The WITH CHECK option clause specifies check level to be done in DML statements. It is used to prevent changes to a view that would produce results that are not included in the sub query.

8. What is the use of Aggregate functions in Oracle?
Ans: Aggregate function is a function where values of multiple rows or records are joined together to get a single value output. Common aggregate functions are –

  • Average
  • Count
  • Sum

9. What do you mean by GROUP BY Clause?
Ans: A GROUP BY clause can be used in select statement where it will collect data across multiple records and group the results by one or more columns.

10. What is a sub query and what are the different types of subqueries?
Ans: Sub Query is also called as Nested Query or Inner Query which is used to get data from multiple tables. A sub query is added in the where clause of the main query.

There are two different types of subqueries:

1. Correlated sub query
A Correlated sub query cannot be as independent query but can reference column in a table listed in the from list of the outer query.
2. Non-Correlated subquery
This can be evaluated as if it were an independent query. Results of the sub query are submitted to the main query or parent query.

11. What are the components of physical database structure of Oracle database?
Ans: Components of physical database structure are given below.

  • One or more data files.
  • Two or more redo log files.
  • One or more control files.

12. What are the components of logical database structure in Oracle database?
Ans: Components of logical database structure.

  • Tablespaces
  • Database's schema objects

13. What is a tablespace?
Ans: A database contains Logical Storage Unit called tablespaces. A tablespace is a set of related logical structures. Actually a tablespace groups related logical structures together.

14. What is a SYSTEM tablespace and when it is created?
Ans: When the database is created in Oracle database system, it automatically generate a SYSTEM named SYSTEM tablespace. The SYSTEM tablespace contains data dictionary tables for the entire database.

15. What is an Oracle table?
Ans: A table is basic unit of data storage in Oracle database. A table contains all the accessible information of a user in rows and columns.

«« Previous
Next »»