Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Define Scope Resolution Operator?

Answer»

If the FUNCTION is defined outside the class, this one is used to associate function definition to the class. It is ALSO used to resolve the scope of GLOBAL variables.

If the function is defined outside the class, this one is used to associate function definition to the class. It is also used to resolve the scope of global variables.

2.

Define Inline Function?

Answer»

Before the function definition, with the KEYWORD INLINE, a function is PREFIXED it is said to be an inline function.

Before the function definition, with the keyword inline, a function is prefixed it is said to be an inline function.

3.

What Do You Mean By Implicit Conversion?

Answer»
  • Whenever DATA types are MIXED in an expression then C++ performs the conversion automatically.
  • Here smaller type is converted to wider type.
  • EXAMPLE : in case of integer and FLOAT integer is converted into float type.

4.

What Are The Differences Between New And Malloc?

Answer»
  • New initializes the ALLOCATED memory by CALLING the constructor. Memory allocated with new should be released with DELETE.
  • MALLOC allocates uninitialized memory.
  • The allocated memory has to be released with FREE. New automatically calls the constructor while malloc (doesn’t).

5.

What Is Class Invariant?

Answer»

A CLASS invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the CORRECT working of a class. Class invariants must hold when an object is CREATED, and they must be preserved under all operations of the class. In particular all class invariants are both PRECONDITIONS and post-conditions for all operations or member FUNCTIONS of the class.

A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In particular all class invariants are both preconditions and post-conditions for all operations or member functions of the class.

6.

What Is The Data Type Of Dual Table?

Answer»

The DUAL table is a one-COLUMN table present in ORACLE DATABASE. The table has a single VARCHAR2(1) column called DUMMY which has a value of ‘X’.

 

The DUAL table is a one-column table present in oracle database. The table has a single VARCHAR2(1) column called DUMMY which has a value of ‘X’.

 

7.

How To Display Row Numbers With The Records?

Answer»

A PRIVILEGE is nothing but RIGHT to execute an SQL query or to access another USER object. Privilege can be given as system privilege or user privilege.

[sql]GRANT user1 TO user2 WITH MANAGER OPTION;[/sql]

A privilege is nothing but right to execute an SQL query or to access another user object. Privilege can be given as system privilege or user privilege.

[sql]GRANT user1 TO user2 WITH MANAGER OPTION;[/sql]

8.

What Is The Maximum Number Of Triggers That Can Be Applied To A Single Table?

Answer»

12 is the MAXIMUM number of triggers that can be applied to a SINGLE table.

12 is the maximum number of triggers that can be applied to a single table.

9.

What Are Privileges And Grants?

Answer»

Privileges are the rights to execute SQL statements – means Right to connect and connect. GRANTS are GIVEN to the object so that objects can be accessed accordingly. Grants can be provided by the OWNER or creator of an object.

Privileges are the rights to execute SQL statements – means Right to connect and connect. Grants are given to the object so that objects can be accessed accordingly. Grants can be provided by the owner or creator of an object.

10.

What Is The Parameter Mode That Can Be Passed To A Procedure?

Answer»

IN, OUT and INOUT are the MODES of PARAMETERS that can be PASSED to a PROCEDURE.

IN, OUT and INOUT are the modes of parameters that can be passed to a procedure.

11.

Can We Store Pictures In The Database And If So, How It Can Be Done?

Answer»

Yes, we can STORE pictures in the DATABASE by Long RAW Data TYPE. This datatype is used to store binary data for 2 GIGABYTES of length. But the table can have only on Long Raw data type.

Yes, we can store pictures in the database by Long Raw Data type. This datatype is used to store binary data for 2 gigabytes of length. But the table can have only on Long Raw data type.

12.

What Are The Attributes Of Cursor?

Answer»

ATTRIBUTES of Cursor are :

%FOUND

  • Returns NULL if cursor is open and fetch has not been executed.
  • Returns TRUE if the fetch of cursor is executed successfully.
  • Returns False if no rows are returned.

%NOT FOUND :

  • Returns NULL if cursor is open and fetch has not been executed
  • Returns False if fetch has been executed
  • Returns True if no row was returned

%ISOPEN :

  • Returns true if the cursor is open
  • Returns false if the cursor is closed

%ROWCOUNT :

  • Returns the number of rows FETCHED. It has to be iterated through entire cursor to give exact real count.

Attributes of Cursor are :

%FOUND : 

%NOT FOUND :

%ISOPEN :

%ROWCOUNT :

13.

How Can We Delete Duplicate Rows In A Table?

Answer»

DUPLICATE ROWS in the table can be DELETED by USING ROWID.

Duplicate rows in the table can be deleted by using ROWID.

14.

What Are Set Operators?

Answer»

SET OPERATORS are USED with TWO or more queries and those operators are Union, Union All, Intersect and Minus.

