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 mainframe
  1. 0

  2. 1

  3. 2

  4. 3

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

The IDENTIFICATION-TABLE contains two records with IDENT-ID equal to '1234': (1234, AAAA, 23) and (1234, ABCD, 22). The FIND statement with IDENT-ID EQ '1234' will retrieve both matching records, so the LOOP displays 2 records.

Multiple choice technology mainframe
  1. 0

  2. 1

  3. 2

  4. 3

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

The SUPER-ID-NAME-AGE is a super descriptor that combines multiple fields (ID, NAME, AGE) into a single composite key. Searching for '1234' alone cannot match the full super descriptor value, which would be something like 'AAAA123423' for the first record. Since no super descriptor equals just '1234', zero records are returned.

Multiple choice technology databases
  1. LINESIZE

  2. FEEDBACK

  3. PAGESIZE

  4. PAUSE

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

In SQL*Plus, the FEEDBACK setting (configured via SET FEEDBACK n) determines the minimum number of rows a query must return to display the row count message (like '10 rows selected'). LINESIZE sets line width, PAGESIZE sets lines per page, and PAUSE halts output scrolling.

Multiple choice technology
  1. Union

  2. Outer Join

  3. Inner Join

  4. Sub Query

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

The Union operator in SQL is used to combine the result sets of two or more queries into a single resultant result set. Joins combine columns from multiple tables based on related columns, whereas Union combines rows. Subqueries are nested queries used within other queries.

Multiple choice technology
  1. SQL Table & SQL View

  2. SQL Table & Derived/Work record

  3. SQL View & Temporary table

  4. Derived/Work record & Temporary table

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

State records in Application Engine programs must be either SQL Tables or Derived/Work records. SQL Views cannot be used because state records require read-write capability for storing process state, and views are typically read-only. Temporary tables are not appropriate for maintaining persistent state across executions.

Multiple choice technology packaged enterprise solutions
  1. Add the field SETID as a key field to each table you want to share and define a set control field

  2. Add the BUSINESS_UNIT and SETID fields as keys to the table you want to share

  3. Add the field BUSINESS_UNIT as a key field to each table you want to share and define a set control field

  4. Add the SETID field as a key to each table you wish to share

  5. Add the BUSINESS_UNIT field as a key to each table you wish to share

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

Table sharing in PeopleSoft requires adding the SETID field as a key to each shared table and defining a set control field to manage data segmentation across different sets. While BUSINESS_UNIT can be used, SETID with set control field is the primary mechanism for table sharing.

Multiple choice technology databases
  1. Parsing

  2. Optimization

  3. Row source generation

  4. Statement execution

  5. All of the above

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

Parsing breaks SQL statements into component parts (keywords, table names, column names) and determines the statement type (DML, DDL, DCL, or query). It performs syntactic validation before optimization or execution occurs.

Multiple choice technology databases
  1. Parsing

  2. Optimization

  3. Row source generation

  4. Statement execution

  5. All of the above

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

Oracle statement execution follows a sequence: parsing (syntax/semantic validation), optimization (execution plan generation), row source generation (retrieval strategy), and statement execution (actual data access). All steps are required.

Multiple choice technology platforms and products
  1. A->1, B->2, C->3

  2. A->3, B->2, C->1

  3. A->2, B->1, C->3

  4. A->2, B->3, C->1

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

ejbStore() synchronizes entity bean state to database (UPDATE), ejbLoad() refreshes bean state from database (SELECT), and ejbCreate() inserts new data (INSERT). The mapping is ejbStore->UPDATE, ejbLoad->SELECT, ejbCreate->INSERT.

Multiple choice technology databases
  1. auto identity

  2. identity in nonunique index

  3. unique auto_identity index

  4. async log service

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

The 'identity in nonunique index' configuration option allows Sybase ASE to automatically add an identity column to a non-unique index, effectively making it unique. This is useful for enabling unique constraints without changing the table schema.

Multiple choice technology databases
  1. with header

  2. with headerofdump

  3. with dumpstatus

  4. with listonly

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

The 'with listonly' clause used with load database allows you to verify a dump's validity without actually performing the full restore. It displays the dump header information and checks for corruption, serving as a pre-restore validation step.