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. drop the view and create a new one

  2. use CREATE OR REPLACE syntax

  3. use ALTER VIEW syntax

  4. use UPDATE sytax

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

CREATE OR REPLACE VIEW is the simplest way to modify a view definition - it preserves permissions and dependencies. Dropping and recreating loses permissions and requires re-granting. ALTER VIEW doesn't exist for redefining views in most databases. UPDATE syntax is for data, not DDL.

Multiple choice technology databases
  1. IN

  2. ALL

  3. <>

  4. ANY

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

When a subquery returns multiple rows, you must use set-based operators: IN checks membership in the result set, ALL compares against every value (e.g., salary > ALL means greater than the maximum), and ANY compares against any value (e.g., salary = ANY means equal to at least one, equivalent to IN). Standalone comparison operators like = or <> cannot directly handle multiple-row results.

Multiple choice technology databases
  1. SQL is a language for accessing data from an Oracle server

  2. iSQL*Plus cannot be abbreviated

  3. SQL cannot be abbreviated.

  4. iSQL*Plus is a language for accessing data from an Oracle

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

SQL is a query language for accessing and manipulating data in Oracle databases and other RDBMS. The name SQL itself is the standard, complete name used in practice - it's not typically abbreviated further in technical documentation. In contrast, iSQL*Plus is a client tool/interface for executing SQL, not a language itself.

Multiple choice technology databases
  1. Creation of a new table based off of the output of SELECT statements

  2. Return information from specific columns

  3. Return information from specific rows

  4. The combination of values in different tables

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

A SELECT statement returns a result set but does not create tables by itself - creating a table requires CREATE TABLE AS SELECT (CTAS) or SELECT INTO, which are DDL statements, not pure SELECT. Options B, C, and D are all capabilities of SELECT: specifying columns in the SELECT list, filtering rows with WHERE, and combining tables with JOIN.

Multiple choice technology web technology
  1. Create another SELECT statement in a FROM clause

  2. Create a WHERE statement in an UPDATE clause.

  3. Create another SELECT statement in a HAVING clause.

  4. Create an ALTER statement in a SET clause

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

Subqueries can be placed in the FROM clause (inline views), the HAVING clause of a SELECT statement, and the WHERE clause of UPDATE/DELETE/SELECT statements. ALTER is a DDL command and cannot contain subqueries in a SET clause.

Multiple choice technology databases
  1. select ename||',is the'||job from emp

  2. select ename,||'is the||job from emp

  3. select 'ename'||'is the'||'job' from from emp

  4. select ename||concat('is the',job) from emp

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

Option A correctly uses concatenation with || operator to combine columns and strings. Option C correctly concatenates string literals (quoted strings) - the column name 'ename' in quotes is a literal string, not a column reference, but this is valid SQL syntax. Options B and D have syntax errors.

Multiple choice technology
  1. Restrict result sets

  2. Filter occurrences

  3. Increase the query performance

  4. None of the Above

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

Filters restrict result sets by applying conditions that narrow the data returned. Option B ('Filter occurrences') is vague and not a standard database concept. Option C is incorrect because while filters can reduce data volume, their primary purpose is data restriction, not performance enhancement - that's a side effect, not the function itself.

Multiple choice technology programming languages
  1. SELECT

  2. EXECUTE

  3. ALTER TABLE

  4. CREATE TABLE

  5. DELETE

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

CREATE TABLE is a system privilege that allows a user to create tables in their schema. SELECT, EXECUTE (when on procedures), DELETE, and ALTER TABLE are object privileges that must be granted on specific database objects. System privileges are schema-wide authorities, while object privileges operate on named objects.

Multiple choice technology programming languages
  1. string and date

  2. character and numeric

  3. integer and conversion

  4. calendar and date

  5. date and conversion

  6. translation and date

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

SQL provides built-in functions across multiple categories: character functions (SUBSTR, CONCAT, etc.), numeric functions (ABS, ROUND, etc.), date functions (SYSDATE, ADD_MONTHS, etc.), and conversion functions (TO_CHAR, TO_DATE, CAST, etc.). Option B correctly identifies character and numeric functions. Option E correctly identifies date and conversion functions. Option A is partially correct but incomplete. Options C, D, and F contain incorrect or non-standard category names.

Multiple choice technology programming languages
  1. A MERGE statement is used to merge the data of one table with data from another.

  2. A MERGE statement can be used to update existing rows in a table.

  3. A MERGE statement replaces the data of one table with that of another.

  4. A MERGE statement can be used to insert new rows into a table.

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