Está en la página 1de 7

RDBMS

http://oracle-questions.blogspot.in/2008/01/pl-sql-interview-questions.html

1. A DBMS that runs on many different operating systems is said to be _________.


A: Scalable
B: Robust
C: Platform independent
D: Distributed
2. DDL statements in SQL are _________.
A: SELECT, UPDATE, DELETE, ALTER, CREATE, ALTER, DROP
B: SELECT, DELETE, ALTER, CREATE, ALTER, DROP
C: CREATE, ALTER, DROP
D: None of the above.
3. Which is not true about single row functions?
A: cannot be nested
B: manipulate data items
C: act on each row returned
D: return one result per row
4. The commit and rollback commands are not applicable for __________
A: Insert
B: Create
C: Delete
D: Update
5. If you drop a parent row for which, a child exists, then what is the default behavior?
A: It wont allow. Error will be returned.
B: It will delete all the child rows along with the parent row.
C: Only parent row is deleted.
D: With the parent row, the first child row in the child table will be deleted.
6. To write a query that performs an outer join of tables A and B and returns all rows
From B, You need to write__________.
A: any outer join
B: a left outer join
C: a right outer join
D: an inner join
7. Which of the following is best describes an inline view?
A: A schema object
B: A subquery that can contain an ORDER BY clause
C: A subquery that is part of the FROM clause of another query

D: Another name for a view that contains group functions

8. Compound key is _________.


A: made up of a several pieces of information
B: Uniquely identifies an item in a list
C: a combination of each unique key
D: Both A and B
9. You are running a query against a relational database. What clause or command do
you use in the query to help avoid a costly table scan?
A: GROUP BY clause
B: INDEX command
C: HAVING clause
D: WHERE clause
10. With SQL, how do you select all the records from a table named "Persons" where
the value of the column "FirstName" starts with an "a"?
A: SELECT * FROM PERSONS WHERE FIRSTnAME LIKE %a;
B: SELECT * FROM PERSONS WHERE UPPER (FIRSTNAME) LIKE %a%;
C: SELECT * FROM PERSONS WHERE FIRSTNAME =%a;
D: SELECT * FROM PERSONS WHERE FIRSTNAME LIKE a%;
11. In a PL/SQL block the ___________ statement has to be associated with the INTO
clause.
A: Commit
B: Delete
C: Select
D: Update
12. _______ pragma is used to attach a user defined error name with predefined error
number.
A: AUTONOMOUS TRANSACTON
B: EXCEPTION_INIT
C: ERROR_INIT
D: RESTRICT_REFERENCES
13. Which of the following query will give error?
A: select count(sysdate) from tab;
B: select count(8) from emp;
C: select count(d) from dual;
D: SELECT COUNT(+) FROM DUAL;

14. The term Entity stand for _____________.


A: A Row
B: A Table
C: A column
D: None of these
15. Which statement would you use to remove the EMPLOYEE_ID_PK PRIMARY KEY
constraint and all depending constraints from the EMPLOYEE table?
A: ALTER TABLE employee DELETE PRIMARY KEY CASCADE;
B: ALTER TABLE employee DROP PRIMARY KEY CASCADE;
C: MODIFY TABLE employee DROP CONSTRAINT employee_id_pk CASCADE;
D: ALTER TABLE employee DROP PRIMARY KEY employee_id_pk CASCADE;
16. A relation is called in 2nd normal form, when ______.
A: It is in 1st normal form
B: No partial dependency
C: It has no transitive dependency
D: Both A and B
17. To impose conditions on the grouped values _______.
A: Where condition is used
B: HAVING Clause is used
C: Conditions cannot be imposed on grouped values
D: None of these
18. To produce a meaningful result set without any cartesian products, what is the
minimum number of conditions that should appear in the WHERE clause of a
four- table join?
A: 5
B: 2
C: 3
D: 4
19. You alter the database with this command: alter table inventory modify (price
number(8,2) default 0);
Which task was accomplished? Choose the best answer.
A: A new column was added to the table
B: A column constraint was added to the table
C: A column was altered.
D: A default value was added to a column

20. You define a multiple-row subquery in the WHERE clause of an SQL query with a
comparison operator "=".What happens when the main query is executed?
A: The main query executes with the first value returned by the subquery.
B: The main query executes with the last value returned by the subquery.
C: The main query fails because the multiple-row subquery cannot be used with the
comparison operator.
D: You cannot define a multiple-row subquery in the WHERE clause of a SQL query.

