PL/SQL Datatypes - questions and answers

PL/SQL Datatypes - questions and answers


1) What are the different datatypes that can be defined in a PL/SQL block?

A) Scalar
B) Composite
C) Reference
D) LOB
E) All mentioned above
F) None of the above
View Answer / Hide Answer

ANSWER: E) All mentioned above




2) Which of the following has internal components that can be manipulated individually, such as the elements of an array, record, or table?

A) A Composite
B) A LOB
C) A Reference
D) A Scalar
View Answer / Hide Answer

ANSWER: A) A Composite




3) SIGNTYPE lets you restrict an integer variable to the values -1, 0, and 1, which is useful in programming tri-state logic.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




4) Which subtypes are used to declare fixed-point numbers with a maximum precision of 38 decimal digits?

A) INTEGER,INT,SMALLINT
B) DOUBLE PRECISION,FLOAT
C) DEC,DECIMAL,NUMERIC
D) None of the above
View Answer / Hide Answer

ANSWER: C) DEC,DECIMAL,NUMERIC




5) The BINARY_INTEGER and PLS_INTEGER datatypes are not identical.

A) True
B) False
View Answer / Hide Answer

ANSWER: B) False




6) Use the ROWID datatype only for backward compatibility with old applications. For new applications, use the UROWID datatype.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




7) How many bytes does each character in the AL16UTF16 encoding take up?

A) 1
B) 2
C) 3
D) 6
View Answer / Hide Answer

ANSWER: B) 2




8) How many bytes does each character in the UTF8 encoding take up?

A) 1
B) 2
C) 3
D) All mentioned above
View Answer / Hide Answer

ANSWER: D) All mentioned above




9) Which datatype is used to store large blocks of character data in the database, in-line or out-of-line? Both fixed-width and variable-width character sets are supported.

A) BLOB
B) CLOB
C) BFILE
D) NCLOB
View Answer / Hide Answer

ANSWER: B) CLOB




10) PL/SQL is a transaction processing procedural language that has which of the following advantages?

A) Integration with database
B) Better Performance
C) Higher Productivity
D) Poratability
E) All mentioned above
F) None of the above
View Answer / Hide Answer

ANSWER: E) All mentioned above




11) A RECORD is a collection of data items, which differ from each other in data type, but are logically related.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




12) Which datatypes can be used with a RECORD Type?

A) NUMBER,VRCHAR2
B) %TYPE,OR %ROWTYPE
C) REF,CURSOR
D) BOTH A & B
E) BOTH B & C
View Answer / Hide Answer

ANSWER: D) BOTH A & B




13) What is the advantage of using the %ROWTYPE datatype?

A)It is useful to retrieve an entire row from a table. If you do not use the %ROWTYPE datatype, then you have to declare variables for each column separately.
B)It can be used even if data type of the table columns is not known.
C)It ensures that data type of the variable changes dynamically if the underlying table is altered.
D) All mentioned above
E) Both A & B
View Answer / Hide Answer

ANSWER: D) All mentioned above




14) Is it possible to define a NOT NULL field in a record?

A) Yes
B) No
View Answer / Hide Answer

ANSWER: A) Yes




15) Is it possible to define a CONSTANT value in a record?

A) Yes
B) No
View Answer / Hide Answer

ANSWER: B) No




16) LOB locators are values, which specify the location of the large object.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




17) Oracle-supplied package called DBMS.J_OB is used to manipulate the LOB objects.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




18) The LOB objects can be stored in-line or out-of-line. The in-line storage means that objects are stored.

A) Along with the row
B) Outside the row
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: A) Along with the row




19) Which datatype is not allowed in the definition of PL/SQL record?

A) A Collection
B) A Scalar
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: A) A Collection




20) Which data type supports only sequential access of objects?

A) LONG
B) LOB
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: A) LONG




21) Explicit datatypes, %TYPE and %ROWTYPE, without size specification can be used for parameters in a procedure.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




22) Can BOOLEAN datatype be used in functions that are called from SQL statements?

A) Yes
B) No
View Answer / Hide Answer

ANSWER: B) No


Post your comment