Database [3i Infotech Placement]: Sample Questions 131 - 132 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 131

Database

Question

MCQ▾

Which of the following is TRUE for the ENFORCE KEY field

  1. ENFORCE KEY field characteristic indicates the source of the value that SQL ⚹ FORMS uses to populate the field
  2. A field with the ENFORCE KEY characteristic should have the INPUT ALLOWED characteristics turned off

Choices

Choice (4)

a.

Only 2 is TRUE

b.

Only 1 is TRUE

c.

1 and 2 are FALSE

d.

1 and 2 are TRUE

Answer

b.

Explanation

Define Enforcing Key Constrain

ENFORCE KEY field:

  • Is a way to enforce integrity within our oracle database.
  • It a constraint used to enforce a relationship between two tables- the values in the one table must appear in another table.
  • Can be defined in either a CREATE TABLE statement or an ALTER TABLE statement.
  • Indicates the source of the value that SQL ⚹ FORMS uses to populate the field.
  • Field in one table refers to the PRIMARY KEY in another table.
  • Relationships involve a parent table that holds the central data values and a child table with identical values pointing back to its parent.
  • The parent and child tables must use the same storage engine.
  • They must not be temporary tables.

Question 132

Database
Edit

Describe in Detail

Essay▾

What will be the output of the following query?

SELECT REPLACE (TRANSLATE (LTRIM (RTRIM ( ‘ATHEN!’ ‘’ ) , ‘’ ) , ‘AN’ ‘⚹⚹’ ) , ‘⚹’ ‘TROUBLE’ ) FROM DUAL.

Explanation

  • 1st step: rtrim ( ‘! ! athen! !’ , ‘!’ )
    • Output becomes “! ! athen”
  • 2nd step: ltrim ( ″ athen ′ , ′ an ′ , ′ ⚹⚹ ′ )
    • Output becomes ″ ⚹ the ⚹ ″
  • 3rd step: trancelate ( ‘athen’ , ‘an’ , ‘⚹⚹’ )
    • Output becomes “⚹ the ⚹”
  • 4th step: replace ( ‘⚹ the ⚹’ , ‘⚹’ , ‘trouble’ )
  • Finally the output is “TROUBLETHETROUBLE” .

Developed by: