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. Distinct

  2. Primary key

  3. Unique

  4. Different

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

There are situations where the values in a column are repeated. For example, the city column of a table can have many records of Mumbai, Delhi etc. To display the repeated values just once we can put the distinct clause with the where clause. For example, the statement select distinct(city) from list will display the name of a city only once. If the name of a city is present in the table more than once it will be shown just once.

Multiple choice
  1. The table should be in 2 NF.

  2. The non-prime attributes must be dependent on primary key.

  3. There must be transitive functional dependency to be in 3NF.

  4. All of the above.

  5. Both (1) and (2).

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

These are correct statements.

Multiple choice
  1. First normal form provides the unordered set of data.

  2. Second normal from considers all the non primary columns in the table should depend on the primary key.

  3. Third normal form does not have any transitive dependency.

  4. There are no anomalies possible in data normalization.

  5. None of the above

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

All are the correct statements.

Multiple choice
  1. It creates a set of separate table for each set of data.

  2. It identify each set of related data with a foreign key.

  3. It eliminates the repeating groups of data.

  4. Both (2) and (3).

  5. None of the above

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

It uses a primary key for identification of each set of related data in the database.

Multiple choice
  1. select name from studentwhere name ='aman' and 'harish';

  2. select 'aman' and 'harish'from student;

  3. select namefrom studentwhere name like 'aman' or name like 'harish';

  4. select name from studentwhere name is 'aman' and 'harish';

  5. select 'aman' and 'harish'from studentwhere name = student;

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

This is the correct query as it makes use of like predicate to match the correct student names.

Multiple choice
  1. DML Statements

  2. System Control Statements

  3. Embedded SQL Statements

  4. Session Control Statements

  5. Transaction Control Statements

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

These statements in SQL allow users to control the properties of their current session by enabling or disabling roles of users and changing language settings.