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

  3. ERROR

  4. NULL

  5. FALSE

Reveal answer Fill a bubble to check yourself
A,B,E Correct answer
Explanation

Oracle comparison operators return three possible values: TRUE, FALSE, or UNKNOWN. UNKNOWN is returned when any operand in the comparison is NULL (not the same as NULL itself). ERROR is not a valid result for comparison conditions - errors occur from invalid operations, not comparisons. NULL is a value, not a comparison result.

Multiple choice technology databases
  1. WHERE clauses

  2. START WITH and CONNECT BY clauses

  3. select lists

  4. HAVING clauses

Reveal answer Fill a bubble to check yourself
A,B,C,D Correct answer
Explanation

Single-row functions can be used in almost any clause of a SQL query. This includes the SELECT list, the WHERE clause, the START WITH and CONNECT BY hierarchical clauses, and the HAVING clause, as they operate on individual rows.

Multiple choice technology databases
  1. exec DBMS_STATS.UNLOCK_SCHEMA_STATS('TABLE_NAME','OWNER');

  2. exec DBMS_STATS.UNLOCK_SCHEMA_STATS('OWNER','TABLE_NAME');

  3. exec DBMS_STATS.UNLOCK_DB_STATS('DB_NAME','OWNER','TABLE_NAME');

  4. exec DBMS_STATS.UNLOCK_TABLE_STATS('TABLE_NAME','OWNER');

  5. exec DBMS_STATS.UNLOCK_TABLE_STATS('OWNER','TABLE_NAME');

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

DBMS_STATS.UNLOCK_TABLE_STATS takes two parameters: schema name first, then table name. Options A and B incorrectly use UNLOCK_SCHEMA_STATS which locks/unlocks all tables in a schema. Option C uses UNLOCK_DB_STATS which doesn't exist. Option D has the parameter order reversed.

Multiple choice technology databases
  1. True

  2. False

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

A tablespace is a logical storage container that can hold database objects (tables, indexes) from multiple schemas. Schemas are logical namespaces for users, while tablespaces are physical storage structures - they're independent concepts. This is a fundamental Oracle architecture feature allowing flexible storage management.

Multiple choice technology databases
  1. colons

  2. parentheses

  3. commas

  4. semi-colons

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

Parentheses override the default operator precedence in SQL expressions, just like in standard mathematics. Without parentheses, SQL evaluates operators according to precedence rules (NOT before AND before OR). Colons, commas, and semicolons are statement separators or terminators, not grouping operators.

Multiple choice technology
  1. Authors Field

  2. Readers Field

  3. Editors Field

  4. Managers Field

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

In Lotus Notes, the Managers field contains user names who have full access including ACL management. Authors can create but not delete documents, Readers can only read, and Editors can modify documents but not manage access at the field level. The Managers field is specifically for access control.

Multiple choice technology databases
  1. left join

  2. right join

  3. outer join

  4. equil join

  5. simple join

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

An outer join (C) extends a simple join by including non-matching rows from one or both tables. A simple join is typically an inner join that only returns matching rows. Left joins (A) and right joins (B) are specific types of outer joins, making 'outer join' the broader, more general answer. An equijoin (D) is a basic inner join based on equality, not an extension.

Multiple choice technology databases
  1. This is hard to determine

  2. One or more scalar typed object attributes of a cluster

  3. One or more columns of a table

  4. A nested table storage table

Reveal answer Fill a bubble to check yourself
B,C,D Correct answer
Explanation

CREATE INDEX in Oracle works on table columns, cluster object attributes, and nested table storage tables. Indexes organize data for faster lookups on these structures.

Multiple choice technology databases
  1. outer join

  2. equil join

  3. simple join

  4. right join

  5. left join

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

An inner join is called a "simple join" in Oracle SQL because it returns only rows where the join condition matches in both tables. It's not an outer join (which includes non-matching rows).

Multiple choice technology databases
  1. when two tables in a join query have only a single join condition

  2. when two tables in a join query have too many join conditions

  3. This is hard to determine.

  4. when two tables in a join query have no join condition

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

A Cartesian product (cross join) occurs when two tables are joined without any join condition or WHERE clause linking them. Every row from the first table is paired with every row from the second table.