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

What is the process of breaking down a complex query into smaller, more manageable subqueries called?

  1. Query Optimization

  2. Query Decomposition

  3. Query Transformation

  4. Query Rewriting

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

Query decomposition is the process of breaking down a complex query into smaller, more manageable subqueries. This helps improve query performance by reducing the number of accesses to the database and minimizing the amount of data that needs to be processed.

Multiple choice

What is the term for a unique identifier assigned to each row in a table?

  1. Primary Key

  2. Foreign Key

  3. Candidate Key

  4. Alternate Key

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

A primary key is a unique identifier assigned to each row in a table. It ensures that each row can be uniquely identified and serves as the basis for establishing relationships between tables.

Multiple choice

What is the term for a logical connection between two tables based on a common column or attribute?

  1. Primary Key

  2. Foreign Key

  3. Candidate Key

  4. Alternate Key

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

A foreign key is a logical connection between two tables based on a common column or attribute. It ensures that the data in the child table is related to the data in the parent table, maintaining referential integrity.

Multiple choice

Which normalization form ensures that each attribute in a relation is dependent on the primary key?

  1. First Normal Form (1NF)

  2. Second Normal Form (2NF)

  3. Third Normal Form (3NF)

  4. Boyce-Codd Normal Form (BCNF)

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

2NF requires that all non-key attributes be fully dependent on the primary key, eliminating partial dependencies.

Multiple choice

How do you search a legal research database?

  1. By using keywords

  2. By using Boolean operators

  3. By using both keywords and Boolean operators

  4. None of the above

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

You can search a legal research database by using keywords, Boolean operators, or both.

Multiple choice

What is the purpose of the linalg.inv() function in NumPy?

  1. Matrix Inversion

  2. Matrix Multiplication

  3. Matrix Decomposition

  4. Matrix Transpose

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

The linalg.inv() function in NumPy is used to compute the inverse of a square matrix.

Multiple choice

What is the purpose of a foreign key in a database table?

  1. To uniquely identify each row in the table

  2. To store the most important data in the table

  3. To create a relationship between two tables

  4. To index the data in the table

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

A foreign key is a column or set of columns in a database table that references a primary key in another table.

Multiple choice

What is the significance of data mapping in SaaS integration?

  1. Data mapping ensures data consistency and accuracy during integration.

  2. Data mapping helps transform data formats and structures to match different SaaS applications.

  3. Data mapping enables seamless data exchange between SaaS applications.

  4. All of the above

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

Data mapping plays a crucial role in SaaS integration by ensuring data consistency, transforming data formats, and enabling seamless data exchange between different SaaS applications.

Multiple choice

What is the significance of data transformation in SaaS interoperability?

  1. Data transformation ensures data consistency and accuracy during integration.

  2. Data transformation helps convert data formats and structures to match different SaaS applications.

  3. Data transformation enables seamless data exchange between SaaS applications.

  4. All of the above

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

Data transformation plays a crucial role in SaaS interoperability by ensuring data consistency, converting data formats, and enabling seamless data exchange between different SaaS applications.

Multiple choice

Which of the following is NOT a best practice for preventing SQL injection attacks?

  1. Use parameterized queries

  2. Escape user input before using it in SQL queries

  3. Use a WAF to block malicious traffic

  4. Use a strong password for the database user

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

While using a strong password for the database user is a good security practice, it is not a specific measure for preventing SQL injection attacks.

Multiple choice

What is the key difference between 1NF and 2NF?

  1. 1NF eliminates repeating groups, while 2NF eliminates partial dependencies.

  2. 1NF ensures atomic values in columns, while 2NF eliminates transitive dependencies.

  3. 1NF removes duplicate rows, while 2NF removes duplicate columns.

  4. 1NF establishes primary keys, while 2NF establishes foreign keys.

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

In 1NF, repeating groups are eliminated by creating separate tables for each group. In 2NF, partial dependencies are eliminated by ensuring that each non-key column is fully dependent on the primary key.

Multiple choice

Which normal form ensures that all non-key columns are directly dependent on the primary key?

  1. First Normal Form (1NF)

  2. Second Normal Form (2NF)

  3. Third Normal Form (3NF)

  4. Boyce-Codd Normal Form (BCNF)

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

Second Normal Form (2NF) ensures that all non-key columns are fully dependent on the primary key, meaning that they cannot be derived from any proper subset of the primary key.

Multiple choice

Which normal form ensures that all non-key columns are directly dependent on the primary key and that there are no transitive dependencies?

  1. First Normal Form (1NF)

  2. Second Normal Form (2NF)

  3. Third Normal Form (3NF)

  4. Boyce-Codd Normal Form (BCNF)

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

Boyce-Codd Normal Form (BCNF) ensures that all non-key columns are directly dependent on the primary key and that there are no transitive dependencies. It is the highest level of normalization among the common normal forms.

Multiple choice

Which normalization form ensures that each attribute in a table is dependent on the primary key and not on any other attribute?

  1. First Normal Form (1NF)

  2. Second Normal Form (2NF)

  3. Third Normal Form (3NF)

  4. Boyce-Codd Normal Form (BCNF)

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

Third Normal Form (3NF) is the normalization form that ensures that each attribute in a table is dependent on the primary key and not on any other attribute. This eliminates transitive dependencies and ensures data integrity and consistency.