PL/SQL MOCK TEST PL/SQL MOCK TEST I



Similar documents
PL/SQL TUTORIAL. Simply Easy Learning by tutorialspoint.com. tutorialspoint.com

Oracle Internal & Oracle Academy

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

PL / SQL Basics. Chapter 3

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

Database Programming with PL/SQL: Learning Objectives

Writing Control Structures

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

Oracle Database: SQL and PL/SQL Fundamentals

3.GETTING STARTED WITH ORACLE8i

GENERAL PROGRAMMING LANGUAGE FUNDAMENTALS

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals

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

Oracle Database 10g: Program with PL/SQL

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

4 Logical Design : RDM Schema Definition with SQL / DDL

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

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

A Brief Introduction to MySQL

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

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

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

Oracle PL/SQL Programming

Oracle Database 12c: Introduction to SQL Ed 1.1

SQL Server Database Coding Standards and Guidelines

Oracle 11g PL/SQL training

Recognizing PL/SQL Lexical Units. Copyright 2007, Oracle. All rights reserved.

Using SQL Server Management Studio

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Oracle For Beginners Page : 1

Oracle Database 10g: Introduction to SQL

An Oracle White Paper June Migrating Applications and Databases with Oracle Database 12c

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

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

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

SQL Server An Overview

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

Oracle SQL. Course Summary. Duration. Objectives

What is the value of SQL%ISOPEN immediately after the SELECT statement is executed? Error. That attribute does not apply for implicit cursors.

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle(PL/SQL) Training

CS346: Database Programming.

Oracle Database: Develop PL/SQL Program Units

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

Migrating Non-Oracle Databases and their Applications to Oracle Database 12c O R A C L E W H I T E P A P E R D E C E M B E R

How To Create A Table In Sql (Ahem)

Programming with SQL

<Insert Picture Here> Oracle SQL Developer 3.0: Overview and New Features

ERserver. DB2 Universal Database for iseries SQL Programming with Host Languages. iseries. Version 5

ICT. PHP coding. Universityy. in any

Oracle10g PL/SQL Programming V1.0

Financial Data Access with SQL, Excel & VBA

SQL Server for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

Handling Unstructured Data Type in DB2 and Oracle

ECE 122. Engineering Problem Solving with Java

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

Programming Database lectures for mathema

Using Variables in PL/SQL. Copyright 2007, Oracle. All rights reserved.

Week 1 Part 1: An Introduction to Database Systems. Databases and DBMSs. Why Use a DBMS? Why Study Databases??

An Introduction to PL/SQL. Mehdi Azarmi

PL/SQL Developer 7.1 User s Guide. March 2007

2874CD1EssentialSQL.qxd 6/25/01 3:06 PM Page 1 Essential SQL Copyright 2001 SYBEX, Inc., Alameda, CA

Migration to SQL Server With Ispirer SQLWays 6.0

Oracle Database 10g Express

Training Guide. PL/SQL for Beginners. Workbook

The Relational Model. Why Study the Relational Model?

Instant SQL Programming

Chapter 39. PL/pgSQL - SQL Procedural Language

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

Answers to the Try It Yourself Sections

Teradata Utilities Class Outline

Oracle 10g PL/SQL Training

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

SQL Server to Oracle A Database Migration Roadmap

Database Extensions Visual Walkthrough. PowerSchool Student Information System

Using Temporary Tables to Improve Performance for SQL Data Services

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Consulting. Personal Attention, Expert Assistance

How To Name A Program In Apl/Sql

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

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

Porting from Oracle to PostgreSQL

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

Introduction to the Oracle DBMS

Continuous Integration Part 2

Handling PL/SQL Errors

Introduction to SQL for Data Scientists

PL/SQL Programming. Oracle Database 12c. Oracle Press ORACLG. Michael McLaughlin. Mc Graw Hill Education

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

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

Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS

ISYS PL/SQL Basics. Week 03

1 File Processing Systems

CSC 443 Database Management Systems. The SQL Programming Language

