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 architecture
  1. The variable is only accessible to the first Execute SQL Task

  2. The variable is accessible to both Execute SQL Task, but not the Script Task

  3. The variable is accessible to both Execute SQL Task and the Script Task

  4. The variable is not accessible to any Task

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

In SSIS, when you create a variable within a container (like Foreach Loop), its scope is that container and all tasks inside it. Both Execute SQL tasks are inside the Foreach Loop, so they can access the variable. The Script Task is in the For Loop (sibling container, not nested inside Foreach), so it cannot access this variable.

Multiple choice technology databases
  1. Projection

  2. Selection

  3. Join

  4. All of the above

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

SQL SELECT statements have three main capabilities: Projection (SELECTing specific columns), Selection (filtering rows with WHERE), and Join (combining data from multiple tables). Option D correctly identifies that SELECT statements can do all three.

Multiple choice technology databases
  1. Select all columns from EMP;

  2. Select distinct columns from EMP;

  3. Select * from EMP;

  4. All of the above

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

The asterisk (*) wildcard in SQL selects all columns from a table. 'SELECT * FROM EMP' is the correct syntax. Options A and B are not valid SQL syntax - 'Select all columns' is not valid SQL, and 'distinct columns' is incorrect syntax.

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.