PL/SQL MOCK TEST PL/SQL MOCK TEST III

Similar documents
Triggers & Packages. {INSERT [OR] UPDATE [OR] DELETE}: This specifies the DML operation.

When an exception occur a message which explains its cause is received. PL/SQL Exception message consists of three parts.

PL/SQL (Cont d) Let s start with the mail_order database, shown here:

PL/SQL MOCK TEST PL/SQL MOCK TEST I

Oracle Database: SQL and PL/SQL Fundamentals

Oracle 10g PL/SQL Training

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database 10g: Program with PL/SQL

Oracle Database: SQL and PL/SQL Fundamentals

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT

Database Programming with PL/SQL: Learning Objectives

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Handling Exceptions. Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1

Darshan Institute of Engineering & Technology PL_SQL

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Oracle Database 11g Express Edition PL/SQL and Database Administration Concepts -II

Handling Exceptions. Schedule: Timing Topic 45 minutes Lecture 20 minutes Practice 65 minutes Total

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

Oracle Database: SQL and PL/SQL Fundamentals NEW

SQL/PSM. Outline. Database Application Development Oracle PL/SQL. Why Stored Procedures? Stored Procedures PL/SQL. Embedded SQL Dynamic SQL

Oracle Database: Develop PL/SQL Program Units

STUDY OF PL/SQL BLOCK AIM: To Study about PL/SQL block.

5. CHANGING STRUCTURE AND DATA

Oracle Database: Program with PL/SQL

A basic create statement for a simple student table would look like the following.

Oracle For Beginners Page : 1

Oracle Database: Program with PL/SQL

Handling Exceptions. Schedule: Timing Topic. 45 minutes Lecture 20 minutes Practice 65 minutes Total

Oracle Database: Program with PL/SQL

Oracle Database: Program with PL/SQL

Introduction to Triggers using SQL

Oracle Database: Program with PL/SQL

Oracle Database 11g: Program with PL/SQL

1 Stored Procedures in PL/SQL 2 PL/SQL. 2.1 Variables. 2.2 PL/SQL Program Blocks

Duration Vendor Audience 5 Days Oracle Developers, Technical Consultants, Database Administrators and System Analysts

Oracle(PL/SQL) Training

PL/SQL Overview. Basic Structure and Syntax of PL/SQL

Oracle PL/SQL Language. CIS 331: Introduction to Database Systems

Oracle 11g PL/SQL training

Handling PL/SQL Errors

14 Triggers / Embedded SQL

Oracle Database 12c: Introduction to SQL Ed 1.1

PL/SQL - QUICK GUIDE PL/SQL - ENVIRONMENT SETUP

Persistent Stored Modules (Stored Procedures) : PSM

PL/SQL. Database Procedural Programming PL/SQL and Embedded SQL. Procedures and Functions

ATTACHMENT 6 SQL Server 2012 Programming Standards

Why programming extensions? to program complex update transactions. where referential integrity is not addressed by data definition

Oracle SQL. Course Summary. Duration. Objectives

COMS20700 DATABASES 13 PL/SQL. COMS20700 Databases Dr. Essam Ghadafi

CSC 443 Database Management Systems. The SQL Programming Language

Introduction to PL/SQL Programming

Oracle Database 10g: Introduction to SQL

Course -Oracle 10g SQL (Exam Code IZ0-047) Session number Module Topics 1 Retrieving Data Using the SQL SELECT Statement

Fine Grained Auditing In Oracle 10G

Databases What the Specification Says

Handling Exceptions. Copyright 2008, Oracle. All rights reserved.

1 File Processing Systems


Instant SQL Programming

An Introduction to PL/SQL. Mehdi Azarmi

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Writing Control Structures

ORACLE DATABASE 11G: COMPLETE

Training Guide. PL/SQL for Beginners. Workbook

Maintaining Stored Procedures in Database Application

D61830GC30. MySQL for Developers. Summary. Introduction. Prerequisites. At Course completion After completing this course, students will be able to:

SQL Programming. CS145 Lecture Notes #10. Motivation. Oracle PL/SQL. Basics. Example schema:

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Oracle Database: Introduction to SQL

Oracle PL/SQL Injection

Foreign and Primary Keys in RDM Embedded SQL: Efficiently Implemented Using the Network Model

Oracle For Beginners Page : 1

Oracle Database: Introduction to SQL

2. Which of the following declarations is invalid? Mark for Review (1) Points

Best Practices for Dynamic SQL

Bullet Proof Your PL/SQL

Guide to Upsizing from Access to SQL Server

David Dye. Extract, Transform, Load

5.1 Database Schema Schema Generation in SQL

Creating PL/SQL Blocks. Copyright 2007, Oracle. All rights reserved.

Introduction to Databases

Oracle Database: Introduction to SQL

SQL NULL s, Constraints, Triggers

Database programming 20/08/2015. DBprog news. Outline. Motivation for DB programming. Using SQL queries in a program. Using SQL queries in a program

SQL Simple Queries. Chapter 3.1 V3.0. Napier University Dr Gordon Russell

Oracle Database 10g Express

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. The Relational Model. The relational model

In This Lecture. SQL Data Definition SQL SQL. Notes. Non-Procedural Programming. Database Systems Lecture 5 Natasha Alechina

Structured Query Language. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics

Introduction to Database. Systems HANS- PETTER HALVORSEN,

Developing SQL and PL/SQL with JDeveloper

Oracle9i: Develop PL/SQL Program Units

ETL Process in Data Warehouse. G.Lakshmi Priya & Razia Sultana.A Assistant Professor/IT

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

Programming Database lectures for mathema

HADOOP MOCK TEST HADOOP MOCK TEST I

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components

How To Create A Table In Sql (Ahem)

T-SQL STANDARD ELEMENTS

Transcription:

http://www.tutorialspoint.com PL/SQL MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to PL/SQL. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself. PL/SQL MOCK TEST III Q 1 - Which of the following is the correct syntax for creating an explicit cursor? A - CURSOR cursor_name IS select_statement; B - CREATE CURSOR cursor_name IS select_statement; C - CREATE CURSOR cursor_name AS select_statement; D - CURSOR cursor_name AS select_statement; Q 2 - Which of the following code will open a cursor named cur_employee? A - OPEN cur_employee; B - OPEN CURSOR cur_employee; C - FETCH cur_employee; D - FETCH CURSOR cur_employee; Q 3 - The following code tries to fetch some information from all the rows in a table named customers for use in a PL/SQL block. What is wrong in the following code? c_id customers.id%type; c_name customers.name%type; c_addr customers.address%type; CURSOR c_customers is SELECT id, name, address FROM customers; LOOP FETCH c_customers into c_id, c_name, c_addr; EXIT WHEN c_customers%notfound; dbms_output.put_line(c_id ' ' c_name ' ' c_addr); END LOOP; CLOSE c_customers;

A - It need not use a cursor. B - The cursor is not opened. C - It will not print information from all the rows. D - There is nothing wrong in the code. Q 4 - Which of the following is not true about PL/SQL records? A - A PL/SQL record is a data structure that can hold data items of different kinds. B - Records consist of different fields, similar to a row of a database table. C - You can create table-based and cursor-based records by using the %ROWTYPE attribute. Q 5 - Which of the following is not among the types of PL/SQL records? A - Table-based B - View-based C - Cursor-based records D - User-defined records Q 6 - Which of the following code correctly create a record named book with two field title and author? A - TYPE book IS RECORD (title varchar(50), author varchar(50), ); B - RECORD book (title varchar(50), author varchar(50), ); C - CREATE RECORD book (title varchar(50), author varchar(50), ); D - CREATE TYPE book (title varchar(50), author varchar(50), ); Q 7 - Which of the following code will successfully declare an exception named emp_exception1 in a PL/SQL block?

A - emp_exception1; B - emp_exception1 ; C - CREATE emp_exception1; D - CREATE emp_exception1 AS ; Q 8 - Consider the exception declared as emp_exception1 ; Which of the following statement will correctly call the exception in a PL/SQL block? A - IF c_id <= 0 THEN ex_invalid_id; B - IF c_id <= 0 THEN CALL ex_invalid_id; C - IF c_id <= 0 THEN RAISE ex_invalid_id; D - IF c_id <= 0 THEN ex_invalid_id; Q 9 - The pre-defined exception CASE_NOT_FOUND is raised when A - None of the choices in the WHEN clauses of a CASE statement is selected, and there is no ELSE clause. B - PL/SQL has an internal problem. C - A cursor fetches value in a variable having incompatible data type. Q 10 - The pre-defined exception NO_DATA_FOUND is raised when A - A null object is automatically assigned a value. B - A SELECT INTO statement returns no rows. C - PL/SQL has an internal problem. D - PL/SQL ran out of memory or memory was corrupted. Q 11 - The pre-defined exception TOO_MANY_ROWS is raised when A - PL/SQL ran out of memory or memory was corrupted. B - A cursor fetches value in a variable having incompatible data type. C - SELECT INTO statement returns more than one row. Q 12 - Which of the following is not true about PL/SQL triggers? A - Triggers are stored programs.

B - They are automatically executed or fired when some events occur. C - Triggers could be defined on the table, view, schema, or database with which the event is associated. Q 13 - Triggers are written to be executed in response to any of the following events A - A database manipulation DML statement DELETE, INSERT, orupdate. B - A database definition DDL statement CREATE, ALTER, ordrop. C - A database operation SERVERERROR, LOGON, LOGOFF, STARTUP, orshutdown. D - All of the above. Q 14 - Which of the following is not a benefit of a database trigger? A - Enforcing referential integrity B - Event logging and storing information on table access C - Allowing invalid transactions D - Generating some derived column values automatically Q 15 - Observe the syntax given below {INSERT [OR] UPDATE [OR] DELETE} The INSTEAD OF clause is used for creating trigger on a A - View B - Cursor C - Table D - Index Q 16 - Observe the syntax given below

{INSERT [OR] UPDATE [OR] DELETE} The {INSERT [OR] UPDATE [OR] DELETE} clause specifies a A - DDL operation. B - DML operation. C - None of the above. D - Both of the above. Q 17 - Observe the syntax given below {INSERT [OR] UPDATE [OR] DELETE} The optional clause specifies A - A table with index. B - A table with primary key. C - A row level trigger. D - A table with a unique key. Q 18 - Observe the syntax given below {INSERT [OR] UPDATE [OR] DELETE}

Which of the following holds true for the WHEN clause? A - This provides a condition for rows for which the trigger would fire and this clause is valid only for row level triggers. B - This provides a condition for rows for which the trigger would fire and this clause is valid only for table level triggers. C - This provides a condition for rows for which the trigger would fire and this clause is valid only for view based triggers. D - All of the above. Q 19 - Observe the syntax given below {INSERT [OR] UPDATE [OR] DELETE} Which of the following holds true for the clause? A - This allows you to refer new and old values for various DML statements, like INSERT, UPDATE, and DELETE. B - OLD and NEW references are not available for table level triggers. C - You can use them for record level triggers. D - All of the above. Q 20 - Which of the following is true for querying a table in the same trigger? A - The AFTER keyword should be used, because triggers can query the table or change it again only after the initial changes are applied and the table is back in a consistent state. B - The BEFORE keyword should be used, because triggers can query the table or change it again only after the initial changes are applied and the table is back in a consistent state. C - None of the points in a. and b. D - Both of the points in a. and b. Q 21 - All objects placed in a package specification are called

A - Public objects. B - Private objects. C - None of the above. D - Both of the above. Q 22 - Any subprogram not in the package specification but coded in the package body is called a A - Public object. B - Private object. C - None of the above. D - Both of the above. Q 23 - Which of the following is not true about PL/SQL packages? A - PL/SQL packages are schema objects that groups logically related PL/SQL types, variables and subprograms. B - A package has two parts: Package specification and Package body or definition. C - Both the parts are mandatory. Q 24 - Which of the following is not true about PL/SQL package specifications? A - The specification is the interface to the package. B - It declares the types, variables, constants, exceptions, cursors, and subprograms that can be referenced from outside the package. C - It contains all information about the content of the package and the code for the subprograms. Q 25 - Which of the following is true about PL/SQL package body? A - The package body has the codes for various methods declared in the package specification and other private declarations. B - It is created using the CREATE PACKAGE Statement. C - The codes, methods and types declared in package body are not hidden from code outside the package. D - All of the above. ANSWER SHEET Question Number Answer Key

1 A 2 A 3 B 4 D 5 B 6 A 7 B 8 C 9 A 10 B 11 C 12 D 13 D 14 C 15 A 16 B 17 C 18 A 19 D 20 A 21 A 22 B 23 D 24 C 25 A Loading [MathJax]/jax/output/HTML-CSS/jax.js