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
  1. Over Partition By

  2. Over Group By

  3. Both

  4. None

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

T-SQL allows columns in GROUP BY that are not in the SELECT list, but PL/SQL prohibits this. The OVER clause with PARTITION BY provides similar functionality in PL/SQL by allowing window functions without the restrictive GROUP BY requirement.

Multiple choice technology databases
  1. varchar

  2. int

  3. text

  4. binary

  5. Image

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

SQL Server has deprecated the legacy 'text' and 'Image' data types in favor of varchar(max) and varbinary(max). While still functional for backward compatibility, they are not recommended for new development. Varchar, int, and binary are fully supported modern types.

Multiple choice technology databases
  1. A procedure that is very small

  2. A procedure being invoked by another procedure

  3. A procedure that is not used by application

  4. System stored procedures

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

A child stored procedure is a procedure that is called (invoked) by another stored procedure. This is a common design pattern for modularizing complex database logic into reusable components.

Multiple choice technology databases
  1. timestamp

  2. varchar

  3. datetime

  4. number

  5. raw

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

Oracle does not support the 'datetime' data type - it uses 'date' for date/time values and 'timestamp' for higher precision. Varchar, number, timestamp, and raw are all valid Oracle data types. This is a common source of confusion for developers migrating from other databases.

Multiple choice technology databases
  1. @@trancount

  2. @@rowcount

  3. @@sqlstatus

  4. @@rescount

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

@@rowcount returns the number of rows affected by the last statement in Sybase. This is a system variable used to check the impact of INSERT, UPDATE, or DELETE operations. @@trancount tracks transactions, @@sqlstatus is for cursor status, and @@rescount does not exist.

Multiple choice technology databases
  1. inserted

  2. updated

  3. deleted

  4. created

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

Magic tables in Sybase are virtual tables used in triggers to access the data being modified. 'inserted' contains new rows (for INSERT and UPDATE), and 'deleted' contains old rows (for DELETE and UPDATE). These tables exist only during trigger execution and are not permanent tables.

Multiple choice technology delivery
  1. Tables

  2. Stored Procedures

  3. Triggers

  4. Indexes and Views

  5. All of the above

  6. All except Indexes and Views

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

Database conversion is a comprehensive process that requires migrating all schema elements, business logic, and access structures, including tables, stored procedures, triggers, indexes, and views, to ensure compatibility with the target database.

Multiple choice technology packaged enterprise solutions
  1. True

  2. False

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

In PEGA's Work Party rules, the Model column allows referencing a Model rule that defines default information for party fields. This Model rule populates default values on the PartyDisplay form, reducing manual data entry and ensuring consistency. The Model column is indeed optional, allowing flexible configuration.

Multiple choice technology databases
  1. Insert

  2. Create

  3. Delete

  4. Select

  5. Grant

  6. Commit

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

SELECT is the SQL statement used for data retrieval - it queries and returns data from database tables. Insert adds new data, Create defines structures, Delete removes data, Grant gives permissions, and Commit saves transactions - none of these are primarily for retrieval.

Multiple choice technology databases
  1. Insert

  2. Create

  3. Delete

  4. Select

  5. Merge

  6. Update

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

Data Manipulation Language (DML) statements modify data: Insert adds new rows, Delete removes rows, Merge combines insert/update/delete operations, and Update modifies existing data. Create is DDL (defines structure), Select is for retrieval not manipulation.

Multiple choice technology databases
  1. Alter

  2. Rollback

  3. Select

  4. Commit

  5. Rename

  6. Savepoint

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

Transaction Control Language (TCL) commands manage transactions: Rollback undoes changes, Commit permanently saves changes, and Savepoint sets intermediate rollback points. Alter and Rename are DDL structure commands, Select is for retrieval.