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 c sharp
  1. ExecuteScalar

  2. ExecuteReader

  3. ExecuteNonQuery

  4. None of the above

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

ExecuteScalar is designed for SELECT statements that return a single value (aggregate functions like COUNT, SUM, AVG, MAX, MIN). It returns only the first column of the first row, making it efficient for aggregates. ExecuteReader returns a full result set for multiple rows/columns. ExecuteNonQuery is for INSERT, UPDATE, DELETE - queries that don't return data.

Multiple choice cobol
  1. Multiply corresponding record1 by record2

  2. Add corresponding record1 to record2

  3. Move corresponding record1 to record2

  4. Subtract corresponding record1 from record2

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

COBOL allows ADD CORRESPONDING, MOVE CORRESPONDING, and SUBTRACT CORRESPONDING to operate on matching elementary items between group records. MULTIPLY CORRESPONDING is not a valid COBOL verb - the CORRESPONDING phrase is only supported with ADD, SUBTRACT, and MOVE statements.

Multiple choice sap abap
  1. Yes

  2. No

  3. Both

  4. None of the above

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

To answer the question, let's first understand the concept of client-independent tables. In SAP systems, client-independent tables are those that store data that is shared across all clients in the system, rather than being specific to a single client. These tables typically contain configuration data or other system-wide information.

Now, let's go through each option:

A. Yes: This option is incorrect. Client-independent tables do not have a MANDT field because they store data that is shared across all clients, so there is no need for a field to distinguish the client.

B. No: This option is correct. Client-independent tables do not have a MANDT field because they are not associated with a specific client.

C. Both: This option is incorrect. Client-independent tables do not have a MANDT field, so they cannot have both a MANDT field and be client-independent.

D. None of the above: This option is incorrect. Option B, "No," is the correct answer because client-independent tables do not have a MANDT field.

So, the correct answer is: B. No.

Multiple choice general knowledge
  1. True

  2. False

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

In PL/SQL, the assignment operator is ':=' not '='. The '=' sign is used for comparison (equality check) similar to other programming languages. This distinction is crucial because using '=' for assignment will result in a syntax error. The ':=' operator is specifically designed for variable assignment in PL/SQL blocks.

Multiple choice general knowledge
  1. True

  2. False

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

In PL/SQL, functions MUST return a value. This is a fundamental distinction between functions and procedures - procedures do not return values, while functions are specifically designed to compute and return a single value. The RETURN statement is mandatory in PL/SQL functions, and the function must return a value of the declared return type.

Multiple choice general knowledge
  1. True

  2. False

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

In PL/SQL (specifically in SQL*Plus environment), the '&' symbol is indeed used to create substitution variables for user input. When you place '&' before a variable name in a SQL statement, SQL*Plus prompts the user to enter a value for that variable. This is commonly used for creating interactive scripts and for dynamic value substitution during runtime.

Multiple choice general knowledge
  1. True

  2. False

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

In PL/SQL, the '<>' operator is indeed used for 'not equal' comparison. PL/SQL supports multiple inequality operators including '<>', '!=', '^=', and '~='. All these operators perform the same function - they return TRUE if the operands are not equal and FALSE if they are equal. The '<>' syntax is ANSI standard and works in most SQL implementations.

Multiple choice general knowledge
  1. True

  2. False

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

PL/SQL is Oracle's Procedural Language extension to SQL, combining data manipulation with procedural constructs like variables, conditions, and loops. The 'PL' does indeed stand for 'Procedural Language', making this statement true.

Multiple choice general knowledge
  1. INSERT INTO employee('sachin',1001,22,cse,476);

  2. SELECT * FROM employee WHERE id = 2;

  3. UPDATE employee SET last_name = 'Orange' WHERE id = 2;

  4. SELECT MONTHS_BETWEEN('25-MAY-2005', '15-JAN-2005') FROM dual;

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

Option A is incorrect - INSERT requires VALUES keyword and parentheses: INSERT INTO employee VALUES ('sachin',1001,22,cse,476) or INSERT INTO employee (col1,col2,...) VALUES (...). Options B, C, and D are correctly formatted Oracle SQL statements.

Multiple choice general knowledge
  1. 1992

  2. 1947

  3. 1990

  4. 1976

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

The Securities and Exchange Board of India (SEBI) was established on April 12, 1988, and received statutory powers on January 30, 1992 through the SEBI Act. It regulates India's securities market and protects investor interests. India's independence (1947) is unrelated.