Computer Knowledge

Database and SQL

3,929 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 trigger is executed automatically.

  2. Stores procedure can be invoked explicitly.

  3. A trigger can not return any value.

  4. A stored procedure can not return any value.

  5. None of the above

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

This is a false statement as the stored procedure can return the value.

Multiple choice
  1. It allows multiple values in where clause.

  2. It is used to display records according to specified condition.

  3. It defines that the subquery return atleast one row from the database table.

  4. It is used to sort the data of the table.

  5. None of these

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

It is true about the 'Exists' clause in SQL.

Multiple choice
  1. Structured Query Luggage

  2. Structured Query Language

  3. Structured Quite Language

  4. Standard Query Language

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

Correct answer is (2). 

Multiple choice
  1. SELECT product_name FROM product WHERE country= 'US'

  2. SELECT product_name FROM product WHERE product_name IN (SELECT product_name FROM Product WHERE country= US)

  3. SELECT product_name FROM product WHERE product_name IN (SELECT product_name FROM Product WHERE country= 'US')

  4. Both (1) and (3)

  5. None of the above

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

Both are the correct queries.

Multiple choice
  1. SELECT first_name, last_name, subject FROM student_details WHERE subject = 'Economics'

  2. SELECT first_name, last_name, subject FROM student_details WHERE marks>90

  3. SELECT first_name, last_name, subject FROM student_details WHERE marks=>90

  4. Both (1) and (3)

  5. None of the above

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

This is example of equi-join as it has equal operator.

Multiple choice
  1. SELECT product_name, sum(product_price) FROM product

  2. SELECT product_name, product_price FROM product group by state

  3. SELECT product_name, sum(product_price) FROM product group by state

  4. SELECT sum(product_price) FROM product group by state

  5. None of the above

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

This is a correct SQL query for the specified result.