Database-Oracle [3i Infotech Placement]: Sample Questions 76 - 76 of 132

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

Question 76

Oracle

Question

MCQ▾

Why is it better to use an INTEGRITY CONSTRAINT to validate data in a table than to use a STORED PROCEDURE?

Choices

Choice (4)

a.

Because a stored procedure creates more network traffic than a integrity constraint definition

b.

Because an integrity constraint is automatically checked while data is inserted into or updated in a table while a stored procedure has to be specifically invoked

c.

Because the stored procedure occupies more space in the database than a integrity constraint definition

d.

All of the above

Answer

b.

Explanation

  • Automatically checked when a data is inserted or updated in a table while a stored procedure was specifically invoked.
  • To define certain data quality requirements in the database.

Basically 5 types of integrity constrain in oracle

  • Not null
    • A column in a table specified not null.
    • it՚s not possible to insert a null in a column.
    • The default is null.
  • Unique key
    • A primary key combines of a unique key and a not null constraint
  • Primary key
    • A primary key combines of a unique key and a not null constraint.
  • Foreign key
    • A foreign key constraint on a column ensures that the value in that column is found in the primary key of another table.
  • Check
    • A check constraint allows stating a minimum requirement for the value in a column.
5 Types of Integrity Constrain in Oracle

Developed by: