Procedures & Constraints Quiz

Last Updated :
Discuss
Comments

Question 1

What is a procedure in PL/SQL?

  • A function that returns a value

  • A precompiled SQL statement

  • A named block that performs a task and does not necessarily return a value

  • An anonymous block

Question 2

Which keyword is used to define a procedure in PL/SQL ?

  • CREATE FUNCTION

  • DECLARE PROCEDURE

  • CREATE PROCEDURE

  • BEGIN PROCEDURE


Question 3

How do you call a procedure in PL/SQL?

  • CALL procedure_name

  •  EXECUTE procedure_name

  • procedure_name()

  • All of the above

Question 4

Which of the following is true about IN, OUT, and IN OUT parameters in PL/SQL procedures?

  • IN parameters are used to return values

  • OUT parameters are used to pass values into the procedure

  • IN OUT parameters can both accept and return values

  • OUT parameters are optional

Question 5

Which constraint ensures that a column cannot have NULL values?

  • PRIMARY KEY

  • NOT NULL

  • UNIQUE

  • CHECK

Question 6

Which constraint enforces the uniqueness of all values in a column?

  • FOREIGN KEY

  • CHECK

  • UNIQUE

  • DEFAULT


Question 7

Which constraint is used to enforce referential integrity between two tables?

  • CHECK

  • FOREIGN KEY

  • UNIQUE

  • DEFAULT


Question 8

What is the main difference between PRIMARY KEY and UNIQUE constraints?

  • UNIQUE allows NULLs; PRIMARY KEY does not

  • PRIMARY KEY is case-insensitive

  • PRIMARY KEY can be repeated

  • UNIQUE can be used for foreign keys

Question 9

Which constraint is used to limit the range or format of values in a column?

  • NOT NULL

  • CHECK

  • DEFAULT

  • INDEX

Question 10

Which SQL constraint provides a default value if none is specified?

  • DEFAULT

  • CHECK

  • UNIQUE

  • FOREIGN KEY

There are 10 questions to complete.

Take a part in the ongoing discussion