Semester 2 Mid Term Exam - Documents - docslide.us [PDF]

Nov 12, 2014 - A local variable defined inside a package procedure is visible to the calling environment. True or False?

8 downloads 30 Views 79KB Size

Recommend Stories


Mid-term Exam
Everything in the universe is within you. Ask all from yourself. Rumi

mid-term exam study guide
Every block of stone has a statue inside it and it is the task of the sculptor to discover it. Mich

HOPE Exam Review: Semester 2
What we think, what we become. Buddha

Syllabus for Post mid Term Exam 2017
You can never cross the ocean unless you have the courage to lose sight of the shore. Andrè Gide

solutions to the mid-term exam
Stop acting so small. You are the universe in ecstatic motion. Rumi

Time Table for Remedial Mid Semester Exam (Summer 2017)
Ask yourself: What is my life’s purpose? Am I acting accordingly? Next

2017 High School Semester 2 Exam Schedule
Almost everything will work again if you unplug it for a few minutes, including you. Anne Lamott

End-semester exam
You often feel tired, not because you've done too much, but because you've done too little of what sparks

Second Semester Exam Schedule
Respond to every call that excites your spirit. Rumi

1. semester 2. semester
Everything in the universe is within you. Ask all from yourself. Rumi

Idea Transcript


Upload (/upload/document.html)

Login (/login.html?back=https%3A%2F%2Fdocslide.us%2Fdocuments%2Fsemester-2-mid-term-

exam.html) LEADERSHIP (/CATEGORY/LEADERSHIP-MANAGEMENT.HTML)

MARKETING (/CATEGORY/MARKETING.HTML)

EDUCATION (/CATEGORY/EDUCATION.HTML) Search document...

TECHNOLOGY (/CATEGORY/TECHNOLOGY.HTML)

DESIGN (/CATEGORY/DESIGN.HTML)

MORE TOPICS (/CATEGORY.HTML)

SEARCH

Home (/) / Documents (/category/documents.html) / Semester 2 Mid Term Exam (/documents/semester-2-mid-term-exam.html)

Download

(/download/link/semester-2mid-term-exam)



1

of 32

RECOMMENDED

All materials on our website are shared by users. If you have any questions about copyright issues, please report

(/documents/semester-2-midterm-exam.html)

Mid Term Exam Semester 2

(/document/report/semester-2-mid-term-exam) us to resolve them. We are always happy to assist you.

SEMESTER 2 MID TERM EXAM

228

views

by mohanned-ali

on Nov 12, 2014 Report (/document/report/semester-2-midterm-exam)

Category: DOCUMENTS

Mid Term Exam Semester 2 Which statement about group functions is true? Group functions ignore null values. The PAYMENT table (/documents/mid-term-exam-semester-2.html) contains these columns: PAYMENT_ID NUMBER(9)…

Download: 0 Comment: 0

Semester 2 Mid Term Exam

(/category/documents.html)

Test: Semester 2 Mid Term Exam 1. When a user session changes the value of a package variable, the new va lue can immediately be (/documents/semester-2-mid-term-examseen by other sessions. True or False? Mark…

Comments Description

5584479e931d6.html)

Download Semester 2 Mid Term Exam Semester 2 Mid Term Exam (2) Test: Semester 2 Mid Term Exam 1. Which of the following SQL statements can be included in a PL/SQL block only by using Dynamic (/documents/semester-2-mid-term-exam-2.html) SQL? (Choose two.) Mark for Review (1) Points…

