Skip to main content

TCS Xplore 2023 - PL/SQL MCQ question for best practice ( iON Proctored Assessment )

             Multiple Choice Questions on PL/SQL


PLSQL - Procedural Language/SQL

Advantage :  It offers extensive error checking ,

             numerous data types and 

             a variety of programming structures.


Q1.  What is wrong in the following code snippet?


DECLARE

   x number := 1;

BEGIN

   LOOP

      dbms_output.put_line(x);

      x := x + 1;

      IF x > 10 THEN

         exit;

      END IF;

     dbms_output.put_line('After Exit x is: ' || x);

END;


A - There is nothing wrong.


B - The IF statement is not required.


C - There should be an END LOOP statement.


D - The exit statement should be in capital letters.


Ans : c


Q2.  Consider the following code snippet: how many times the loop will run?


DECLARE

   a number(2);

BEGIN

   FOR a in 10 .. 20 LOOP

       END LOOP;

END;

A - 11


B - 10


C - 9


D - Infinite loop


Ans : A


Q3.  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.


Ans : A


Q4.   Which of the following code is the correct syntax for creating a nested table named salary that will store integer values?


A - TYPE salary IS TABLE OF INTEGER;


B - TYPE salary IS NESTED TABLE OF INTEGER;


C - TABLE salary IS NESTED BY INTEGER;


D - TABLE salary IS INDEXED BY INTEGER;


Ans :A


Q5.  PL/SQL programs are written as lines of text using a specific set of characters.


a. Upper- and lower-case letters A .. Z and a .. z

b. Numerals 0 .. 9

c. Symbols ( ) + - * / < > = ! ~ ^ ; : . ' @ % , " # $ & _ | { } ? [ ]

d. Tabs, spaces, and carriage returns

e. All mentioned above


Ans : e


Q6.  Which statements execute a sequence of statements multiple times?


a. EXIT

b. LOOP

c. Both A & B

d. None of the above


Ans : b


Q7.  A Variable in PL/SQL should not exceed –


       a. 10                 b. 20

       c. 30                 d. 40

Ans : c


Q8.  What is the syntax of PL/SQL Loop?


a. LOOP

   END LOOP;

   Sequence of statements;


b. END LOOP;

   LOOP

   Sequence of statements;


c. LOOP

   Sequence of statements;

   END LOOP;


d. END LOOP;

   Sequence of statements;

   LOOP


Ans : c


Q9.  How many types of PL/SQL Loops are there?


      a. 3                 b. 5

      c. 4                 d. 6


Ans: c


Q10.  In order to remove the PL/SQL function, which function is used?


       a.  REMOVE FUNCTION     b.  DELETE FUNCTION

       c.  ERASE FUNCTION      d.  DROP FUNCTION

Ans: d


Q11.  ____________is not a PL/SQL unit.

          

         A. Type

         B.Table

         C.Trigger

         D.none

Ans : Table






















Comments

Popular posts from this blog

Complete Strategy to clear TCS Xplore IPA in One Attempt Now ( 80+ Score )

  So hello Everyone , Here are the all Links from where you can Practice !  All the resources are searched from my best !  1. For KYT and Bizzskill  Link :- tcs Xplore course  2. Unix Operating system Link :-    a.  click here Link 1 b.  click here Link 2 c.  Click here Link 3   3. UI  Link :-  click here 4. SQL and Pl SQL Link : -  Click here Click here click here 5. Java MCQ  Link :-  click here click here click here 6. Java coding :-  Access the playlist on YouTube :-  click here to watch Access the blogs :-  click here All in one link :-   click here

TCS IPA previous year quistion ( 35 marks ) , Quistion , Input , output

 Problem Statement Video Link :    https://youtu.be/XCBvfJAo908 Create a class TravelAgencies with below attributes: regNo – int agencyName – String pakageType – String price – int flightFacility – boolean Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence. Create class Solution with main method. Implement two static methods – findAgencyWithHighestPackagePrice and agencyDetailsforGivenIdAndType in Solution class. findAgencyWithHighestPackagePrice method: This method will take array of TravelAgencies objects as an input parameter and return the highest package price from the given array of objects. agencyDetailsForGivenldAndType method: This method will take three input parameters -array of TravelAgencies objects, int parameter regNo and String parameter packageType. The method will return the TravelAgencies object based on below conditions. FlightFacility should be available. The input parameters(regNo and packageType) shoul

TCS IPA previous year problems solved [input + output ] in JAVA - (35 marks )

  Problem Statement :  Video Link :   Click Here Create a class AutonomousCar with the below attributes: carld – int brand – String   noOfTestsConducted – int noOfTestsPassed- int environment – String grade – String Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence except grade. Create class Solution with main method. Implement two static methods – findTestPassedByEnv and updateCarGrade in Solution class. findTestPassedByEnv method: This method will take two input parameters -array of AutonomousCar objects and string parameter environment. The method will return the sum of the noOfTestsPassed attribute from autonomousCar objects for the environment passed as parameter. If no autonomousCar with the given environment is present in the array of AutonomousCar objects, then the method should return 0. updateCarGrade method: This method will take a String parameter brand, along with the array of AutonomousCar objects. The method