SET operators are used with two or more queries and those operators are Union, Union All, Intersect and Minus.

15.

What Are Cursor Attributes?

Answer»

Each cursor in ORACLE has set of attributes which enables an application program to test the state of the cursor. The attributes can be used to check WHETHER cursor is opened or closed, FOUND or not found and also find ROW count.

Each cursor in Oracle has set of attributes which enables an application program to test the state of the cursor. The attributes can be used to check whether cursor is opened or closed, found or not found and also find row count.

16.

What Is The Difference Between Rename And Alias?

Answer»

RENAME is a PERMANENT name given to a table or a column whereas ALIAS is a temporary name given to a table or column. Rename is nothing but replacement of name and Alias is an ALTERNATE name of the table or column.

Rename is a permanent name given to a table or a column whereas Alias is a temporary name given to a table or column. Rename is nothing but replacement of name and Alias is an alternate name of the table or column.

17.

How Do We Get Field Details Of A Table?

Answer»

Describe <Table_Name&GT; is USED to GET the FIELD DETAILS of a specified table.

 

Describe <Table_Name> is used to get the field details of a specified table.

 

18.

What Is Varray?

Answer»

VArray is an ORACLE DATA type USED to have columns CONTAINING multivalued attributes and it can hold bounded array of VALUES.

 

VArray is an oracle data type used to have columns containing multivalued attributes and it can hold bounded array of values.

 

19.

What Is Cross Join?

Answer»

Cross JOIN is defined as the Cartesian PRODUCT of RECORDS from the tables present in the join. Cross join will produce result which combines each row from the first table with the each row from the second table. 

Cross join is defined as the Cartesian product of records from the tables present in the join. Cross join will produce result which combines each row from the first table with the each row from the second table. 

20.

What Is A Sub Query And What Are The Different Types Of Sub Queries?

Answer»

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:

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.

Non-Correlated SUBQUERYThis can be evaluated as if it were an independent query. Results of the sub query are submitted to the main query or PARENT query.

 

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:

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.

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.

 

21.

What Do You Mean By Group By Clause?

Answer»

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.

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.

22.

What Is With Check Option?

Answer»

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.

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.

23.

What Is Key Preserved Table?

Answer»

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.

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.

24.

What Is The Usage Of Merge Statement?

Answer»

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.

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.

25.

How Do We Display Rows From The Table Without Duplicates?

Answer»

Duplicate ROWS can be removed by using the keyword DISTINCT in the select STATEMENT.

Duplicate rows can be removed by using the keyword DISTINCT in the select statement.

26.

What Is The Difference Between Translate And Replace?

Answer»

Translate is used for CHARACTER by character substitution and REPLACE is used substitute a SINGLE character with a WORD.

Translate is used for character by character substitution and Replace is used substitute a single character with a word.

27.

What Is Blob Datatype?

Answer»

A BLOB DATA type is a varying length BINARY string which is used to STORE two gigabytes memory. Length should be specified in BYTES for BLOB.

A BLOB data type is a varying length binary string which is used to store two gigabytes memory. Length should be specified in Bytes for BLOB.

28.

What Is Coalesce Function?

Answer»

COALESCE FUNCTION is USED to return the value which is SET to be not null in the list. If all values in the list are null, then the coalesce function will return NULL.

Coalesce(value1, value2,VALUE3,…)

COALESCE function is used to return the value which is set to be not null in the list. If all values in the list are null, then the coalesce function will return NULL.

Coalesce(value1, value2,value3,…)

29.

What Are Nested Tables?

Answer»

NESTED table is a data type in ORACLE which is used to support columns CONTAINING multi VALUED attributes. It also hold ENTIRE sub table.

 

Nested table is a data type in Oracle which is used to support columns containing multi valued attributes. It also hold entire sub table.

 

30.

What Is The Use Of Nvl Function?

Answer»

The NVL function is used to replace NULL VALUES with ANOTHER or GIVEN value.

Example is – NVL(Value, replace value)

The NVL function is used to replace NULL values with another or given value.

Example is – NVL(Value, replace value)

31.

What Is Raw Datatype?

Answer»

RAW datatype is USED to store VALUES in binary data FORMAT. The maximum SIZE for a raw in a table in 32767 bytes.

RAW datatype is used to store values in binary data format. The maximum size for a raw in a table in 32767 bytes.

32.

Difference Between Varchar And Varchar2 Data Types?

Answer»

VARCHAR can store upto 2000 BYTES and varchar2 can store upto 4000 bytes. Varchar will occupy SPACE for NULL values and Varchar2 will not occupy any space. Both are DIFFERED with respect to space.

 

Varchar can store upto 2000 bytes and varchar2 can store upto 4000 bytes. Varchar will occupy space for NULL values and Varchar2 will not occupy any space. Both are differed with respect to space.