Sunteți pe pagina 1din 6

iGATE GLOBAL SOLUTIONS LTD

Oracle Exit Test


Part I: Answer the following
1. Choose two options which are FALSE about primary key
a. Primary key does not allow duplicates
b. Primary key allows NULL
c. Primary key column can have other constraints also
d. Indexing can be implemented on primary key columns.
2. Which two points are FALSE about redundancy
a. It is unnecessary repetition of data
b. In a many to many relation redundancy can be removed.
c. Redundancy exists when tables are joined
d. Redundancy means having too many columns in a single table.
3. Which normal form eliminated the repeating groups by putting each into a separate
table and connecting them with a one-to-many relations?
4. Null function will return ___________________ if null value is given to it.
5.

_______________ clause eliminates duplicate rows

6. ________________command is used for giving access privileges


7.

_________________ table consists of all tables and views of the schema

8. SELECT ROUND(TRUNC(MOD(1600,10),-1),2)
FROM dual returns __________
9. NVL(100/efficiency,non) will cause an error when efficiency is null since
a.
b.
c.
d.

The expression attempts to divide a NULL value.


The character string none is not a valid value for the NVL substitution.
A NULL value cannot be converted into a string value with any function.
A NULL value used in an expression cannot be converted to an actual
value.

10. A table becomes self referential when


FPB I CHN 2006

Page 1 of 6

iGATE GLOBAL SOLUTIONS LTD


Oracle Exit Test
a. When there is no foreign key for the primary key of the table
b. If the parent key and the foreign key are in the same table
c. When a foreign key exists without a primary key
d. When there are two foreign keys for one primary key
11. Which operators can be used for a subquery to return multiple rows? (Choose all
that apply.)
a. IN
b. AT
c. ALL
d. ANY
e. <>
12. Sasha an Oracle administrator, develops a SQL statement to display data from the
employees and companies tables. He creates the SQL statement:
SELECT e.last_name, e.first_name, co.company_name, co.location
FROM employees e, companies co
WHERE e.company_name (+) = co.company_name;
Which of the following statements is correct?
a. All entries from the company_name column in the employees table are
returned
b. All entries from the company_name column in employees and companies
tables are returned.
c. All entries from the company_name column in the companies table are
returned.
d. Only matched entries from the company_name columns of both tables are
returned.
13. Choose the query that produces the following output
HIRE_DATE LAST_NAME
FIRST_NAME
08-APR-97 McGee
Francois
15-OCT-94 Chung
Tonya
28-DEC-89 Schmidt
Johan

EMPLOYEE_ID
DP81
DP56
DP118

a. SELECT hire_date(1), last_name, first_name, employee_id,


FROM employees;
b. SELECT last_name, first_name, employee_id, hire_date(1)
FROM employees;
c. SELECT hire_date, last_name, first_name, employee_id
FROM employees;
d. SELECT hire_date, last_name, first_name, employee_id, employees;

FPB I CHN 2006

Page 2 of 6

iGATE GLOBAL SOLUTIONS LTD


Oracle Exit Test
14. You wish to write a statement that would show you all employees who work for
your company in its Toronto and Fredericton offices, which of the following options
would accomplish that task?
a. SELECT b.name, sub.loc
FROM emp b, (SELECT deptno, loc
FROM dept
WHERE loc IN (TORONTO, FREDERICTON)) sub
WHERE b.deptno = sub.deptno;
b. SELECT b.name, sub.loc
FROM emp b, (SELECT deptno, loc
FROM dept
WHERE loc IN ('TORONTO', 'FREDERICTON')) sub
WHERE b.deptno = sub.deptno;
c. SELECT b.name, sub.loc
FROM emp b, (SELECT deptno, loc
FROM dept
WHERE loc FROM ('TORONTO', 'FREDERICTON')) sub
WHERE b.deptno = sub.deptno;
d. SELECT b.name, sub.loc
FROM emp b, (SELECT deptno
FROM dept
WHERE loc IN 'TORONTO', 'FREDERICTON') sub
WHERE b.deptno = sub.deptno
15. Which predefined Oracle Server exception would you use to handle an error caused
by a SQL statement that does not return any rows?
a. VALUE_ERROR
b. NO_DATA_FOUND
c. TOO_MANY_ROWS
d. ACCESS_INTO_NULL
e. COLLECTION_IS_NULL
16. You need to drop a table from within a stored procedure. How do you implement
this?
a. You cannot drop a table from a stored procedure.
b. Use the DROP command in the procedure to drop the table.
c. Use the DBMS_DDL packaged routines in the procedure to drop the table.
d. Use the DBMS_SQL packaged routines in the procedure to drop the table.
e. Use the DBMS_DROP packaged routines in the procedure to drop the
table.

FPB I CHN 2006

Page 3 of 6

iGATE GLOBAL SOLUTIONS LTD


Oracle Exit Test
17. ____________________ attribute is used to define a variable of the same data type
as a column in a table
18. %ISOPEN holds false when
a. the cursor has been closed
b. the cursor has not been opened
c. the cursor has not been declared
d. when we assign false to it
19. Create sequence s1 start with 2 minvalue 1 increment by 1 maxvalue 20;
Select s1.nextval from dual;
Select s1.nextval from dual;
What is the output of the last SQL Statement? ---------20. Which code can you use to ensure that the salary is not increased by more than 10%
at a time nor is it ever decreased?
a. ALTER TABLE emp ADD
CONSTRAINT ck_sal CHECK (sal BETWEEN sal AND sal*1.1);
b. CREATE OR REPLACE TRIGGER check_sal
BEFORE UPDATE OF sal ON emp
FOR EACH ROW
WHEN (new.sal < old.sal OR new.sal > old.sal * 1.1)
BEGIN
RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease
salary not increase by more than 10%');
END;
c. CREATE OR REPLACE TRIGGER check_sal
BEFORE UPDATE OF sal ON emp
WHEN (new.sal < old.sal OR
new.sal > old.sal * 1.1)
BEGIN
RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease
salary not increase by more than 10%');
END;
d.
CREATE OR REPLACE TRIGGER check_sal
AFTER UPDATE OR sal ON emp
WHEN (new.sal < old.sal OR
-new.sal > old.sal * 1.1)
BEGIN
RAISE_APPLICATION_ERROR ( - 20508, 'Do not decrease
salary not increase by more than 10%');
END;

FPB I CHN 2006

Page 4 of 6

iGATE GLOBAL SOLUTIONS LTD


Oracle Exit Test
Part II - Write queries to do the following:
1. To list the employees along with their annual income ( income = sal+comm.)

2. List the location that contains maximum number of departments

3. List the employees who have completed at least 5 years of service

4. Add a column to emp table to accept Qualification. It should not contain null values

5. Architect team consists of those who are working in Systems Department and those
who are working as Analyst. List the members of Architect team

Part III - Write PL/SQL blocks to do the following


1. Salary has been increased by 15% to all those who are working as ANALYST.
Update all those eligible records.
2. Write a stored procedure to calculate the net pay of an employee by accepting the
empid. Output should be in a neat format and display error messages wherever
applicable
a. Net pay = gross pay (pf +additional dedns.)
b. Grosspay = basic + hra + sa+da
c. Hra = 60% 0f basic, sa = 5000, da = 20% (basic + hra)

FPB I CHN 2006

Page 5 of 6

iGATE GLOBAL SOLUTIONS LTD


Oracle Exit Test

FPB I CHN 2006

Page 6 of 6

S-ar putea să vă placă și