Computer Knowledge

Database and SQL

4,213 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. mysql_fetch_row

  2. mysql_fetch_object

  3. mysql_fetch_array

  4. both (1) and (3)

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

mysql_fetch_array returns a row as an array with both numeric indices (0, 1, 2...) and associative keys (column names). mysql_fetch_row returns only a numeric array, while mysql_fetch_object returns an object. The function name 'array' specifically indicates it can return both types.

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.