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. Select * from table

  2. Select distinct from table

  3. Select column 1and column 2 from table

  4. Select column 1 from table

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

This is a correct query which shows only distinct data and no duplicate values.

Multiple choice
  1. Index

  2. Cursor

  3. Sequence

  4. Trigger

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

Triggers are SQL statements that are stored in the database catalog. Once triggers are activated by database events such as UPDATE, DELETE or INSERT, the triggers will execute either before or after the event that initiates them.

Multiple choice
  1. By using cursors

  2. By using query tree

  3. By using singleton select

  4. None of the above

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

Query tree is an internal representation of SQL statements where the single parts that  are built stored separately.

Multiple choice
  1. If all query processing is performed by the database system

  2. Use of correct and exact syntax with respect to an SQL language embedded

  3. Embedded SQL must follow RDBMS rules

  4. Embedded SQL expression for database modifications always return a value

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

It is not compulsary for SQL expression to return a value.

Multiple choice
  1. Candidate key

  2. Super key

  3. Primary key

  4. Both (1) and (2)

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

Candidate keys are special subsets of superkeys that do not have any extraneous information in them. Each table may have one or more candidate keys. A superkey is a combination of attributes that can be uniquely used to identify a database record. A table might have many superkeys. Hence, both the options 1 and 2 are correct.