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 technology databases
  1. Return records which have no direct match

  2. Return records which have direct match

  3. Return all the records

  4. None of the above

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

An outer join retrieves all rows that satisfy the join condition plus those rows from one or both tables that do not have a matching row in the other table. Inner joins only return records with a direct match, while outer joins are specifically used to preserve unmatched records that would otherwise be excluded.

Multiple choice technology databases
  1. SelfJoin

  2. EquiJoin

  3. OuterJoin

  4. InnerJoin

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

A self-join is a regular join in which a table is joined with itself, which is useful for querying hierarchical data or comparing rows within the same table. Other joins like EquiJoin, OuterJoin, and InnerJoin describe the matching condition or inclusion of unmatched rows, but do not inherently mean joining a table to itself.

Multiple choice technology databases
  1. Structured Query Language

  2. Standard Query Language

  3. System Query Language

  4. Simple Query Language

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

SQL stands for Structured Query Language. It is the standard language for managing and manipulating relational databases.

Multiple choice technology databases
  1. Single-row Functions and Double-row Functions

  2. One-row Functions and Two-row Functions

  3. Single-row Functions and Multiple-row Functions

  4. None of the above

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

SQL functions are broadly categorized into single-row functions, which operate on single rows and return one result per row, and multiple-row (or group/aggregate) functions, which operate on sets of rows to return a single result. Double-row or two-row functions do not exist.

Multiple choice technology databases
  1. Return records which have no direct match

  2. Return records which have direct match

  3. Return all the records

  4. None of the above

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

Outer joins (LEFT, RIGHT, FULL) are specifically designed to return unmatched rows from one or both tables, along with matched rows. This is their defining purpose - unlike inner joins which only return matches. Option A correctly identifies this behavior.

Multiple choice technology databases
  1. (+)

  2. (-)

  3. (*)

  4. +

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

In Oracle SQL syntax, the (+) operator is placed next to the column that may be null to indicate an outer join. For example, 'WHERE table1.id = table2.id(+)' creates a right outer join. This is Oracle's legacy outer join syntax.