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. DATETIME

  2. SMALLDATETIME

  3. INT

  4. VARCHAR

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

For SQL Server 2000, the DATETIME type only supports dates from January 1, 1753 onwards, which cannot store historical dates like February 22, 1732. Storing dates as INT (days since a reference point) or VARCHAR allows working with pre-1753 dates. This is a SQL Server-specific limitation.

Multiple choice technology databases
  1. 2000/02/29

  2. 2000/03/01

  3. 44

  4. An error is generated. A DATETIME value and an INT value cannot be added together. Use the DATEADD function for this purpose.

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

The expression 2000/02/25 is interpreted as integer division (2000 divided by 2 divided by 25), not as a date. 2000/2 = 1000, then 1000/25 = 40. So 40 + 4 = 44. To add days to a date, you must use the DATEADD function with a proper DATETIME value.

Multiple choice technology platforms and products
  1. In SAP Easy access screen enter the transaction code in Command field

  2. If you are not in SAP Esy access screen enter /N followed by the transaction code in command field

  3. If you want to open a transaction in new session, enter /O followed by transaction codein command field

  4. Go to the appropriate menu and explore to find your transaction and execute

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

All four methods are standard ways to execute a transaction in SAP. You can run codes directly in the Easy Access command field, use /N to exit and run from another screen, use /O to open a new session, or navigate the SAP menu hierarchy.

Multiple choice technology databases
  1. Used to uniquely identify a row

  2. Alias for primary key

  3. Used to identify a column

  4. Alias for foreign key

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

A candidate key is a minimal set of attributes that uniquely identifies each row in a table. A table can have multiple candidate keys, and one is selected as the primary key.

Multiple choice technology databases
  1. Dymanic

  2. Real

  3. Virtual

  4. Static

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

To solve this question, the user needs to know about views in database management systems. A view is a virtual table that does not store any data but only displays data from one or more tables in the database.

Based on this information, the correct answer is:

The Answer is: C. Virtual

Multiple choice technology databases
  1. True

  2. False

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

A table can have multiple UNIQUE constraints, each enforcing uniqueness on a different column or combination of columns. This is different from a PRIMARY KEY, of which a table can only have one. UNIQUE constraints are commonly used on columns like email, username, or phone number where duplicates should not occur.

Multiple choice technology mainframe
  1. KEY FIELD

  2. SEARCH FIELD

  3. BOTH

  4. NONE

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

In database design, a key field (or sequence field) is used to uniquely identify and sequence records or segments. Once set, its value generally cannot be altered to maintain database integrity and structure. Search fields are used for querying data and can be modified, making other options incorrect.

Multiple choice technology mainframe
  1. TRYING TO CHANGE KEY

  2. NO PRECEDING GET HOLD CALL

  3. REPLACE RULE VIOLATION

  4. ALL THE ABOVE

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

In IMS DL/I status codes, DJ specifically indicates that a program attempted to perform an operation (typically Replace or Delete) that requires a GET HOLD call, but no preceding GET HOLD was issued. The 'D' status codes relate to DL/I call errors. This is a common error when programs try to update segments without properly locking them first with a GET HOLD call.

Multiple choice technology
  1. Java

  2. Custom

  3. SQL

  4. Update strategy

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

SQL Transformation allows dynamic execution of SQL queries at runtime, making it ideal for updating target column values based on complex logic or lookups that can't be handled by standard transformations. Unlike Update Strategy which only flags records for insert/update/delete, SQL Transformation can execute actual UPDATE statements with dynamic conditions.