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. It can view the data without storing the data into the object.

  2. It can hide the complexity of data.

  3. It restricts the access of a table so that nobody can insert the rows into the table.

  4. It can use DML operations on the views.

  5. It joins two or more tables and shows it as one object to a user.

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

This is the correct answer as it cannot use DML operations on the views.

Multiple choice
  1. employee’s salary is greater than 4999

  2. employee’s department is accounts

  3. employee’s department is accounts and employee’s salary is greater than 5000

  4. employee’s department is accounts and employee’s salary is greater than 4999

  5. total salary of employee is zero

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

This option is correct because the employee’s department is accounts and employee’s salary is greater than 4999.

Multiple choice
  1. Select * from employee where empid = 505

  2. Select empid from employee where empname = John

  3. Select empid from employee

  4. Select empid where empid = 509 and lname = John

  5. Select * from employee where empid = 305

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

This option is correct because the query does not have 'from' clause which specifies the relation/table from which the values have to be selected.

Multiple choice
  1. return all customer names without duplicate values

  2. return all customer names from the depositor table

  3. return all customer names from borrower table

  4. return all customer names if names available in depositor table match with borrower table

  5. return all customer names with duplicate values

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

The union operator is used to combine the result-set of two or more SELECT statements. The union operator selects only distinct values by default. Here, it will return the customer names, who all are listed in depositor table and borrower table without repeating the names.

Multiple choice
  1. Select * from tblemployee where city like ‘mi’

  2. Select * from tblemployee where city ‘mi%’

  3. Select * from tblemployee where city ‘‘mi%’’

  4. Select * from tblemployee where city like ‘mi%’

  5. Select * from tblemployee where city like ‘%mi’

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

This option is correct because 'Select * from tblemployee where city like ‘mi%’ is the correct statement.