Pro*C/C++ Interview Questions & Answers

4 avg. rating (80% score) - 2 votes

Pro*C/C++ Interview Questions & Answers

If you are an expert in Pro*C/C++ then this is for you. Let us know if you looking for a job change? Then do not worry, we’ve a right answer for your job interview preparation. If you are preparing for Pro*C/C++ job interview then go through Wisdomjobs interview questions and answers page. Pro*C/C++ is an embedded sql language. It is used by Oracle database. It uses C or C++ as its host language. The result will be either compiled by C or C++ based on the precompiler. The sql statements are translated into standard lib calls during runtime. Good knowledge on the Pro*C/C++ topics are must to crack the job. Below are the Pro*C/C++ interview questions and answers which makes you comfortable to face the interviews:

Pro*C/C++ Interview Questions

Pro*C/C++ Interview Questions
    1. Question 1. 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.

       

    2. Question 2. 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.

    3. Question 3. 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)

    4. Question 4. 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.

       

    5. Question 5. 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,…)

    6. Question 6. 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.

    7. Question 7. 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.

    8. Question 8. 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.

    9. Question 9. 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.

    10. Question 10. What Is Using Clause And Give Example?

      Answer :

      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.

    11. Question 11. 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.

    12. Question 12. 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.

    13. Question 13. 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.

    14. Question 14. 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 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.

       

    15. Question 15. 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. 

    16. Question 16. 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.

       

    17. Question 17. How Do We Get Field Details Of A Table?

      Answer :

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

       

    18. Question 18. 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.

    19. Question 19. What Is A View?

      Answer :

      View is a logical table which based on one or more tables or views.  The tables upon which the view is based are called Base Tables and it doesn’t contain data.

    20. Question 20. What Is A Cursor Variable?

      Answer :

      A cursor variable is associated with different statements which can hold different values at run time. A cursor variable is a kind of reference type.

    21. Question 21. 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.

    22. Question 22. What Are Set Operators?

      Answer :

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

    23. Question 23. How Can We Delete Duplicate Rows In A Table?

      Answer :

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

    24. Question 24. 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.

    25. Question 25. 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.

    26. Question 26. What Is An Integrity Constraint?

      Answer :

      An integrity constraint is a declaration defined a business rule for a table column. Integrity constraints are used to ensure accuracy and consistency of data in a database. There are types – Domain Integrity, Referential Integrity and Domain Integrity.

    27. Question 27. What Is An Alert?

      Answer :

      An alert is a window which appears in the center of the screen overlaying a portion of the current display.

    28. Question 28. What Is Hash Cluster?

      Answer :

      Hash Cluster is a technique used to store the table for faster retrieval. Apply hash value on the table to retrieve the rows from the table.

    29. Question 29. What Is Difference Between Substr And Instr?

      Answer :

      • SUBSTR returns specific portion of a string and INSTR provides character position in which a pattern is found in a string.
      • SUBSTR returns string whereas INSTR returns numeric.

    30. Question 30. 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.

    31. Question 31. 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.

    32. Question 32. What Is The Fastest Query Method To Fetch Data From The Table?

      Answer :

      Row can be fetched from table by using ROWID. Using ROW ID is the fastest query method to fetch data from the table.

    33. Question 33. 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.

    34. Question 34. 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]

    35. Question 35. 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’.

       

    36. Question 36. What Do You Mean By Inline Function?

      Answer :

      An inline function is a function that is expanded inline when invoked.ie. the compiler replaces the function call with the corresponding function code. An inline function is a function that is expanded in line when it is invoked. That is the compiler replaces the function call with the corresponding function code (similar to macro).

    37. Question 37. What Is The Difference Between A Copy Constructor And An Overloaded Assignment Operator?

      Answer :

      A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class.

       

    38. Question 38. 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.

    39. Question 39. What Is Friend Function?

      Answer :

      The function declaration should be preceded by the keyword friend. The function definitions does not use either the keyword or the scope operator ::. The functions that are declared with the keyword friend as friend function. Thus, a friend function is an ordinary function or a member of another class.

    40. Question 40. What Is An Iterator?

      Answer :

      Iterators are like pointers. They are used to access the elements of containers thus providing a link between algorithms and containers. Iterators are defined for specific containers and used as arguments to algorithms.

    41. Question 41. 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).

    42. Question 42. What Is An Explicit Constructor?

      Answer :

      A conversion constructor declared with the explicit keyword. The compiler does not use an explicit constructor to implement an implied conversion of types. It’s purpose is reserved explicitly for construction. Explicit constructors are simply constructors that cannot take part in an implicit conversion.

    43. Question 43. 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.

    44. Question 44. Define Inline Function?

      Answer :

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

    45. Question 45. 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.

C++ Tutorial

Pro*c/c++ Interview Questions

Pro*c/c++ Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

C++ Tutorial