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. A cursor defines a private area in memory, when SQL statements are executed.

  2. Implicit cursor are created, when any DML operation occurs in the database.

  3. Explicit cursors are executed by default.

  4. Explicit cursors can process only one record at a time.

  5. None of the above

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

Explicit cursors are not executed by default. They are executed when SELECT statement is used to return more than one row.

Multiple choice
  1. Triggers are executed automatically when any associated DML operation is executed.

  2. In row level trigger, an even is fired when any row is updated.

  3. Cyclic cascading in triggers can crash the database.

  4. DESC USER_TRIGGERS function is used to get information about the trigger.

  5. None of the above

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

Correct choice

Multiple choice
  1. Stored procedure reduces network traffic.

  2. Stored procedures provide security to the database.

  3. Stored procedure provides maintainability to the application.

  4. Stored procedures are limited to T/SQL only and produce somewhat complexity.

  5. (1), (2) and (3) all are true.

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

Yes, all of these are the advantages of stored procedure.

Multiple choice
  1. A primary key cannot be NULL.

  2. A foreign key can be NULL.

  3. A foreign key can have the same name as primary key.

  4. A foreign key can have the name other than the primary key.

  5. None of the above

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

This is the right choice as all the above statements are true.

Multiple choice
  1. A view in database provides security.

  2. A view can hide the complexity of data in the database.

  3. A view can act as aggregate tables.

  4. A view can join multiple tables and simplify them as a single table.

  5. All of the above are true statements.

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

This is the correct choice as all of the above choices are correct.

Multiple choice
  1. Transitive dependency exists in the 3rd normal form of database.

  2. 1st normal form ensures that there should be a unique identifier for each row.

  3. 3rd normal form should be in 2nd normal form.

  4. Normalisation is used to eliminate redundant data.

  5. None of the above

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

No, it is not true as 3rd normal form is used to remove the transitive dependency from the database tables.

Multiple choice
  1. Logical data independence

  2. Physical data independence

  3. Integrity independence

  4. View updation rule

  5. None of the above

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

Yes, this is the rule given by E.F. Codd determines that the user view should not change despite the logical structures (splitting of tables) has been changed.

Multiple choice
  1. Indexes are used to retrieve the rows of the database table quickly.

  2. Indexes are not useful for the tables having less data.

  3. The check constraints in SQL defines the business rules that should be follow by all the rows of the database.

  4. Both (1) and (3) are true.

  5. All (1), (2) and (3) are true.

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

Yes, all the three statements are true.