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. Structured Query Language

  2. Strong Question Language

  3. Structured Question Language

  4. None of the Above

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

SQL stands for Structured Query Language, the standard language for relational database management systems.

Multiple choice technology databases
  1. Can be the object of an IN or NOT IN clause

  2. Can be the object of EXISTS or NOT EXISTS

  3. Support quantifiers ALL, ANY, SOME

  4. Support LIKE or NOT LIKE used with a

  5. Cannot specify more than one column to match

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

The statement "Cannot specify more than one column to match" does not hold true generally, as subqueries can return multiple columns when used with operators like EXISTS or in column comparison lists (e.g., (A, B) IN (SELECT X, Y...)). Other options describe correct standard behaviors of subqueries.

Multiple choice technology databases
  1. CREATE

  2. DROP

  3. MODIFY

  4. ALTER

  5. GRANT

  6. REPLACE

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

DDL (Data Definition Language) statements define database structures - these include CREATE, ALTER, DROP, TRUNCATE, and RENAME. GRANT is a DCL (Data Control Language) statement used to give user permissions on database objects, not to define database structures. Since the question asks which is NOT a DDL statement, GRANT is the correct answer.

Multiple choice technology
  1. True

  2. False

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

Informatica allows nesting of aggregate functions (like SUM(MAX(salary))) but does NOT allow one aggregate function directly inside another aggregate function - you must use group by ports appropriately. The restriction is on direct nesting, not on using multiple aggregate functions in the same expression.

Multiple choice technology enterprise content management
  1. The Order table must be included in each query.

  2. The Order Detail table has conflicting cardinalities.

  3. Outer joins are generated when querying from Customer.

  4. There is more than one possible path between the tables.

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

A transitive relationship or loop in database modeling creates multiple path options when joining tables (e.g., Joining A to C directly vs A to B to C). This ambiguity causes query generation issues because reporting engines have more than one possible join path to retrieve the data.

Multiple choice technology databases
  1. SELECT DISTINCT position, manager

  2. SELECT position, manager DISTINCT

  3. SELECT position, manager

  4. SELECT position, DISTINCT manager

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

The DISTINCT keyword must immediately follow the SELECT keyword to filter duplicate rows. Placing DISTINCT elsewhere in the query is syntactically invalid, which rules out all other distractors.

Multiple choice technology databases
  1. SQL*Plus commands cannot be abbreviated.

  2. SQL*Plus commands are accesses from a browser.

  3. SQL*Plus commands are used to manipulate data in tables.

  4. SQL*Plus commands manipulate table definitions in the database.

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

SQL*Plus is Oracle's command-line interface for executing SQL commands. It can manipulate actual table data (C) and database schema definitions (D) using SQL statements. SQL*Plus commands CAN be abbreviated, contradicting A.

Multiple choice technology databases
  1. Insert

  2. update

  3. select

  4. describe

  5. delete

  6. rename

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

DESCRIBE is a SQL*Plus-specific command that displays table/column metadata. Options A, B, E, and F are SQL commands; 'describe' is the only SQL*Plus command listed.

Multiple choice technology databases
  1. Selection, projection, join

  2. Difference, projection, join

  3. Selection, intersection, join

  4. Intersection, projection, join

  5. Difference, projection, product

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

This query performs selection (WHERE clause filters rows), projection (SELECT chooses specific columns), and join (connects EMP and DEPARTMENT tables). These are fundamental SQL capabilities.

Multiple choice technology databases
  1. The sort is in ascending by order by default

  2. The sort is in descending order by default

  3. The ORDER BY clause must precede the WHERE clause.

  4. The ORDER BY clause is executed on the client side.

  5. The ORDER BY clause comes last in the SELECT statement.

  6. The ORDER BY clause is executed first in the query execution.

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

The ORDER BY clause sorts results in ascending order (ASC) by default. It is positioned last in the SELECT statement structure, after WHERE, GROUP BY, and HAVING clauses. Options B, C, D, and F are incorrect - ORDER BY does not default to descending, must come after WHERE, executes on the server, and is not executed first.