Transcript Test: Semester 2 Mid Term Exam Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 12 (Answer all questions in this section) 1. The following procedure compiles successfully. True or False? CREATE OR REPLACE PACKAGE emp_pkg IS TYPE t_emp IS TABLE OF employees%ROWTYPE INDEX BY BINARY_INTEGER; PROCEDURE emp_proc (p_small_arg IN NUMBER, p_big_arg NOCOPY OUT t_emp); ... END emp_pkg; Mark for Review (1) Points True False (*) Correct 2. What is wrong with this code example? CREATE OR REPLACE PROCEDURE insert_emps IS TYPE t_emp IS TABLE OF employees%ROWTYPE INDEX BY BINARY_INTEGER; v_emptab t_emp; BEGIN FORALL i IN v_emptab.FIRST..v_emptab.LAST INSERT INTO employees VALUES v_emptab(i); END LOOP; END insert_emps; Mark for Review (1) Points The phrase should be FOR ALL. v_emptab is incorrectly typed. FORALL does not require END LOOP. (*) Nothing is wrong; it will compile successfully. Correct 3. In the following example, where do you place the phrase BULK COLLECT? DECLARE TYPE NameList IS TABLE OF emp.ename%TYPE; names NameList; CURSOR c1 IS SELECT ename -- Position A FROM emp WHERE job = 'CLERK'; BEGIN OPEN c1; FETCH c1 -- Position B INTO -- Position C names; ... CLOSE c1; END; Mark for Review (1) Points Position A Position B (*) Position C Correct 4. What are benefits of using the NOCOPY hint? (Choose two) Mark for Review (1) Points (Choose all correct answers) Safer because it uses passing by value. Efficient since it uses less memory. (*) Uses a larger block of server memory for faster access. Faster because a single copy of the data is used. (*) Incorrect. Refer to Section 12 Lesson 2. 5. Name two reasons for using Dynamic SQL. Mark for Review (1) Points (Choose all correct answers) Avoid errrors at compile time of DML statements. Create a SQL statement with varying column data, or different conditions. (*) Enables data-definition statements to be written and executed from PL/SQL. (*) Enables system control statements to be written and executed from PL/SQL. Correct 6. A programmer wants to code a procedure which will create a table with a single column. The datatype of the column will be chosen by the user who invokes the procedure. The programmer writes the following code: CREATE OR REPLACE PROCEDURE create_tab (p_col_datatype IN VARCHAR2) IS BEGIN CREATE TABLE newtab (only_col p_col_datatype); END; Why will this procedure not compile successfully? Mark for Review (1) Points Because you cannot create a table inside a procedure Because the invoking user may not have CREATE TABLE privilege Because when the procedure is compiled, Oracle cannot check if the parameter value passed into the procedure is a valid column datatype (*) Because table NEWTAB may already exist None of the above; the procedure will compile successfully Correct 7. Examine the following procedure, which drops a table whose name is passed as an IN parameter: CREATE OR REPLACE PROCEDURE drop_tab (p_table_name IN VARCHAR2) IS v_sql_statement VARCHAR2(100); BEGIN ... END; Which of the following will work correctly when coded in the procedure's executable section? (Choose two.) Mark for Review (1) Points (Choose all correct answers) EXECUTE IMMEDIATE 'DROP TABLE p_table_name'; EXECUTE IMMEDIATE 'DROP TABLE ' || p_table_name; (*) v_sql_statement := 'DROP TABLE ' || p_table_name; EXECUTE IMMEDIATE v_sql_statement; (*) v_sql_statement := 'DROP TABLE ' || p_table_name; EXECUTE IMMEDIATE 'v_sql_statement'; v_sql_statement := 'DROP TABLE '; EXECUTE IMMEDIATE v_sql_statement p_table_name; Correct 8. What will happen when the following procedure is invoked? CREATE OR REPLACE PROCEDURE do_some_work IS CURSOR c_curs IS SELECT object_name FROM user_objects WHERE object_type = 'FUNCTION'; BEGIN FOR v_curs_rec IN c_curs LOOP EXECUTE IMMEDIATE 'ALTER FUNCTION ' || v_curs_rec.object_name || ' COMPILE'; EXIT WHEN c_curs%ROWCOUNT > 2; END LOOP; END; Mark for Review (1) Points All functions in the user's schema will be recompiled. The first two functions in the user's schema will be recompiled. The first three functions in the user's schema will be recompiled. (*) The procedure will not compile successfully because you cannot ALTER functions using Dynamic SQL. The procedure will not compile successfully because the syntax of the ALTER FUNCTION statement is incorrect. Correct Section 13 (Answer all questions in this section) 9. We want to create a log record automatically every time any DML operation is executed on either or both of the EMPLOYEES and DEPARTMENTS tables. What is the smallest number of triggers that must be create to do this? Mark for Review (1) Points One Two (*) Three Six Eight Correct 10. A BEFORE statement trigger inserts a row into a logging table every time a user updates the salary column of the employees table. The user now tries to update the salaries of three employees with a single UPDATE statement, but the update fails because it violates a check constraint. How many rows will be inserted into the logging table? Mark for Review (1) Points None, the transactions are rolled back because the update failed. (*) One Three Four None of the above Correct Page 1 of 5 Next Summary Test: Semester 2 Mid Term Exam Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 13 (Answer all questions in this section) 11. Which of the following are possible keywords for the timing component of a trigger? (Choose three.) Mark for Review (1) Points (Choose all correct answers) BEFORE (*) INSTEAD WHENEVER INSTEAD OF (*) AFTER (*) Correct 12. We want to prevent employees from being deleted on Sundays. To do this, we create the following trigger: CREATE OR REPLACE TRIGGER stop_del_emps ....... DELETE ON employees -- Line A BEGIN IF TO_CHAR(SYSDATE','DY') = 'SUN' THEN RAISE_APPLICATION_ERROR(-20101,'Invalid delete'); END IF; END; Should this be a BEFORE or AFTER trigger, and why? Mark for Review (1) Points It should be a BEFORE trigger because if an AFTER trigger were created, the employee would already have been deleted by the time the trigger checks the date. (*) It should be a BEFORE trigger because you cannot use RAISE_APPLICATION_ERROR with AFTER triggers. It should be an AFTER trigger because the Oracle Server cannot fire the trigger until it knows that the employee has been deleted. It does not matter, either a BEFORE or an AFTER trigger could be created. Correct 13. User KULJIT creates two triggers named EMP1_TRIGG and EMP2_TRIGG, which are both DML triggers referencing her EMPLOYEES table. Kuljit now wants to remove both of these triggers from the database. What command(s) should Kuljit use to do this? Mark for Review (1) Points DROP ALL TRIGGERS ON employees; DROP TRIGGERS ON employees; DROP TRIGGER emp1_trigg; DROP TRIGGER emp2_trigg; (*) DROP TRIGGER emp1_trigg AND emp2_trigg; Correct 14. Which command would you use to see if your triggers are enabled or disabled? Mark for Review (1) Points SELECT trigger_name, status FROM USER_TRIGGERS; (*) SELECT object_name, status FROM USER_OBJECTS WHERE object_type = 'TRIGGER'; SELECT trigger_name, trigger_type FROM USER_TRIGGERS; DESCRIBE TRIGGER Correct 15. You have created several DML triggers which reference your DEPARTMENTS table. Now you want to disable all of them using a single SQL statement. Which command should you use? Mark for Review (1) Points ALTER TRIGGER DISABLE ALL ON departments; ALTER TABLE departments DISABLE ALL TRIGGERS; (*) ALTER TABLE departments DISABLE TRIGGERS; DROP ALL TRIGGERS ON departments; Correct 16. What is the benefit of using the CALL statement in a trigger body? Mark for Review (1) Points It allow both DDL events and database events to be handled by a single trigger. It prevents data being read from a mutating table. It allows the database administrator to monitor who is currently connected to the database. It allows the trigger body code to be placed in a separate procedure. (*) Correct 17. You have been granted CREATE TRIGGER privilege. You can now create an AFTER LOGOFF ON SCHEMA trigger. True or False? Mark for Review (1) Points True False (*) Correct 18. Which of the following could NOT cause a DDL or Database Event trigger to fire? Mark for Review (1) Points A table is dropped. A user connects to the database. The DBA starts up the database. A user deletes rows from the EMPLOYEES table. (*) A specific exception is raised in a user's session. Correct 19. What is wrong with the following code? CREATE OR REPLACE TRIGGER call_trigg AFTER UPDATE OR DELETE ON employees BEGIN CALL del_emp_proc END; Mark for Review (1) Points When CALL is used, the BEGIN and END; statements should be omitted. (*) The CALL statement should end with a semicolon (;) You cannot use a CALL statement in a DML trigger. When using CALL, only one DML statement can be tested, so UPDATE OR DELETE is wrong. Correct 20. Which of the following are NOT allowed within a database trigger? (Choose two) Mark for Review (1) Points (Choose all correct answers) COMMIT (*) A call to a packaged procedure INSERT A Boolean variable SAVEPOINT (*) Correct Previous Page 2 of 5 Next Summary Test: Semester 2 Mid Term Exam Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 13 (Answer all questions in this section) 21. Which of the following are good guidelines to follow when creating triggers? (Choose two) Mark for Review (1) Points (Choose all correct answers) Be aware of recursive and cascading effects (*) Where possible, use triggers to enforce NOT NULL constraints Avoid lengthy trigger logic by creating a procedure and invoking it from within the trigger (*) Use triggers to replace functionality which is already built into the database Always create more triggers than you need, because it is better to be safe Correct 22. A user's schema contains procedure MYPROC, function MYFUNC, trigger MYTRIGG and package MYPACK which contains a public procedure PACKPROC. These subprograms have no parameters, and the function returns a NUMBER. Which of the following calls to these objects (from an anonymous block) are incorrect? (Choose two) Mark for Review (1) Points (Choose all correct answers) mypack.packproc; mytrigg; (*) myproc; v_number := myfunc; IF NOT myfunc THEN ... (*) Correct 23. Which of the following best describes a database trigger? Mark for Review (1) Points It allows users to log on to the database It executes automatically whenever a particular event occurs within the database (*) It prevents unique constraints from being violated It executes automatically whenever a user clicks on a button with their mouse It allows foreign key constraints to be violated Correct 24. A business rule states that an employee's salary must be between 4000 and 30000. We could enforce this rule using a check constraint, but it is better to use a database trigger. True or False? Mark for Review (1) Points True False (*) Correct 25. Which of the following could NOT be done by a database trigger? Mark for Review (1) Points Enforcing a complex business rule Enforcing a complex database security check Recalculating the total salary bill for a department whenever an employee's salary is changed Ensuring that a student never arrives late for a class (*) Keeping a log of how many rows have been inserted into a table Correct 26. Examine the following code. To create a row trigger, what code should be included at Line A? CREATE OR REPLACE TRIGGER del_emp_trigg BEFORE DELETE ON employees ---Line A BEGIN ... Mark for Review (1) Points FOR EVERY ROW FOR EACH ROW (*) FOR EVERY ROW FOR ALL ROWS Nothing is needed because DML triggers are row triggers by default. Correct 27. Which of the following statements about INSTEAD OF triggers are NOT true? (Choose two.) Mark for Review (1) Points (Choose all correct answers) They can be created on a table. (*) They can be created on a simple view. They can be created on a complex view. They can be statement triggers. (*) They can be row triggers. Correct 28. What are the timing events for a compound trigger? Mark for Review (1) Points Before the triggering statement; After the triggering statement; Instead of the triggering statement. Before the triggering statement; Before each row; After each row; After the triggering statement. (*) Before the triggering statement; After the triggering statement; After each row. Before the triggering statement; Before each

Mid Term Exam Semester 2 Var 2 Uploaded from Google Docs (/documents/mid-term-exam-semester-2-var2.html)

Mid Term Exam Semester 2 Part 2 Oracle Mid Term Exam Semester 2 Part 2 (/documents/mid-term-exam-semester-2-part2.html)

Semester 2 Mid Term Exam Pl Sql Test: Semester 2 Mid Term Exam 1. When a user session changes the value of a package variable, the new va lue can immediately be (/documents/semester-2-mid-term-exam-plseen by other sessions. True or False? Mark… sql.html)

Semester 1 Mid Term Exam - Part 2

2.html)

Test: Semester 1 Mid Term Exam - Part II 1. A PL/SQL block contains the following code: v_counter := 1; LOOP EXIT WHEN v_counter (/documents/semester-1-mid-term-exam-part= 5; v_counter := v_counter + 1; END LOOP; …

PL SQL Mid Term Exam Semester 2

2.html)

1. When a user session changes the value of a package variable, the new val ue can immediately be seen by other sessions. True (/documents/pl-sql-mid-term-exam-semesteror False? Mark for Review (1) Points True False…

Mid Term Exam Semester 2 Part 1 Sozan Gamal mid (/documents/mid-term-exam-semester-2-part-1sozan-gamal.html)

Semester 1 Mid Term Exam - Part 1 Test: Semester 1 Mid Term Exam - Part I 1. Which of the following will help to make code easier to read? Mark for Review (1) Points (/documents/semester-1-mid-term-exam-partNaming variables. Using %Type. Including… 1.html)

Mid Term Exam Semester 1 Part II Mid Term Exam Semester 1 - Part II 1. For which type of SQL statement must you use an explicit cursor? Mark for Review (1) Points (/documents/mid-term-exam-semester-1-partDML statements that process more than one… ii.html)

Mid Term Exam Semester 1 Part 1

1.html)

The Mid Term Exam for Semester 1 is presented to you as two exams. This is Part I of the Mid Term Exam for Semester 1. Section (/documents/mid-term-exam-semester-1-part1 1. (1) Points Processing Procedural (*) Primary…

Mid Term Exam Semester 1 Part 1 The Mid Term Exam for Semester 1 is presented to you as two exams. This is Part I of the Mid Term Exam for Semester 1. Section (/documents/mid-term-exam-semester-1-part-11 1. (1) Points Processing Procedural (*) Primary… 5584618529f9e.html)

PL/SQL Semester 1 Mid Term Exam Part II

part-ii.html)

