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

  2. P only

  3. Both P and Q

  4. Both P and R

  5. R only

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

This is true choice. Q statement is correct because the primary key and the foreign key can exist in the same relation. Moreover foreign key can refer to the primary key in the same relation.So, this is a correct choice.

Multiple choice
  1. P only

  2. Both P and Q

  3. Both P and R

  4. Both Q and R

  5. All of these

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

Option P is correct because a candidate key is a key that uniquely identifies a row in a relation. So, this cannot be null as it uniquely identifies a row. Option R is correct because primary key is chosen from a set of candidate keys. In other words all the candidate keys are the candidates for the primary key. So, in this way all the candidate keys are primary keys. So, this is the correct answer.

Multiple choice
  1. scanning and parsing

  2. query optimiser

  3. query code generator

  4. runtime database processor

  5. subquery

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

This is the first step in executing a SQL query in DBMS as once a query is entered into the system its meaning is to be clearly understood by the compiler.