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. True

  2. False

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

Teradata does not maintain rows in the received order. Teradata distributes rows across AMPs (Access Module Processors) based on hash values of primary index columns, so the physical storage order is not the same as insertion order.

Multiple choice technology databases
  1. Tables with already existing data

  2. Empty tables

  3. Both 1 & 2

  4. None of the above

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

Teradata FastLoad (FLOAD) is designed for high-performance loading of large volumes of data into empty tables only. It cannot load data into tables that already contain rows or have active indexes. Distractors suggesting it supports populated tables are incorrect.

Multiple choice technology databases
  1. FROM clause

  2. WHERE clause

  3. Correlated sub query

  4. None of the above

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

The TOP option can appear in correlated subqueries. It allows limiting results from the subquery, which is then used by the outer query for comparison or filtering. TOP does not belong in FROM or WHERE clauses directly.

Multiple choice technology databases
  1. The query returns the rows in the query result set without producing an error.

  2. Return no rows

  3. Produces an error

  4. The query returns rows

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

When TOP specifies a number greater than available rows, the query returns all rows without error. Database systems handle this gracefully by returning whatever rows exist in the result set, up to the TOP limit.

Multiple choice technology databases
  1. 2

  2. 1

  3. 3

  4. 0

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

To solve this question, the user needs to know how the SQL SELECT statement and concatenation operator (||) work. The SELECT statement retrieves data from a database table and returns a result set. The concatenation operator is used to combine two or more strings into a single string.

The given SQL query concatenates three columns (address1, address2, and address2) using the concatenation operator and then renames the concatenated column as "Address".

The resulting query output will contain only one column named 'Address' that is the result of concatenating the three columns. Therefore, the correct answer is:

The Answer is: B. 1

Multiple choice technology databases
  1. 17-JUL-00

  2. 11-JUL-00

  3. 09-JUL-00

  4. 03-JUL-00

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

NEXT_DAY(date, day) returns the date of the first specified day-of-week after the given date. Starting from Monday July 10, 2000, the NEXT MONDAY is July 17, 2000 (7 days later). The format mask DD-MON-RR produces '17-JUL-00'.

Multiple choice technology databases
  1. testing

  2. True

  3. null

  4. error

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

In Oracle SQL, the NULLIF(expr1, expr2) function compares two expressions. If they are equal, it returns null; otherwise, it returns expr1. Oracle raises a syntax or validation error if the first argument is a literal NULL.