21. The name column of a Student table is having values as follows:


Ajay
Aman
Brajesh
ManmeetSingh
Navneet
Khusboo
Zawed
What will be the result of the query Select max(name) from student;?
A: Aman
B: Zawed
C: ManmeetSingh
D: Ajay
22. What is true about UNION, INTERSECT, and MINUS?
A: The select statements must have the same number of columns.
B: The corresponding columns in the select statements must be same datatype.
C: The size of the datatype neednt be the same length.
D: All of the above
23. _________ block is mandatory in a PL/SQL block.
A: Declaration
B: Execution
C: Exception
D: Definition
24. Examine the following SQL statement.
SELECT case Hello when 'Hello' then 'Return TRUE' else Return FALSE' end
case from dual;
Which of the following is true about the SQL statement?
A: Error: invalid column name.
B: Error: ORA-00904: "HELLO": invalid identifier
C: The statement will execute properly and prints Return TRUE.
D: The statement will execute properly and prints Return FALSE.

25. __________ Exception will rise when you try to assign a variable into another
variable that is too small to hold it.
A: value_error
B: invalid_number
C: invalid_value_error
D: None of the above.
26. Which statement is true about packages?
A: A package can be called.
B: A package can be nested.
C: A package can be parameterized.
D: Package contents can be shared by multiple applications.
27. Where do you declare an EXPLICIT CURSOR in the PL/SQL language?
A: In the PL/SQL working storage section
B: In the PL/SQL declaration section
C: In the PL/SQL begin section
D: In the PL/SQL exception section
28. Examine the following PL/SQL code.
CREATE OR REPLACE TRIGGER Insert_Trigger AFTER INSERT ON
EMPLOYEES FOR EACH ROW BEGIN
:NEW.FIRST_NAME := UPPER
(:NEW.FIRST_NAME);
END;
/
A: :NEW psuedocolumn cannot be used in Trigger.
B: UPPER function cannot be used in Trigger.
C: The Trigger will execute properly.
D: The Trigger will raise an error.
29. All aggregate function ignores NULLs except for __________?
A: Sum(sal)
B: Count(*)
C: Avg(sal)
D: None of the above.
30. The data in a global temporary table are always ___________?
A: private
B: public
C: global
D: None of the above.

31. In a view, WITH CHECK OPTION __________.


A: Specifies that only the rows that would be retrieved by the subquery can be
inserted
B: Specifies that only the rows that would be retrieved by the subquery can be
updated
C: Specifies that only the rows that would be retrieved by the subquery can be
deleted
D: Specifies that only the rows that would be retrieved by the subquery can be
inserted, updated, or deleted
32. In case of stored procedures and functions, which construct allows you to transfer
values to and from the calling environment?
A: Local variables
B: Formal arguments
C: Boolean variables
D: Substitution variables
33. Functions for error trapping are contained in which section of a PL/SQL block?
A: Header
B: Declarative
C: Executable
D: Exception
34. What are the different events in Triggers?
A: Define, Create
B: Drop, Comment
C: Insert, Update, Delete
D: All of the above
35. What technique is used to speed up access to the data?
A: Table
B: Synonym
C: Index
D: Sequence
36. CREATE OR REPLACE PROCEDURE DEMO (x in number) is
x number := 1001 ;
begin
x := x + 1 ;
dbms_output.put_line(x) ;
end;
After executing the procedure DEMO, what will the value of 'x'
A: 1001
B: 1002
C: Compilation error.

D: None of the above.


37. GRANT and REVOKE are specified in __________ language?
A: DCL
B: DML
C: DDL
D: Both B and C
38. Which of the following SQL functions can operate on any datatype?
A: CEIL
B: TO_CHAR
C: LOWER
D: LPAD
E:MAX
39. You want to display the details of all employees whose last name is Smith, but you
are not sure in which case the last names are stored. Which statement will list all
the employees whose last name is Smith?
A: SELECT lastname, firstname FROM emp WHERE lastname = UPPER('smith');
B: SELECT lastname, firstname FROM emp WHERE lastname = 'smith';
C: SELECT lastname, firstname FROM emp WHERE UPPER(lastname) = 'smith';
D: SELECT lastname, firstname FROM emp WHERE LOWER(lastname) = 'smith';
40. ________ cursors are declared and used by the user to process multiple row,
returned by SELECT statement.
A: Implicit
B: Explicit
C: Internal
D: External

También podría gustarte