Oracle Database 11g: Program with PL/SQL

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 I Q 1 - Which of the following is not true about the PL/SQL language? A - It supports embedded SQL statements. B - It has all the features of a modern structured programming language. C - It is not a block-structured language. D - Applications developed using PL/SQL are not portable. Q 2 - Which of the following is not true about the PL/SQL language? A - PL/SQL's general syntax is based on that of ADA and Pascal programming language. B - Apart from Oracle, PL/SQL is available in TimesTen in-memory database and IBM DB2. C - PL/SQL is tightly integrated with SQL. D - It does not offer error checking. Q 3 - Which of the following is true about the PL/SQL language? A - PL/SQL provides access to predefined SQL packages. B - PL/SQL provides support for Object-Oriented Programming. C - PL/SQL provides support for Developing Web Applications and Server Pages. D - All of the above. Q 4 - Which of the following is not true about the declaration section of a PL/SQL block? A - This section starts with the keyword.

B - It is a mandatory section. C - It defines all variables, cursors, subprograms, and other elements to be used in the program. Q 5 - Which of the following is true about the execution section of a PL/SQL block? A - It is enclosed between the keywords and END. B - It is a mandatory section. C - It consists of the executable PL/SQL statements. D - All of the above. Q 6 - Which of the following is not true about the execution section of a PL/SQL block? A - It should have more than one executable line of code. B - It may have just a NULL command to indicate that nothing should be executed. C - The statements must always end with a semicolon. D - The section may contain SQL commands, logical control commands, assignment commands, as well as other commands. Q 7 - Which of the following is not true about the exception handling section of a PL/SQL block? A - This section starts with the EXCEPTION keyword. B - It is a mandatory section. C - It contains exceptions that handle errors in the program. Q 8 - Which of the following is true about comments in PL/SQL? A - Comments are explanatory statements. B - PL/SQL supports both single-line and multi-line comments. C - The PL/SQL single-line comments start with the delimiter -- doublehyphen and multi-line comments are enclosed by /* and */. D - All of the above. Q 9 - Which of the following is not a PL/SQL unit? A - Table B - Type C - Trigger D - Package

Q 10 - Which of the following is true about data types in PL/SQL? A - Large Object or LOB data types are pointers to large objects that are stored separately from other data items, such as text, graphic images, video clips, and sound waveforms. B - The composite data types have data items that have internal components that can be accessed individually. For example, collections and records. C - References are pointers to other data items. D - All of the above. Q 11 - Which of the following is true about scalar data types in PL/SQL? A - They hold single values with no internal components. B - Examples of scalar data types are NUMBER, DATE, or BOOLEAN. C - PL/SQL provides subtypes of data types. D - All are true. Q 12 - Which of the following is true about character data types and subtypes in PL/SQL? A - LONG is a variable-length character string with maximum size of 32,760 bytes. B - ROWID is a physical column identifier, the address of a column in an ordinary table. C - CHAR is a variable-length character string with maximum size of 32,767 bytes. D - NCHAR is a variable-length national character string with maximum size of 32,767 bytes. Q 13 - Which of the following is not true about large object data types and in PL/SQL? A - BFILE is used to store large binary objects in operating system files outside the database. B - BLOB is used to store character data in the database. C - CLOB is used to store large blocks of character data in the database. D - NCLOB is used to store large blocks of NCHAR data in the database. Q 14 - What value will be assigned to the variable declared as below counter binary_integer; A - 0 B - 1 C - NULL Q 15 - Consider the following code

-- Global variables num number := 95; dbms_output.put_line('num: ' num1); -- Local variables num number := 195; dbms_output.put_line('num: ' num1); What will happen when the code is executed? A - It won t execute, it has syntax error B - It will print num: 95 num: 195 C - It will print num: 95 num: 95 D - It will print num: 195 num: 195 Q 16 - What is wrong in the following code? c_id := 1; c_name customers.name%type; c_addr customers.address%type; SELECT name, address INTO c_name, c_addr FROM customers WHERE id = c_id; A - You cannot use the SELECT INTO statement of SQL to assign values to PL/SQL variables. B - The SELECT INTO statement here is wrong. It should be: SELECT c_name, c_address INTO name, addr C - The WHERE statement is wrong. It should be: WHERE id := c_id; D - The variable c_id should be declared as a type-compatible variable as c_id customers.id%type := 1; Q 17 - Which of the following is not true about PL/SQL constants and literals? A - A constant holds a value that once declared, does not change in the program. B - The CONSTANT declaration cannot impose the NOT NULL constraint.

C - A constant is declared using the CONSTANT keyword. D - A CONSTANT declaration requires an initial value. Q 18 - What will be the output of the following code snippet? a number (2) := 21; b number (2) := 10; IF ( a <= b ) THEN dbms_output.put_line(a); IF ( b >= a ) THEN dbms_output.put_line(a); IF ( a <> b ) THEN dbms_output.put_line(b); A - 2 B - 21 C - 10 D - 21, 10 Q 19 - What would be printed when the following code is executed? x NUMBER; x := 5; x := 10; dbms_output.put_line(-x); dbms_output.put_line(+x); x := ; dbms_output.put_line(-x); dbms_output.put_line(+x); A - 10 10 B - 10 10

C - +10 +10 D - 10 10 Q 20 - To get the server output result and display it into the screen, you need to write A - set serveroutput on B - set server output on C - set dbmsoutput on D - set dbms output on Q 21 - Which of the following is not true about PL/SQL decision making structures? A - The IF statement associates a condition with a sequence of statements enclosed by the keywords THEN and END IF. B - The IF statement also adds the keyword ELSE followed by an alternative sequence of statement. C - The IF-THEN-ELSIF statement allows you to choose between several alternatives. D - PL/SQL does not have a CASE statement. Q 22 - Which of the following is true about the following code snippet? a number(3) := 100; IF (a = 50 ) THEN dbms_output.put_line('value of a is 10' ); ELSEIF ( a = 75 ) THEN dbms_output.put_line('value of a is 20' ); ELSE dbms_output.put_line('none of the values is matching'); dbms_output.put_line('exact value of a is: ' a ); A - It has syntax error. B - It will print 'None of the values is matching'. C - It will print None of the values is matching

Exact value of a is: 100 Q 23 - Which of the following is true about the following code snippet? a number(3) := 100; IF (a = 50 ) THEN dbms_output.put_line('value of a is 10' ); ELSIF ( a = 75 ) dbms_output.put_line('value of a is 20' ); ELSE dbms_output.put_line('none of the values is matching'); dbms_output.put_line('exact value of a is: ' a ); A - It has syntax error. B - It will print 'None of the values is matching'. C - It will print None of the values is matching Exact value of a is: 100 Q 24 - Which of the following is true about the following PL/SQL CASE statement syntax? CASE selector WHEN 'value1' THEN S1; WHEN 'value2' THEN S2; WHEN 'value3' THEN S3;... ELSE Sn; -- default case END CASE; A - It is wrongly written. B - It is perfectly written. C - It is you can specify the literal NULL for all the S expressions and the default S n. D - All the expressions like the selector, the value and the returns values, need not be of the same data type. Q 25 - What is the output of the following code? grade char(1) := 'B'; case when grade = 'A' then dbms_output.put_line('excellent'); when grade = 'B' then dbms_output.put_line('very good'); when grade = 'C' then dbms_output.put_line('well done'); when grade = 'D' then dbms_output.put_line('you passed');

when grade = 'F' then dbms_output.put_line('better try again'); else dbms_output.put_line('no such grade'); end case; A - It has syntax error, so there will not be any output. B - B C - Very good D - No such grade ANSWER SHEET Question Number Answer Key 1 C 2 D 3 D 4 B 5 D 6 A 7 B 8 D 9 A 10 D 11 D 12 A 13 B 14 C 15 B 16 D 17 B 18 C 19 A 20 A 21 D 22 A 23 A 24 B 25 C

Loading [MathJax]/jax/output/HTML-CSS/jax.js