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 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 categorized into Single-row functions (operate on each row independently) and Multiple-row functions (operate on groups of rows). Single-row includes character, number, date, conversion functions. Multiple-row includes aggregate functions like SUM, COUNT, AVG, etc.

Multiple choice technology databases
  1. True

  2. False

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

Single-row functions operate on single rows and return only one result per row. In contrast, multiple-row (or group) functions manipulate groups of rows to return one result per group. Therefore, the statement that single-row functions can return multiple results per row is false.

Multiple choice technology databases
  1. Character Function

  2. Number Function

  3. String Function

  4. Date Function

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

Standard SQL function categories are Character (UPPER, LOWER, SUBSTR), Number (ROUND, TRUNC, MOD), Date (SYSDATE, ADD_MONTHS, LAST_DAY), and Conversion (TO_CHAR, TO_DATE). There is no separate 'String Function' category - character functions handle string manipulation.

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.