Database [3i Infotech Placement]: Sample Questions 250 - 251 of 294

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 250

Database

Question

MCQ▾

A Stored Procedure is a

Choices

Choice (4)

a.

Can be called from all client environments

b.

Sequence of SQL or PL/SQL statements to perform specific function

c.

Stored in compiled form in the database

d.

All a., b. and c. are correct

Answer

d.

Explanation

Define Store Procedure
  • A procedure is a named PL/SQL block, which performs one or more specific task.
  • A procedure has a header and body
  • Consists of the name and the parameters passed to the procedure.
  • The body declaration section, execution section and exception section form general PL/SQL block.
  • Used as building blocks for several different applications.

Advantages of stored procedure:

  • Maintainability:
    • Because scripts are in one location, easy to update and track dependencies based on schema.
  • Testing:
    • Can be tested independent of the application.
  • Isolation of business rules:
    • Having Stored Procedures in one location.
  • Speed:
    • Store procedures are cached on the server.
  • Security:
    • Limit direct access to tables via defined roles in the database.
    • Separating data and the code that accesses.

Question 251

Database
Edit

Write in Short

Short Answer▾

What is a VIEW? How to get script for a view?

Explanation

VIEW: View is a logical partition of one or more table in horizontally (by putting condition) or vertically (by including selected columns) .

  • View can be used to update table, provides security mechanism.
  • View definition (query) stored as plan text or Encrypted text
  • We can see view definition by using following stored procedure exec sp_helptext viewname

Developed by: