Sunday 8 February 2015

TOP MNCs asked Oracle Interview Questions and Answers (Page 8)

Below are some important Oracle Database interview questions which are asked in most MNC company interviews for beginners or professionals.

71. What Are the Oracle Built-in Data Types?
There are 20 Oracle built-in data types, divided into 6 groups:
* Character Datatypes - CHAR, NCHAR, NVARCHAR2, VARCHAR2
* Number Datatypes - NUMBER, BINARY_FLOAT, BINARY_DOUBLE
* Long and Row Datatypes - LONG, LONG RAW, RAW
* Datetime Datatypes - DATE, TIMESTAMP, INTERVAL YEAR TO MONTH, INTERVAL DAY TO SECOND
* Large Object Datatypes - BLOB, CLOB, NCLOB, BFILE
* Row ID Datatypes - ROWID, UROWID

72. What Are the Differences between CHAR and NCHAR in Oracle?
Both CHAR and NCHAR are fixed length character data types. But they have the following differences:
* CHAR's size is specified in bytes by default.
* NCHAR's size is specified in characters by default. A character could be 1 byte to 4 bytes long depending on the character set used.
* NCHAR stores characters in Unicode.

73. What Are the Differences between CHAR and VARCHAR2 in Oracle?
The main differences between CHAR and VARCHAR2 are:
* CHAR stores values in fixed lengths. Values are padded with space characters to match the specified length.
* VARCHAR2 stores values in variable lengths. Values are not padded with any characters.

74. What Are the Differences between NUMBER and BINARY_FLOAT in Oracle?
The main differences between NUMBER and BINARY_FLOAT in Oracle are:
* NUMBER stores values as fixed-point numbers using 1 to 22 bytes.
* BINARY_FLOAT stores values as single precision floating-point numbers.

75. What Are the Differences between DATE and TIMESTAMP in Oracle?
The main differences between DATE and TIMESTAMP in Oracle are:
* DATE stores values as century, year, month, date, hour, minute, and second.
* TIMESTAMP stores values as year, month, day, hour, minute, second, and fractional seconds.

76. What Are the Differences between INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND?
The main differences between INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND are:
* INTERVAL YEAR TO MONTH stores values as time intervals at the month level.
* INTERVAL DAY TO SECOND stores values as time intervals at the fractional seconds level.

77. What Are the Differences between BLOB and CLOB in Oracle?
The main differences between BLOB and CLOB in Oracle are:
* BLOB stores values as LOB (Large OBject) in bitstreams.
* CLOB stores values as LOB (Large OBject) in character steams.

78. What Are the ANSI Data Types Supported in Oracle?
The following ANSI data types are supported in Oracle:
* CHARACTER(n) / CHAR(n)
* CHARACTER VARYING(n) / CHAR VARYING(n)
* NATIONAL CHARACTER(n) / NATIONAL CHAR(n) / NCHAR(n)
* NATIONAL CHARACTER VARYING(n) / NATIONAL CHAR VARYING(n) / NCHAR VARYING(n)
* NUMERIC(p,s)
* DECIMAL(p,s)
* INTEGER / INT
* SMALLINT
* FLOAT
* DOUBLE PRECISION
* REAL

79. How To Write Text Literals in Oracle?
There are several ways to write text literals as shown in the following samples:
SELECT 'atoztarget.com' FROM DUAL -- The most common format
atoztarget.com
SELECT 'It''s Sunday!' FROM DUAL -- Single quote escaped
It's Sunday!
SELECT N'Allo, C''est moi.' FROM DUAL -- National chars
Allo, C'est moi.
SELECT Q'/It's Sunday!/' FROM DUAL -- Your own delimiter
It's Sunday!

80. How To Write Numeric Literals in Oracle?
Numeric literals can coded as shown in the following samples:
SELECT 255 FROM DUAL -- An integer
255
SELECT -6.34 FROM DUAL -- A regular number
-6.34
SELECT 2.14F FROM DUAL -- A single-precision floating point
2.14
SELECT -0.5D FROM DUAL -- A double-precision floating point
-0.5
More Questions & Answers :-
Page1  Page2  Page3  Page4  Page5  Page6  
Page7  Page8  Page9  Page10

No comments:

Post a Comment