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 programming languages
  1. SELECT, CONNECT, RESOURCE

  2. SELECT,INSERT,DELETE

  3. INSERT,DELETE,MODIFY,

  4. None Of The Above

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

In Oracle, SELECT, INSERT, and DELETE are object privileges, while CONNECT and RESOURCE are legacy roles (collections of system privileges). While the question asks for 'privileges', the first option represents the standard administrative roles often granted to new users to allow them to connect and create objects.

Multiple choice technology programming languages
  1. DISTINCT

  2. UNIQUE

  3. DISTINCT and UNIQUE

  4. None Of The Above

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

The DISTINCT keyword is used in a SELECT statement to remove duplicate rows from the result set, ensuring each row is unique. While UNIQUE is a constraint used during table creation to prevent duplicate entries in a column, it is not a valid SQL command for filtering query results.

Multiple choice technology programming languages
  1. True

  2. False

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

Most database systems do not allow calling stored functions within table constraints like CHECK constraints. This is because constraints must be deterministic and schema-bound - they cannot rely on user-defined functions that might change or have side effects. Constraints are validated during query optimization and execution planning, where stored function calls would introduce complexity and potential performance issues.

Multiple choice technology programming languages
  1. True

  2. False

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

INSTEAD OF triggers can be defined on views in database systems like SQL Server and Oracle. These triggers fire instead of the DML operation (INSERT, UPDATE, DELETE) that would otherwise be performed on the view. This allows you to implement custom logic for updating views that would otherwise be non-updatable because they join multiple tables or contain computed columns.

Multiple choice technology web technology
  1. Two Rows and One column

  2. Two columns and One Row

  3. Two Rows and Two columns

  4. One Row and One column

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

Each tag in HTML creates one table row. The code shows two tags, which means two rows are created. Since each row contains only one (table data) cell, the table has one column.

Multiple choice technology databases
  1. to_char

  2. max

  3. cube

  4. rollup

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

To answer this question, the user needs to have knowledge of SQL functions.

A. to_char: This function is used to convert a number or date to a string. It cannot operate on any datatype.

B. max: This function returns the maximum value in a set of values. It can operate on any datatype.

C. cube: This function is used to generate a result set that represents the subtotals and grand totals of the selected columns. It cannot operate on any datatype.

D. rollup: This function is used to generate a result set that represents the subtotals of the selected columns. It cannot operate on any datatype.

Therefore, the correct answer is:

The Answer is: B. max

Multiple choice technology databases
  1. Primary key access

  2. Full table scan

  3. Access via unique index

  4. Table access by ROWID

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

ROWID is Oracle's internal physical address for each row. Access by ROWID is the fastest method because it's a direct physical lookup, avoiding index traversal or full scans. Primary key and unique index access are fast but require index navigation.

Multiple choice technology
  1. You cannot use SSIS to import non-standard text files

  2. Use a flat file connection and assign text file for the connection and get the data

  3. Use a flat file connection and Transformation option of the script component. The use some code get the orderdate

  4. Use fuzzy grouping and a flat file connection to get order date

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

The Script Component in transformation mode allows custom C# or VB.NET code to parse each row and handle variable structures (like missing orderdate fields). Standard flat file connections require uniform schemas across all rows, and fuzzy grouping is for data matching, not structural variations.