Skip to main content

Posts

Showing posts from August 10, 2009

Question 15

Write a PL/SQL Program for the following output --*-- -***- ***** -***- --*-- Answer The output based on the value of 'n' declare n number(2) default 20; i number(2); j number(2); h number(2); s number(2); b varchar2(1) default 'I'; begin s := 1; if n mod 2 = 0 then n := n+1; end if; h := n/2 -1; for i in 1..n loop for j in 1..h loop dbms_output.put('-'); end loop; for j in 1..s loop dbms_output.put('*'); end loop; for j in 1..h loop dbms_output.put('-'); end loop; dbms_output.put_line(' '); if n = s then b := 'D'; end if; IF b='I' then s := s+2; h := h-1; else s := s-2; h := h+1; end if; end loop; end;

Question: 14: Drop Table - Dependency

Evaluate the SQL statement DROP TABLE DEPT Which four statements are true of the SQL statement? A. You cannot roll back this statement. B. All pending transactions are committed. C. Al views based on the DEPT table are deleted. D. All indexes based on the DEPT table are dropped. E. All data in the table is deleted, and the table structure is also deleted. F.All data in the table is deleted, but the structure of the table is retained. G.All synonyms based on the DEPT table are deleted. Answer: A, B, D and E Explanation: A. You cannot roll back DROP TABLE statement. B. All pending transactions related on this table arecommitted. D. If the table is dropped, Oracle automatically drops any index, trigger and constraintassociated with the table as well. E. All data in the table is deleted, and the table structure is also deleted. Incorrect Answers C: All views based on the DEPT table become invalid, but they are not deleted. F: All data in the table is deleted, and the table structure is als