You are on page 1of 17

Oracle, SQL & PL/SQL

What is the full form of SQL?


A. Structured Query Language

B. Structured Query List

C. Simple Query Language

D. None of these

Answer & Solution Discuss in Board Share

Answer & Solution

Answer: Option A

1) PL/SQL is a completely portable, high-performance transaction processing language.

a. True
b. False

Answer Explanation

ANSWER: True
Explanation:
PL/SQL is a completely portable, high-performance transaction processing language because of the following
advantages:-
2) PL/SQL stored procedures move application code from the server to the client.

a. True
b. False

Answer Explanation

ANSWER: False
Explanation:
A stored procedure has its own limitations. All the applications are stored on the server and they can be accessed by th
clients. If it is stored on clients it becomes difficult to access.

3) Which is a simple or compound symbol that has a special meaning to PL/SQL?

a. Delimiters
b. Identifiers
c. Literals
d. Comments
Answer Explanation

ANSWER: Delimiters
Explanation:
A delimiter is a sequence of one or more characters used to specify the boundary between separate, independent regio
in plain text or other data streams.

4) How many types of literals are available in PL/SQL?

a. 6
b. 2
c. 5
d. 4
Answer Explanation

ANSWER: 5
Explanation:
PL/SQL supports the following kinds of literals:
- Numeric Literals
- Character Literals
- String Literals
- BOOLEAN Literals
- Date and Time Literals

5) Which operator tests set membership?

a. IN Operator
b. BETWEEN Operator
c. LIKE Operator
d. IS NULL Operator
Answer Explanation

ANSWER: IN Operator
Explanation:
The IN condition helps to reduce the need to use multiple OR conditions.

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

a. A Composite
b. A LOB
c. A Reference
d. A Scalar
Answer Explanation

ANSWER: A Composite
Explanation:
A composite has internal components that can be accessed from anywhere.

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

a. INTEGER,INT,SMALLINT
b. DOUBLE PRECISION,FLOAT
c. DEC,DECIMAL,NUMERIC
d. None of the above
Answer Explanation

ANSWER: DEC,DECIMAL,NUMERIC
Explanation:
No explanation is available for this question!

9) What is the maximum number of ELSE clauses that can be included in an IF clause that is not
nested?

a. 1
b. 0
c. 15
d. Any number
Answer Explanation

ANSWER: 1
Explanation:
We can have else clause for every IF clause. But if the IF clause is not nested there is only one else.

10) Which structure executes a sequence of statements repeatedly as long as a condition holds tru

a. Selection structure
b. Iteration structure
c. Sequence structure
d. None of the above
Answer Explanation

ANSWER: Iteration structure


Explanation:
The iteration structure is obtained by the use of loop constructs.

11) “NO_DATA_FOUND” and “TOO_MANY_ROWS” are the two most common errors found when
executing a SELECT statement.
a. True
b. False

Answer Explanation

ANSWER: True
Explanation:
The “NO_DATA_FOUND” error is where the program is not able to find any data. This type of error can be trapped
the exception block.
The “TOO_MANY_ROWS” error is where one row data is conflicting with another row data so it is unable to fetch a
particular data. This error too can be trapped by the exception block.

12) Varrays are a good choice when -

a. The number of elements is known in advance.


b. The elements are usually all accessed in sequence.
c. Both A & B
d. None of the above
Answer Explanation

ANSWER: Both A & B


Explanation:
A varray can store a fixed sequential collection of elements of the same type. It is used to store ordered collection of d

14) When building up a single SQL statement in a string, do not include any semicolon at the end.

a. Yes
b. No

Answer Explanation

ANSWER: Yes
Explanation:
When we are building a single statement we need not add a semicolon at the end but if we are creating an PL/SQL blo
then we should add a semicolon at the end of each statement.
15) Dynamic SQL enables you to build SQL statements dynamically at runtime.

a. True
b. False

Answer Explanation

ANSWER: True
Explanation:
Dynamic SQL helps to write programs that refer SQL statements whose full text is not known until the runtime.

16) Which of the following returns the current value in a specified sequence.

a. CURRVAL
b. NEXTVAL
c. Both A & B
d. None of the above
Answer Explanation

ANSWER: CURRVAL
Explanation:
The CURRVAL returns the current value of the sequence.

17) Which operators combine the results of two queries into one result?

a. Set operator
b. Row Operator
c. Both A & B
d. None of the above
Answer Explanation

ANSWER: Set operator


Explanation:
The set operators combines the results of two queries into a single result. Queries which contain these set operators ar
known as compound queries.
18) A recursive subprogram is one that calls itself.

a. True
b. False

Answer Explanation

ANSWER: True
Explanation:
Every recursive call creates a new instance of the items declared in the subprogram including parameters, variables,
cursors and exceptions.

19) Which of the following provides a way for your program to select multiple rows of data from th
database and then process each row individually.

a. PL/SQL Cursors
b. PL/SQL Trigger
c. PL/SQL Select
d. PL/SQL Process
Answer Explanation

ANSWER: PL/SQL Cursors


Explanation:
Oracle creates a memory area which is known as the context area where the SQL statement is processed and which
contains all the information which is needed for the processing. The cursor is the pointer to this context area.

20) Abbreviate SMTP?

a. Single Mail Transaction Protocol


b. Simple Mail Transfer Protocol
c. Simple Mail Transaction Protocol
d. Simple Mail Transfer Package
Answer Explanation

ANSWER: Simple Mail Transfer Protocol


Explanation:
SMTP is an internet standard email transmission. This protocol is widespread used today. It by default uses TCP port

22) PL/SQL Exception message consists of -

a. Type of Exception
b. An Error Code
c. A message
d. All mentioned above
Answer Explanation

ANSWER: All mentioned above


Explanation:
The exception is written in an block called as the exception block. The errors are described in this block.

23) The keyword All is a shorthand way to refer to all warning messages.

a. Yes
b. No

Answer Explanation

ANSWER: Yes
Explanation:
The all keyword will handle all the errors. We need not name any of the error in specific.

24) The subprogram is called through a database link or as an external procedure.

a. True
b. False

Answer Explanation

ANSWER: True
Explanation:
The NOCOPY is a hint and not a directive means that the compiler can ignore and pass the parameters by value witho
producing the errors. The above statement is a situation where the NOCOPY hint will be ignored.

25) The values of any IN OUT parameters are copied before the subprogram is executed.

a. Yes
b. No

Answer Explanation

ANSWER: Yes
Explanation:
The IN OUT parameters are passed by values by default. During the subprogram execution the temporary variables ho
the output parameter values. If the program is normal the values are copied to the actual parameters. If the program ex
with an unhandled exception the original parameters remain unchanged.

2.

Which is the subset of SQL commands used to manipulate Oracle


Database structures, including tables?

A. Data Definition Language(DDL)

B. Data Manipulation Language(DML)

C. Both of above

D. None
Answer: Option A

3.

Which operator performs pattern matching?

A. BETWEEN operator

B. LIKE operator

C. EXISTS operator

D. None of these

Answer & Solution Discuss in Board Share

Answer: Option B

4.

What operator tests column for the absence of data?

A. EXISTS operator

B. NOT operator

C. IS NULL operator

D. None of these

Answer & Solution Discuss in Board Share

Answer & Solution

Answer: Option C
5.

In SQL, which command(s) is(are) used to change a table's storage


characteristics?

A. ALTER TABLE

B. MODIFY TABLE

C. CHANGE TABLE

D. All of the above

Answer: Option A

In SQL, which of the following is not a data definition language


commands?

A. RENAME

B. REVOKE

C. GRANT

D. UPDATE

Answer: Option D
7.

In SQL, which command is used to SELECT only one copy of each


set of duplicable rows

A. SELECT DISTINCT

B. SELECT UNIQUE

C. SELECT DIFFERENT

D. All of the above

Answer: Option A

8.

A command that lets you change one or more fields in a record is

A. Insert

B. Modify

C. Look-up

D. All of the above

Answer: Option B
9.

Which of the SQL statements is correct?

A. SELECT Username AND Password FROM Users

B. SELECT Username, Password FROM Users

C. SELECT Username, Password WHERE Username = 'user1'

D. None of these

Answer: Option B

10.

The FROM SQL clause is used to...

A. specify what table we are selecting or deleting data FROM

B. specify range for search condition

C. specify search condition

D. None of these

Answer: Option A

1.Which of the following SQL statements deletes all rows in table called SalesData?

A) DELETE FROM SalesData


B) DELETE * FROM SalesData
C) DELETE SalesData
D) DELETE ALL SalesData
2.What is the correct order of the “>” and the “=” operators, when we want to specify greater or equal
search condition?

A) >=
B) =>

3.Which of the following SQL statements does count the rows in the ‘Sales’ table?

A) SELECT COUNT(*) FROM Sales


B) SELECT NUM() FROM Sales
C) SELECT COUNTER(*) FROM Sales
D) SELECT COUNT(*) IN Sales

4.Which of the following SQL statements is correct?

A) SELECT * FROM Sales WHERE Date BETWEEN ’10/12/2005′ AND ’01/01/2006′


B) SELECT FROM Sales WHERE Date BETWEEN (’10/12/2005′, ’01/01/2006′)
C) SELECT FROM Sales WHERE Date BETWEEN ’10/12/2005′ AND ’01/01/2006′
5.What is a stored procedure?

A) A process for data export/import.


B) A set of SQL statements stored and executed as a single entity.
C) Data stored in a database.

6.The BETWEEN SQL keywords specifies …

A) a list of values.
B) a range to test in the SQL query search condition.
C) a column list.

7.The FROM SQL keyword is used to …

A) specify the table we are modifying.


B) specify the table we are are selecting or deleting from.
C) specify the table we are inserting data in.

8.What does the HAVING clause do?

A) The HAVING keyword is used to select distinct values.


B) The HAVING keyword specifies a search condition for an aggregate or a group.
C) The HAVING keyword is used to join 2 or more tables.

9.The SQL DROP TABLE clause is used to…


A) modify an existing table in a database
B) delete a table from the database
C) create a new table in the database

10.What is a primary key?

A) The primary key is a column that can have NULL values.


B) The primary key column is a column or combination of columns whose values can be non-unique.
C) The primary key is a column or combination of columns whose values uniquely identify each row in the
table.

11.The HAVING clause can be used only with …

A) DELETE clause.
B) INSERT clause
C) SELECT clause
D) JOIN clause.

12.Which of the following SQL statements will select all records with all their columns from a table called
Sales.

A) SELECT * FROM SALES WHERE OrderID < 1


B) DELETE FROM Sales
C) SELECT * FROM Sales

13.What does the CREATE TABLE statement do?

A) Creates a new database table


B) Creates a stored procedure
C) Creates a database view

14.There are triggers for…

A) insert and update only


B) update, delete and insert
C) insert and delete only
D) update and delete only

15.The table rows are also known as…

A) Fields
B) Attributes
C) Records
16.Which of the following is true?
A) TRUNCATE TABLE deletes table from a database
B) TRUNCATE TABLE has to be used along with a WHERE clause
C) TRUNCATE TABLE is identical to DELETE statement without WHERE clause and both remove all
rows in a table.

17.The UNION SQL clause can be used with…

A) the SELECT clause only


B) the DELETE and UPDATE clauses
C) the UPDATE clause only

18.Which SQL keyword is used to retrieve only unique values?

A) DIFFERENT
B) DISTINCT
C) UNIQUE
D) DISTINCTIVE

19.Which of the following is true?

A) TRUNCATE TABLE deletes table from a database


B) TRUNCATE TABLE has to be used along with a WHERE clause
C) TRUNCATE TABLE is identical to DELETE statement without WHERE clause and both remove all
rows in a table.

20.The UNION SQL clause can be used with…

A) the SELECT clause only


B) the DELETE and UPDATE clauses
C) the UPDATE clause only

21.The primary – foreign key relations are used to …

A) to index the database.


B) clean-up the database.
C) cross-reference database tables.

22.A trigger is…

A) a special type of view


B) a special type of table
C) a special type of store procedure, executed when certain event occurs
23.Which of the following statements gets the total value of the column ‘Price’ in the ‘Sales’ table?

A) SELECT ADD(Price) FROM Sales


B) SELECT SUM(Price) FROM Sales
C) SELECT TOTAL(Price) FROM Sales
D) SELECT SUM(Price) WHERE Sales

24.Which SQL statement inserts data into a table called Projects?

A) INSERT Projects VALUES (‘Content Development’, ‘Website content development project’)


B) INSERT INTO Projects (ProjectName, ProjectDescription) VALUES (‘Content Development’, ‘Website
content development project’)
C) SAVE INTO Projects (ProjectName, ProjectDescription) VALUES (‘Content Development’, ‘Website
content development project’)
D) INSERT Projects (‘Content Development’, ‘Website content development project’)

25.Which of the following SQL statements deletes all rows in table called SalesData?

A) DELETE FROM SalesData


B) DELETE * FROM SalesData
C) DELETE SalesData
D) DELETE ALL SalesData
Correct Answers

1=A 2=A 3=A 4=A

6=B 7=B 8=B 9=B

11=C 12=C 13=A 14=B

16=C 17=A 18=B 19=C

21=C 22=C 23=B 24=B

You might also like