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

  2. double

  3. record set

  4. no return value

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

The executeUpdate(String s) method in JDBC returns an integer value representing the number of rows affected by the SQL operation (INSERT, UPDATE, DELETE). For CREATE TABLE or similar DDL statements, it typically returns 0.

Multiple choice
  1. Difference, projection, join

  2. Selection, projection, join

  3. Selection, intersection, join

  4. Intersection, projection, join

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

SQL's SELECT statement implements the three fundamental relational operations: selection (choosing rows based on conditions via WHERE), projection (choosing columns via SELECT), and join (combining data from multiple tables via JOIN). Difference and intersection are other set operations, not the primary SELECT operations described.

Multiple choice
  1. getMaxColumnLength()

  2. getMaxColumnNameLength()

  3. getMaxColNameLength()

  4. getMaxColLength()

  5. getColumnNameLength()

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

This is the correct choice because getMaxColumnNameLength() method is defined in the DatabaseMetaData interface and it retrieves the maximum number of characters this database allows for a column name.

Multiple choice
  1. Here-docs

  2. String offset

  3. MySqli_connect

  4. MySql_opt_connect_timeout

  5. MySqli_multi_query()

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

This technique enables you to embed large piece of text in your script which may include lots of double quotes and single quotes without having to constantly escape them.