Sie sind auf Seite 1von 13

1.

What is the maximum number of handlers processed before the PL/SQL block
is exited when an exeception occurs?

a) Only One

b) All that apply

c) all Referenced

d) None

2. Which statement is valid when removing procedures?

a) Use a drop procedure statement to drop a standalone procedure

b) Use a drop procedure statement to drop a procedure that is part of a


package. Then recompile the package specification.

c) Use a drop procedure statement to drop a procedure that is part of a


package. Then recompile the package body.

d) For faster removal and re-creation, do not use a drop procedure


statement. Instead, recompile the procedure using the alter procedure
statement with the REUSE SETTINGS clause.

3. You query the database with this command SELECT name FROM employee
WHERE name LIKE ‘_a%’; Which names are displayed?

a) Names starting with ?a?

b) Names starting with ?a? or ?A?

c) Names containing ?a? as second character.

d) Names containing ?a? as any letter except the first.

4. Which of these is the default character for specifying runtime variable in


SELECT statement

a) Ampersand

b) Ellipses

c) Quotation marks

d) Asterisk
5. Which of the program declarations are correct for a stored program unit?
(choose 2)

a) CREATE OR REPLACE FUNCTION tax_amt(p_id NUMBER) RETURN NUMBER

b) CREATE OR REPLACE PROCEDURE tax_amt(p_id NUMBER) RETURN


NUMBER

c) CREATE OR REPLACE PROCEDURE tax_amt(p_id NUMBER,p_amount OUT


NUMBER)

d) CREATE OR REPLACE FUNCTION tax_amt(p_id NUMBER) RETURN


NUMBER(10,2)

e) CREATE OR REPLACE PROCEDURE tax_amt(p_id NUMBER, p_amount OUT


NUMBER(10,2))

6. Which procedure can be used to create a customized error message?

a) RAISE_ERROR

b) SQLERRM

c) RAISE_APPLICATION_ERROR

d) RAISE_SERVER_ERROR

7. Which Oracle supplied package can you use to output values and messages
from database triggers, stored procedures and functions within SQL*Plus

a) DBMS_DISPLAY

b) DBMS_OUTPUT

c) DBMS_LIST

d) DBMS_DESCRIBE

8. You want to execute a procedure from SQL plus. However you are not given
the argument list for the procedure. Which command will display to show the
argument list?
a) DESCRIBE

b) SHOWLIST

c) SHOW ARG_LIST

d) SHOW PROCEDURE

9. Which data dictionary views gives you the names and the source code of the
procedure that you have created?

a) USER_SOURCE

b) USER_OBJECTS

c) USER_PROCEDURES

d) USER_SUBPROGRAMS

10.What should you do after each fetch statement in PL/SQL block?

a) Open the cursor

b) Close the cursor

c) Initialize the loop

d) Test for the rows using the cursor attribute.

11.Can you use a commit statement within a database trigger?

a) TRUE

b) FALSE

12.SQL%ISOPEN for implicit cursor is always evaluate to false.

a) TRUE

b) FALSE
13.You want to display the details of employess whose lastname is smith. But
you are not sure in which case last names are stored. Which statement will
list all the employees whose last name is smith?

a) Select last_name, first_name from emp where last_name=’smith’;

b) Select last_name, first_name from emp where upper(last_name)=’smith’;

c) Select last_name, first_name from emp where last_name=upper(‘smith’);

d) Select last_name, first_name from emp where lower(last_name)=’smith’;

14.Evaluate this SQL statement:

SELECT ename,sal,12*sal+100 from emp;

The SAL column stores the monthy salary of the employee. Which change
must be made to the above syntax to calculate the annual compensation as
“monthly salary plus a monthly bonus of $100, multiplies by 12’?

a) No change is required to achieve the desired results

b) SELECT ename,sal, (12*sal)+100 from emp;

c) SELECT ename, sal, 12*(sal+100) from emp;

d) SELECT ename,sal+100,*12 from emp;

15. Creating a foreign key constraint between columns of two tables defined
with two different datatypes will procedure an error.

a) True

b) False

16.Select product_id “Product_ID”,sum(price) “Price”

a) From products

b) Where price>60.00

c) Group by “Product ID”;

d) Order by sum(price);

Which clause will cause an error?


17.How to specify a column alias?

a) Place the alias at the beginning of the statement to describe table

b) Place the alias after each column, separated by white space, describe the
column.

c) Place the alias after each column, separated by a comma, to describe the
column.

d) Place the alias at the end of the statement to describe the table.

18.What is an Index?

a) An index is a database table attribute, which speeds up data search within


a table.

b) An index is the same as alias.

c) An index is a special way to join 2 or more tables.

d) An index is a database row attribute, which speeds up data search within


a table.

19.Which of the following SQL statements is correct?

a) TRUNCATE Sales TABLE;

b) TRUNCATE * FROM TABLE Sales

c) TRUNCATE TABLE Sales;

d) TRUNCATE * FROM COLUMN Sales

20.The IN SQL keyword

a) Is used with the DISTINCT SQL keyword only.

b) Is used with the INSERT SQL keyword only.

c) Determines if a value matches any of the values in a list or a sub query.

d) Defines the tables we are selecting or deleting data from.


21.The LIKE SQL keyword is used along with

a) WHERE clause

b) ORDER BY clause

c) JOIN clause

d) GROUP BY clause

22.You have decided to permanently remove all the data from the STUDENT
table and you need the table structure in the future. Which single command
will perform this?

a) DROP table student;

b) Truncate table student;

c) Delete * from student;

d) Truncate table student KEEP STRUCTURE.

e) Delete * from student KEEP STRUCTURE.

23.Which statement describes the use of a group function?

a) A group function produces a group of results from one row.

b) A group function produces a one results from each row in the table.

c) A group function produces a one results from many

d) A group function produces many of results from many rows.

24.In this PL/SQL statement, Which of the following lines will produce an error?

a) Create or replace function vat (vat_rate IN NUMBER, price IN NUMBER)

b) Declare

c) L_vat NUMBER;

d) Begin
e) No Error

25.Functions for error trapping are contained in which section of a PL/SQL block?

a) HEADER

b) DECLARATIVE

c) EXECUTABLE

d) EXCEPTION

26.Which three definitions are associated with implicit cursors?

a) %rowtype,%toomanyrows,%found

b) %found,%notfound,%rowcount

c) %rowtype,%rowcount,%notfound

d) None of the Above

e) All of the above

27.What does the SQL FROM clause do?

a) Specifies a search condition.

b) Specifies the tables to retrieve rows from.

c) Specifies the columns we are retrieving.

d) Specifies the attributes to retrieve rows from.

28.We refer to a join as a self join when…

a) We are using left and right join together.

b) We are joining two tables only

c) We are joining more than 2 tables

d) We are joining table to itself.


29.Which SQL statement selects all rows from table called contest, which column
contestDate having Values greater or equal to MAY 25,2006?

a) Select * from Contest HAVING ContestDate>=’05/25/2006’

b) Select * from Contest WHERE ContestDate<’05/25/2006’

c) Select * from Contest GROUP BY ContestDate>=’05/25/2006’

d) Select * from Contest WHERE ContestDate>=’05/25/2006’

30.If you don’t specify ASC or DESC after a SQL ORDER BY clause following is
used by default:

a) There is no default value.

b) DESC.

c) ASC.

d) Random

31.What is a Trigger?

a) A Trigger is a special kind of procedures excuted when certain event


occurs

b) A trigger defines relations between tables.

c) A trigger is part of data extraction process

32.What output is the following statement produce ? Select NVL2(NULL, ‘NOT


NULL’, NULL) from dual;

a) NULL

b) NOT NULL

c) Function NVL2 is not defined

d) 0None of the above


33.PL/SQL raises an exception, in which TWO of the following cases:

a) When SELECT statement returns no rows

b) When SELECT statement returns more than one row

c) When the datatypes of SELECT clause and INTO clause do not match

d) When INTO statement is missing in the SELECT statement

34.What is the database cursor?

a) A blinking vertical line that indicates the location of the next input on the
display screen.

b) A cursor is SQL keyword specifying a retrieved data order.

c) Cursor is acronym for current Set Of Records and is a database object


pointing to a

d) Currently selected set of records.

35.What does the term ‘locking’ refer to?

a) locking is a process, which logs database usage.

b) Locking is a process of database authentication.

c) Locking is a process preventing users from reading data being changed by


other users, and prevents concurrent users from changing the same data
at the same time.

36.Which section of a PL/SQL block would most likely contain a RAISE statement?

a) Header

b) Declarative

c) Executable

d) Exception

37.Which of the following statements about an SQL statement are not correct?
a) SQL statements can be on one or more lines.

b) Keywords cannot be split across lines.

c) SQL statements are ot case-sensitiv, unless indicated.

d) Keywords can be abbreviated.

38.The table rows are also known as…

a) Records

b) Fields

c) Attributes

39.What is the ABS SQL function used for?

a) To return the maximum value of a numeric expression.

b) To return the absolute, positive value of a numeric expression.

c) To return the average value of a numeric expression.

d) To return the minimum value of a numeric expression.

40.Can you use both HAVING and WHERE SQL clauses in one SQL statement?

a) TRUE

b) FALSE

41.Normalization is…

a) The process of arranging information stored in a database in a way, which


removes redundancy and ambiguity.

b) A special way of selecting data.

c) The process of adding primary key to a table.

42.When there is failure in fetching the rows from a cursor….


a) %isopen

b) %notfound

c) %found

d) %rowcount

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

a) SELECT COUNT (*) FROM Sales

b) SELECT COUNTER (*) FROM Sales

c) SELECT NUM () FROM Sales

d) SELECT COUNT(*) IN Sales

44.How many columns are presented after excuting this query:

SELECT address1||’,’||address2||’,’|| address2 “Address” FROM employe

a) 1

b) 2

c) 3

d) 0

e) 4

45.What best describes the relationship between indexes and SQL performance?

a) Indexes are only used in special cases

b) Indexes are used to make table storage more efficient

c) Indexes rarely make a difference in SQL performance

d) Indexes exist solely to improve query speed.

46.Which of the following can be a valid column name ?


a) Column

b) 1966_Invoices

c) Catch_#22

d) #Invoices

e) None of the above

47.Which of the following SQL statements is correct?

a) SELECT CustomerName, COUNT(CustomerName) FROM Orders Order BY


CustomerName

b) SELECT CustomerName, COUNT(CustomerName) FROM Orders.

c) SELECT CustomerName, COUNT(CustomerName) FROM Orders Group BY


CustomerName.

48.Consider the following SELECT statement:

SELECT ename,emp_number,salary FROM employee WHERE dept_number


FROM department WHERE location in (‘CHICAGO’,’NEWYORK’))

Why does this statement return an error?

a) A multiple row subquery returns an error?

b) A single row subquery returns more than one row

c) A multiple column subquery returns one column

d) A multiple row query uses a single row subquery

49.Which character function can be used to return a specified portion of a


character string?

a) INSTR

b) SUBSTRING
c) SUBSTR

d) POS

50.To produce a meaningful result set without any Cartesian products, which is
the minimum number of conditions that should appear in the WHERE clause
of a four-table join?

a) 8

b) 2

c) 3

d) 4

Das könnte Ihnen auch gefallen