Computer Knowledge

Database and SQL

3,929 Questions

Master structured query language commands, database joins, table constraints, and alias generation. This section covers relational database management concepts and query outputs essential for technical aptitude. These technical questions feature prominently in banking IT officer exams and computer knowledge sections.

SQL queries and aliasesDatabase table constraintsDatabase joins and transformationsStored procedures and functions

Database and SQL Questions

Multiple choice
  1. SELECT ename WHERE ename AMONG ('value1', 'value2','value3', ...)

  2. SELECT ename WHERE ename = ('value1', 'value2','value3', ...)

  3. SELECT ename WHERE ename IN ('value1', 'value2','value3', ...)

  4. SELECT ename WHERE ename WITH ('value1', 'value2','value3', ...)

  5. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

IN will find any value existing in a set of candidates.

Multiple choice
  1. Domain integrity constraints

  2. Check constraints

  3. Unique constraints

  4. Referential integrity constraints

  5. Tuple constraints

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This constraint is used in Oracle to prevent the duplication of values within the rows of a specified column or a set of columns in a table.

Multiple choice
  1. Q only

  2. P only

  3. Both P and Q

  4. Both P and R

  5. R only

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is true choice. Q statement is correct because the primary key and the foreign key can exist in the same relation. Moreover foreign key can refer to the primary key in the same relation.So, this is a correct choice.

Multiple choice
  1. P only

  2. Both P and Q

  3. Both P and R

  4. Both Q and R

  5. All of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Option P is correct because a candidate key is a key that uniquely identifies a row in a relation. So, this cannot be null as it uniquely identifies a row. Option R is correct because primary key is chosen from a set of candidate keys. In other words all the candidate keys are the candidates for the primary key. So, in this way all the candidate keys are primary keys. So, this is the correct answer.