Unit3 - Subjective Questions

INT306 • Practice Questions with Detailed Answers

1

Explain the five basic aggregate functions in SQL. How does the GROUP BY clause affect their behavior?

2

Distinguish between the WHERE and HAVING clauses in SQL with respect to aggregate functions. Provide a brief example.

3

Describe the different types of Outer Joins in SQL. Explain with syntax and conceptually how they handle non-matching rows.

4

Differentiate between INNER JOIN, NATURAL JOIN, and CROSS JOIN.

5

Explain the set operators UNION, INTERSECT, and EXCEPT in SQL. What are the conditions for two tables to be union-compatible?

6

What is the difference between UNION and UNION ALL? Explain why UNION ALL is generally faster.

7

Define a View in SQL. What are the main advantages of using views in a database system?

8

What is an updatable view? Explain the rules and conditions under which a view can be updated.

9

Distinguish between a correlated and an uncorrelated subquery with examples.

10

How can subqueries be used in the FROM clause? Explain with a query example.

11

Explain the Selection () and Projection () operations in Relational Algebra with examples.

12

Describe the Cartesian Product () and Natural Join () operations in Relational Algebra. How does Natural Join differ from Theta Join ()?

13

Let and be two relations. Explain the set difference () and division () operations in relational algebra.

14

What are Window Functions in SQL? How do they differ from standard aggregate functions? Explain the OVER() clause.

15

Compare ROW_NUMBER(), RANK(), and DENSE_RANK() window functions. Provide a scenario where each would be used.

16

Differentiate between Static Hashing and Dynamic Hashing. Explain the mechanism of Extendible Hashing.

17

What is the purpose of indexing in databases? Differentiate between Clustered and Non-Clustered Indexes.

18

Explain the structure and advantages of a B+ Tree index in Database Management Systems.

19

Describe the steps involved in query processing and optimization.

20

Explain heuristic-based query optimization. Discuss equivalence rules in relational algebra used for optimization.