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

  2. False

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

UNION eliminates duplicate rows from the combined result set, effectively performing a DISTINCT operation. UNION ALL preserves all rows including duplicates, which makes it faster and useful when you know there are no duplicates or want to keep them. The statement correctly describes this key difference.

Multiple choice technology databases
  1. sp_xml_postdocument

  2. sp_xml_readdocument

  3. sp_xml_loaddocument

  4. sp_xml_preparedocument

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

sp_xml_preparedocument is the correct system stored procedure that parses an XML document and returns a handle that can be used with OPENXML. The other options are่™šๆž„็š„ names that don't exist in SQL Server. After use, the document handle should be freed with sp_xml_removedocument to avoid memory leaks.

Multiple choice technology databases
  1. True

  2. False

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

TOP() is a SELECT clause used to limit result rows, not an UPDATE statement feature. In SQL Server, updates with TOP require a subquery or specific syntax, and in Oracle/database systems, TOP doesn't exist for updates at all.

Multiple choice technology databases
  1. True

  2. False

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

Analytic functions differ from standard aggregate functions because they return a result for each individual row in the query, rather than collapsing the group into a single summary row. Standard aggregate functions with GROUP BY are what return a single row per group.

Multiple choice technology databases
  1. True

  2. False

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

In Oracle SQL, all set operators (UNION, UNION ALL, INTERSECT, and MINUS) share the same level of precedence. Consequently, Oracle evaluates them in order from left to right as they appear in the query, unless parentheses are explicitly used to specify a different evaluation order.