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

  2. Column

  3. Database

  4. All the above

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

The USE keyword in SQL selects a database as the active context for subsequent operations. For example, 'USE company_db;' makes 'company_db' the default database so you don't need to prefix table names. It does not select tables or columns; those are selected with SELECT statements.

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

Multiple choice technology security
  1. waitfor delay '0:0:5'

  2. Select * from ;--

  3. ‘ OR ‘1’=’1

  4. OR 1=1

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

Blind SQL injection reveals no data in responses, so testers use time-based techniques like WAITFOR DELAY (SQL Server) or sleep() (MySQL) to confirm vulnerability. If injection succeeds, the delay occurs. Options C and D work in reflected injection where results appear in page output. Option B causes errors regardless. Time-based observation (A) is definitive for blind scenarios.

Multiple choice technology databases
  1. A flat file called "plan_table.txt"

  2. Oracle Table called "plan_table"

  3. Oracle Table called "plan table"

  4. A flat file called "plan_table.tbl"

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

In Oracle, EXPLAIN PLAN results are written by default to a table named "plan_table" (with an underscore), not to flat files or space-separated names like "plan table". This allows querying and formatting of execution plans using DBMS_XPLAN.

Multiple choice technology databases
  1. It's advisable to choose the driving table with maximum number of records

  2. Number of records is NOT the criteria while selecting driving table

  3. It's advisable to choose the driving table with less number of records

  4. Driving table is always the last table accessed by the Optimizer

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

In join operations, the driving table (accessed first by the optimizer) should typically be the smaller table or the one with the most selective filter condition. This minimizes intermediate result sets and improves overall join performance.

Multiple choice technology databases
  1. Optimizer will return parse error if expressions are used on columns in the predicate

  2. Optimizer does not use index if expressions are used on the columns in the predicate, even if one exists

  3. It makes no difference with / without expressions on the columns in the predicate

  4. Using expressions on the columns in the predicate won't get benefits of using Table Alias

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

When you apply functions or expressions to indexed columns in WHERE clauses (e.g., WHERE UPPER(name) = 'TEST'), the optimizer cannot use the index on that column. This forces a full table scan instead of an efficient index range scan, severely degrading performance.

Multiple choice technology web technology
  1. Combines multiple scans

  2. Reduce number of calls to the database

  3. Performs many small scans as compared to one large scan

  4. Makes more smaller calls to the database as compared to one large call

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

CASE expressions in SQL let you implement conditional logic within a single statement. This allows you to combine what would otherwise be multiple queries or scans into one operation, reducing roundtrips to the database and overall execution time.

Multiple choice technology web technology
  1. HASH JOIN

  2. SORT UNIQUE

  3. TABLE FULL ACCESS

  4. INDEX RANGE SCAN

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

UNION performs a SORT UNIQUE operation to eliminate duplicate rows from the combined result set, which requires sorting. UNION ALL skips this sorting and deduplication step, simply concatenating all rows from both queries. This makes UNION ALL faster when you don't need to remove duplicates.

Multiple choice technology packaged enterprise solutions
  1. RSU01

  2. SU01

  3. ZUSERLIST

  4. RSMO

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

ZUSERLIST is a custom SAP transaction code designed to retrieve and display user IDs created on a specific date in the BI environment. SU01 is the standard user maintenance transaction but doesn't provide date-filtered listing capability. RSU01 and RSMO are not the correct transactions for this purpose - they serve other functions in SAP systems.

Multiple choice technology
  1. Create statement

  2. Prepared Statement

  3. Callable Statement

  4. Synchronized statement

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

JDBC provides three types of statements for executing SQL: Statement (basic SQL execution), PreparedStatement (precompiled SQL with parameters), and CallableStatement (for stored procedures). "Synchronized statement" is not a JDBC concept - synchronized is a Java keyword for thread synchronization, unrelated to database operations.