Test: Semester 1 Mid Term Exam Part II Review your answers, feedback, and question scores below. An asterisk (*) indicates a (/documents/plsql-semester-1-mid-term-examcorrect answer. Section 4 (Answer all questions…

PL/SQL Semester 1 Mid Term Exam Part II Oracle Test Test: Semester 1 Mid Term Exam Part II Review your answers, feedback, and question scores below. An asterisk (*) indicates a (/documents/plsql-semester-1-mid-term-exam-part-ii-oraclecorrect answer. Section 4 (Answer all questions… test.html)

Mid semester exam notes (/documents/mid-semester-exam-notes.html)

Mid term exam (/documents/mid-term-exam.html)

Mid term exam sol (/documents/mid-term-exam-sol.html)

Mid Term Exam (/documents/mid-term-exam5584abeaaaead.html)

Mid Term Exam FINC 330 Fall 2010 Mid-term Exam Please print out this exam for your convenience. You have until midnight (EDT) Sunday, July 11 to complete and submit the exam for (/documents/mid-term-exam-5584588c1f74a.html) grading.…

View more (https://docslide.us/search/? q=Semester+2+Mid+Term+Exam)

Subscribe to our Newsletter for latest news.

NEWLETTER

We built a platform for members to share documents and knowledge. And we are not related to any other website. (Our website list) (https://docslide.us/about.html)

About

(/about.html) Terms

(/info/dmca.html) Contact STARTUP - SHARE TO SUCCESS

(https://www.facebook.com/docslide.net)

(/info/terms.html) DMCA

(/contacts.html)

(https://twitter.com/docslide_net)

(https://www.google.com/+DocslideNet)

Smile Life

When life gives you a hundred reasons to cry, show life that you have a thousand reasons to smile

Get in touch

© Copyright 2015 - 2024 PDFFOX.COM - All rights reserved.