Oracle

{"iq":[{"id":"1",
    "q":"What is Oracle table?",
    "answer":"A table is the basic unit of data storage in an Oracle database. The tables of a database hold all of the user accessible data. Table data is stored in rows and columns.    "
  },
    {"id":"2",
      "q":"What is RAW datatype?",
      "answer":"RAW data type is used in storing values in binary data format. The maximum size of a RAW in a table is 32767 bytes."
    },
    {"id":"3",
      "q":"What is BLOB datatype?",
      "answer":"A BLOB data type is a binary string with a varying length which is used in storing two gigabytes memory. Length should be stated in Bytes for BLOB"
    },
    {"id":"4",
      "q":"What is NULL value in Oracle?",

      "answer":"NULL value represents unknown or missing data. It is used as a place holder or represented as a default entry indicating that no actual data is present. "
    },
    {"id":"5",
      "q":"What is WITH CHECK OPTION?",
      "answer":"The WITH CHECK option clause specifies the level of check to be done in DML statements. It aids in preventing changes to a view that would produce results not contained in the sub query."
    },
    {"id":"6",
      "q":"What is the difference between varchar and varchar2 data types? ",
      "answer":"Varchar can store up to 2000 bytes and varchar2 can store up to 4000 bytes. While Varchar will occupy space for NULL value, Varchar2 will not occupy any space. They are differentiated by space.  "
    },

    {"id":"7",
      "q":"What is the use of NVL function?",
      "answer":"The NVL function is used for replacing NULL values with given or another value. E.g.  NVL(Value, replace value)"
    },

    {"id":"8",
      "q":"How do we get field detail of a table?",
      "answer":"To get the field of a specified table use, Describe <Table_Name> "
    },
    {"id":"9",
      "q":"What is an ALERT?",

      "answer":"An alert is a window which appears in the center of the screen and overlays a portion of the current play."
    },

    {"id":"10",
      "q":"What is the fastest query method to fetch data from the table?",
      "answer":"You can use ROWID to fetch Row from the table. The use of ROW ID is the fastest query method for fetching data from the table."
    },

    {"id":"11",
      "q":"What is the parameter mode that can be passed to a procedure?",

      "answer":"The parameter modes that can be passed to a procedure are IN, OUT and INOUT"
    },

    {"id":"12",
      "q":"What are SET operators?",
      "answer":"SET operators are used with two or more queries. The operators are Union, Union All, intersect and Minus."
    },
    {"id":"13",
      "q":"List the various Oracle database objects.",
      "answer":"- TABLES\n- VIEWS\n- INDEXES\n- SYNONYMS\n- SEQUENCES\n- TABLESPACES"
    },

    {"id":"14",
      "q":"List the types of joins used in writing SUBQUERIES.",
      "answer":"- Self join\n- Outer Join\n- Equi-join"
    },

    {"id":"15",
      "q":"Explain i.) Rename ii.) Alias.",
      "answer":"- Rename - It is a permanent name provided to a table or column.\n\n- Alias - It is a temporary name provided to a table or column which gets over after the execution of SQL statement."
    },

    {"id":"16",
      "q":"What are the varoius components of physical database structure of Oracle database?",
      "answer":"Oracle database comprises of three kinds of files:\n- Datafiles,\n- Redo log files,\n- Control files. "
    },

    {"id":"17",
      "q":"What is a view?",
      "answer":"It is virtual table which is defined as a stored procedure based on one or more tables. "
    },
    {"id":"18",
      "q":"What do you mean by a tablespace? ",
      "answer":"These are the Logical Storage Units into which a database is divided.\n- It is used to group together the related logical structures. "
    },

    {"id":"19",
      "q":"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. "
    },

    {"id":"20",
      "q":"What is DML?",
      "answer":"Data Manipulation Language (DML) is used to access and manipulate data in the existing objects.  DML statements are insert, select, update and delete and it won’t implicitly commit the current transaction."
    },
    {"id":"21",
      "q":"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.  "
    },
    {"id":"22",
      "q":"What is NULL value in oracle? ",
      "answer":"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. "
    },

    {"id":"23",
      "q":"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."
    },{"id":"24",
      "q":"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."
    },{"id":"25",
      "q":"What is the use of Aggregate functions in Oracle?",
      "answer":"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 –\nAverage\nCount\nSum"
    },{"id":"26",
      "q":"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."
    },{"id":"27",
      "q":"How do we create privileges in Oracle?",
      "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.\n\n[sql]GRANT user1 TO user2 WITH MANAGER OPTION;[/sql] "
    },{"id":"28",
      "q":"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."
    },{"id":"29",
      "q":"How do we get field details of a table?",
      "answer":"Describe <Table_Name> is used to get the field details of a specified table."
    },{"id":"30",
      "q":"What do you mean by a deadlock?",
      "answer":"- When two processes are waiting to update the rows of a table which are locked by another process, the situation is called a deadlock.\n- The reasons for it to happen are:\n- lack of proper row lock commands.\n- Poor design of front-end application\n- It reduces the performance of the server severely.\n- These locks get automatically released automatically when a commit/rollback operation is performed or any process is killed externally."
    },{"id":"31",
      "q":"What are the various types of snapshots ? ",
      "answer":"There are two types of snapshots:- Simple snapshots - Based on a query that does not contain GROUP BY clauses, CONNECT BY clauses, JOINs, sub-query or snashot of operations.\n- Complex snapshots- which contains atleast any one of the above."
    },{"id":"32",
      "q":"What is a sub query? What are its various types?",
      "answer":" - Sub Query also termed as Nested Query or Inner Query is used to get data from multiple tables.\n- A sub query is added in the where clause of the main query."
    },{"id":"33",
      "q":"What is Merge Statement used for?",
      "answer":"- Merge statement is used to select rows from one or more data source to updating and insert into a table or a view. "
    },{"id":"34",
      "q":"Differentiate between pre-select and pre-query.",
      "answer":"- Once oracle forms construct the select statement to be issued Pre-select is fired during the execute query and count query processing. All this happens before the statement is actually issued.\n- The pre-query trigger is fired just before oracle forms issue the select statement to the database."
    },{"id":"35",
      "q":"What is meant by recursive hints in oracle?",
      "answer":"Number of times a dictionary table is repeatedly called by various processes is known as recursive hint. It occurs because of the small size of data dictionary cache."
    },{"id":"36",
      "q":" Explain the use of INDEXES option in IMP command.",
      "answer":"It determines whether indexes are imported. "
    },{"id":"37",
      "q":"Explain the use of GRANT option in IMP command.",
      "answer":"GRANT specifies to import object grants.."
    },{"id":"38",
      "q":" 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.\nSUBSTR returns string whereas INSTR returns numeric."
    },{"id":"39",
      "q":" 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."
    },{"id":"40",
      "q":"  What are the differences between LOV and List Item?",
      "answer":"LOV is property whereas list items are considered as single item. List of items is set to be a collection of list of items. A list item can have only one column, LOV can have one or more columns."
    },{"id":"41",
      "q":" 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."
    },{"id":"42",
      "q":"What is the difference between $ORACLE_BASE and $ORACLE_HOME? ",
      "answer":"Oracle base is the main or root directory of an oracle whereas ORACLE_HOME is located beneath base folder in which all oracle products reside."
    },{"id":"43",
      "q":"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."
    },{"id":"44",
      "q":"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."
    },{"id":"45",
      "q":"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’."
    },{"id":"46",
      "q":" What is difference between Cartesian Join and Cross Join?",
      "answer":"There are no differences between the join. Cartesian and Cross joins are same. Cross join gives cartesian product of two tables – Rows from first table is multiplied with another table which is called cartesian product.\nCross join without where clause gives Cartesian product."
    },{"id":"47",
      "q":" How can we view last record added to a table?",
      "answer":"Last record can be added to a table and this can be done by –\nSelect * from (select * from employees order by rownum desc) where rownum<2; ."
    },{"id":"48",
      "q":"What is Implicit Cursor and Explicit Cursor ?",
      "answer":"Implicit Cursor is defined and controlled by Oracle Internally.\n\nExample :-\n\ndeclare\nv_ename varchar2(50);\nbegin\nselect ename into v_ename from emp where empno = 10;\nend;\n\nselect query used in above PL/SQL block is an implicit cursor\n\n\nb) Explicit Cursor is defined and controlled programatically.\n\nExample :-\n\ndeclare\nv_ename varchar2(50);\nCursor Cur_ename is select ename into v_ename from emp where empno = 10;\nbegin\nOpen Cur_ename;\nFetch Cur_ename into v_ename;\nClose Cur_ename;\nend;"
    },{"id":"49",
      "q":"   How to convert date to Julian Date format ? ",
      "answer":"Using ‘J’ format string\n\nSQL > select to_char(to_date(’24-Jan-2013′,’dd-mon-yyyy’),’J’) as julian from dual;\nJULIAN\n——-\n2456317"
    },{"id":"50",
      "q":"What is the difference between PRIMARY KEY and UNIQUE KEY constraints ? ",
      "answer":"1. UNIQUE KEY columns can have null values but PRIMARY KEY column cannot accept null values.\n\n2. A table can have only one PRIMARY KEY column but many UNIQUE KEY columns allowed."
    }
  ]

}