🇮🇳 GATE CS & IT Engineering · subject

GATE CS & IT Engineering Databases Syllabus

The Databases syllabus for GATE CS & IT Engineering in full: 7 chapters and 13 topics, every one listed below, plus 51 Databases flashcards with answers.

7Chapters
13Topics
51Flashcards

Databases syllabus: all 7 chapters

Expand any chapter to see its topics and sub-topics.

  1. ER-model

    1 topic
    • Concepts of ER-model
  2. Relational model

    3 topics
    • Relational algebra
    • Tuple calculus
    • SQL
  3. Integrity constraints

    1 topic
    • Types of Integrity constraints
  4. Normal forms

    3 topics
    • First Normal Form (1NF)
    • Second Normal Form (2NF)
    • Third Normal Form (3NF)
  5. File organization

    1 topic
    • Types of File organization
  6. Indexing

    2 topics
    • B trees
    • B+ trees
  7. Transactions and concurrency control

    2 topics
    • Concepts of Transactions
    • Concurrency control

GATE CS & IT Engineering Databases flashcards — 51 questions with answers

  1. In the ER model, what is the difference between an entity and an entity set?

    An entity is a real-world object distinguishable from others (e.g., one student). An entity set is a collection of entities of the same type that share the same attributes (e.g., all students).

  2. List the four types of attributes in the ER model.

    1) Simple (atomic) vs Composite (divisible, e.g., Name -> First/Last); 2) Single-valued vs Multi-valued (e.g., phone numbers); 3) Stored vs Derived (e.g., Age derived from DOB); 4) Key attribute (uniquely identifies an entity).

  3. What is a weak entity set and how is it identified in an ER diagram?

    A weak entity set has no key attribute of its own; it depends on an identifying (owner) strong entity through an identifying relationship. It is drawn with a double rectangle, the identifying relationship with a double diamond, and is identified by a partial key plus the owner's key.

  4. What do the four cardinality ratios (1:1, 1:N, N:1, M:N) express in an ER relationship?

    They express the maximum number of relationship instances an entity can participate in: one-to-one, one-to-many, many-to-one, and many-to-many.

  5. Distinguish total participation from partial participation in the ER model.

    Total participation (double line) means every entity in the set must participate in the relationship. Partial participation (single line) means some entities may not participate.

  6. Name the six fundamental (primitive) operators of relational algebra.

    Selection $\sigma$, Projection $\pi$, Union $\cup$, Set difference $-$, Cartesian product $\times$, and Rename $\rho$.

  7. What does the selection operator $\sigma_{C}(R)$ do, and how does it differ from projection $\pi_{L}(R)$?

    Selection $\sigma_{C}(R)$ chooses rows (tuples) of $R$ satisfying condition $C$ (horizontal subset). Projection $\pi_{L}(R)$ chooses columns in list $L$ and removes duplicates (vertical subset).

  8. Define the natural join $R \bowtie S$ in relational algebra.

    $R \bowtie S$ combines tuples of $R$ and $S$ that have equal values on all common attributes, then keeps only one copy of each shared attribute. It equals $\pi(\sigma_{equality\ on\ common\ attrs}(R \times S))$.

  9. Express the division operation $R \div S$ in words.

    $R \div S$ returns the tuples (over the attributes of $R$ not in $S$) that are associated with every tuple in $S$. It is used for queries like "find students who took all courses."

  10. How is a left outer join different from a natural (inner) join?

    An inner join keeps only matching tuples. A left outer join keeps all tuples of the left relation, padding unmatched ones with NULLs for the right relation's attributes.

  11. What is the difference between tuple relational calculus (TRC) and domain relational calculus (DRC)?

    TRC uses variables that range over tuples, written $\{ t \mid P(t) \}$. DRC uses variables that range over individual attribute domain values, written $\{ \langle x_1,\dots,x_n \rangle \mid P(x_1,\dots,x_n) \}$. Both are nonprocedural (declarative).

  12. What does it mean for a relational calculus expression to be "safe"?

    A safe expression guarantees a finite result whose values come only from the active domain (values appearing in the database or query), preventing infinite results such as $\{ t \mid \neg R(t) \}$.

  13. State the form of a tuple relational calculus query and give an example.

    Form: $\{ t \mid P(t) \}$ where $P$ is a formula. Example (students with marks > 80): $\{ t \mid Student(t) \wedge t.marks > 80 \}$.

  14. Which two quantifiers are used in relational calculus and what do they mean?

    The existential quantifier $\exists$ ('there exists') and the universal quantifier $\forall$ ('for all'). They are related by $\forall t\, P(t) \equiv \neg \exists t\, \neg P(t)$.

  15. What is the relationship between relational algebra and relational calculus (Codd's theorem)?

    Codd's theorem states that relational algebra and safe relational calculus (tuple and domain) are equivalent in expressive power; they are all relationally complete.

  16. In SQL, what is the difference between WHERE and HAVING clauses?

    WHERE filters individual rows before grouping and cannot use aggregate functions. HAVING filters groups after GROUP BY and can use aggregate functions like COUNT or SUM.

  17. What is the logical order of evaluation of clauses in an SQL SELECT query?

    FROM -> WHERE -> GROUP BY -> HAVING -> SELECT -> ORDER BY (with DISTINCT and LIMIT applied near the end).

  18. How does SQL handle NULL in comparisons and aggregate functions?

    Comparisons with NULL yield UNKNOWN (three-valued logic), so use IS NULL / IS NOT NULL. Aggregate functions (except COUNT(*)) ignore NULLs; COUNT(*) counts all rows including NULLs.

  19. Distinguish the SQL set operators UNION, INTERSECT, and EXCEPT from UNION ALL.

    UNION, INTERSECT, EXCEPT perform set operations and eliminate duplicate rows. UNION ALL keeps duplicates and does not sort/deduplicate, making it faster.

  20. What is the difference between a correlated and a non-correlated (nested) subquery?

    A non-correlated subquery is evaluated once independently of the outer query. A correlated subquery references columns from the outer query and is re-evaluated for each outer row.

Show the other 31 Databases flashcards
  1. Name the four types of integrity constraints in the relational model.

    1) Domain constraint (attribute values come from a defined domain); 2) Entity integrity (primary key cannot be NULL); 3) Referential integrity (foreign key matches an existing primary key or is NULL); 4) Key constraint (uniqueness of candidate/primary keys).

  2. State the entity integrity constraint.

    No attribute that is part of a primary key may have a NULL value, ensuring every tuple is uniquely identifiable.

  3. State the referential integrity constraint.

    A foreign key value in a referencing relation must either match some primary key value in the referenced relation or be entirely NULL; it cannot reference a non-existent tuple.

  4. What are the referential triggered actions ON DELETE / ON UPDATE in SQL?

    CASCADE (propagate the delete/update), SET NULL (set foreign key to NULL), SET DEFAULT (set to a default value), and NO ACTION / RESTRICT (reject the operation if it violates integrity).

  5. Differentiate a candidate key, primary key, and super key.

    A super key is any attribute set that uniquely identifies tuples. A candidate key is a minimal super key (no proper subset is a super key). A primary key is one candidate key chosen as the main identifier; remaining candidate keys are alternate keys.

  6. What is a prime attribute versus a non-prime attribute?

    A prime attribute is part of at least one candidate key. A non-prime attribute is not part of any candidate key.

  7. Define a functional dependency $X \to Y$.

    $X \to Y$ holds if any two tuples that agree on attribute set $X$ must also agree on attribute set $Y$; that is, $X$ functionally determines $Y$.

  8. State Armstrong's three axioms for functional dependencies.

    Reflexivity: if $Y \subseteq X$ then $X \to Y$. Augmentation: if $X \to Y$ then $XZ \to YZ$. Transitivity: if $X \to Y$ and $Y \to Z$ then $X \to Z$.

  9. What condition must a relation satisfy to be in First Normal Form (1NF)?

    Every attribute must contain only atomic (indivisible) single values; no multi-valued attributes, composite attributes, or nested/repeating groups are allowed.

  10. What is the requirement for Second Normal Form (2NF)?

    The relation must be in 1NF and have no partial dependency, i.e., no non-prime attribute may depend on a proper subset of any candidate key. Every non-prime attribute must be fully functionally dependent on the whole candidate key.

  11. What is the requirement for Third Normal Form (3NF)?

    The relation must be in 2NF and have no transitive dependency of non-prime attributes on candidate keys. For every FD $X \to Y$, either $X$ is a super key or $Y$ is a prime attribute.

  12. How does BCNF differ from 3NF?

    BCNF is stricter: for every non-trivial FD $X \to Y$, $X$ must be a super key (no prime-attribute exception). Every BCNF relation is in 3NF, but not vice versa. 3NF is always dependency-preserving and lossless; BCNF may not be dependency-preserving.

  13. What is a partial functional dependency? Give an example.

    A partial dependency occurs when a non-prime attribute depends on only part of a composite candidate key. Example: in $R(StudentID, CourseID, StudentName)$ with key $\{StudentID, CourseID\}$, $StudentID \to StudentName$ is partial. It violates 2NF.

  14. What is a transitive functional dependency? Give an example.

    A transitive dependency exists when $X \to Y$ and $Y \to Z$ with $Y$ not a candidate key, so $X \to Z$ indirectly. Example: $RollNo \to DeptID$ and $DeptID \to DeptName$ gives $RollNo \to DeptName$. It violates 3NF.

  15. What two properties should a good relational decomposition satisfy?

    1) Lossless-join (non-additive): the natural join of decomposed relations reconstructs exactly the original relation. 2) Dependency preservation: the union of FDs on the sub-relations implies all original FDs.

  16. Compare heap (unordered) and sequential (ordered) file organization.

    Heap file: records placed in insertion order; insertion is fast (O(1) append) but searching is linear O(n). Sequential file: records stored sorted on a key; supports binary search O(log n) and efficient range queries, but insertion/deletion is costly due to reordering.

  17. What is hashing (hash) file organization and its main drawback?

    Records are placed in buckets determined by a hash function on the key, giving near O(1) equality-search access. Drawbacks: poor performance for range queries and the need to handle bucket overflow (via chaining or rehashing).

  18. Differentiate a primary (clustered) index from a secondary (non-clustered) index.

    A clustered/primary index is built on the ordering key field, so the physical order of records matches the index; only one per table. A secondary index is on a non-ordering field, is dense, and does not match physical order; many are allowed.

  19. What is the difference between a dense and a sparse index?

    A dense index has one index entry for every search-key value (every record). A sparse index has entries for only some keys (typically one per data block); sparse indexes require ordered files.

  20. What is a B-tree of order $m$?

    A balanced multiway search tree where every node has at most $m$ children and at least $\lceil m/2 \rceil$ children (root at least 2). Keys and their data pointers are stored in both internal and leaf nodes, and all leaves are at the same level.

  21. In a B-tree of order $m$, how many keys can a node hold and what is the minimum for a non-root node?

    A node holds at most $m-1$ keys and at least $\lceil m/2 \rceil - 1$ keys (the root may have as few as 1 key).

  22. What are the key structural differences between a B-tree and a B+ tree?

    In a B+ tree, all actual data record pointers are stored only in leaf nodes; internal nodes hold only keys for routing (keys may be duplicated). Leaves are linked in a sorted linked list. In a B-tree, data pointers exist in all nodes and there is no leaf linkage.

  23. Why are B+ trees preferred over B-trees for database indexing?

    Internal nodes store only keys (no data), so they have a higher fan-out and shorter height, fewer disk I/Os. The linked leaf list makes sequential and range queries efficient, and every search traverses to a leaf giving uniform access cost.

  24. In a B+ tree of order $p$ for internal nodes, how many tree pointers and keys does an internal node hold?

    An internal node holds at most $p$ tree pointers and $p-1$ keys, with a minimum of $\lceil p/2 \rceil$ tree pointers (so $\lceil p/2 \rceil - 1$ keys); the root needs at least 2 pointers.

  25. Define a database transaction and name its four ACID properties.

    A transaction is a logical unit of work containing one or more operations executed as a single indivisible action. ACID: Atomicity (all or nothing), Consistency (preserves integrity constraints), Isolation (concurrent transactions don't interfere), Durability (committed changes persist).

  26. Draw out the states in a transaction's state diagram.

    Active -> Partially Committed (after final operation) -> Committed (changes made permanent), or Active/Partially Committed -> Failed -> Aborted (rolled back). From Aborted it may restart or be killed.

  27. When is a schedule conflict-serializable, and how is it tested?

    A schedule is conflict-serializable if it can be transformed into a serial schedule by swapping non-conflicting (non-conflicting = different transactions, not both on same data item with at least one write) adjacent operations. It is tested by checking that the precedence (serialization) graph is acyclic.

  28. List the three types of problems that arise from uncontrolled concurrent execution.

    1) Lost update (write-write); 2) Dirty read / temporary update (reading uncommitted data, read of a write later rolled back); 3) Unrepeatable read and the incorrect summary / phantom problem.

  29. What is Two-Phase Locking (2PL) and what does it guarantee?

    2PL is a protocol where every transaction acquires all locks in a growing phase and releases locks only in a shrinking phase (no lock acquired after the first release). It guarantees conflict-serializability. Strict 2PL holds all exclusive locks until commit/abort, also ensuring recoverability and cascade-free schedules.

  30. How does timestamp-ordering concurrency control decide whether to allow an operation?

    Each transaction gets a unique timestamp $TS(T)$; each data item keeps read and write timestamps. An operation that would violate timestamp order (e.g., a write whose effect is already overwritten or read by a younger transaction) is rejected and the transaction is rolled back, ensuring serializability by timestamp order.

  31. Differentiate recoverable, cascadeless, and strict schedules.

    Recoverable: a transaction commits only after all transactions whose data it read have committed. Cascadeless (avoids cascading rollback): transactions read only committed data. Strict: no transaction reads or writes a data item until the transaction that last wrote it commits/aborts. Relationship: Strict $\subseteq$ Cascadeless $\subseteq$ Recoverable.

GATE CS & IT Engineering Databases FAQ

What is in the GATE CS & IT Engineering Databases syllabus?

GATE CS & IT Engineering Databases is split into 7 chapters: ER-model, Relational model, Integrity constraints, Normal forms, File organization, Indexing and Transactions and concurrency control. Together they contain 13 topics.

How many chapters are in GATE CS & IT Engineering Databases?

7 chapters, containing 13 topics. The largest chapter is Relational model, with 3 topics.

Are there flashcards for GATE CS & IT Engineering Databases?

Yes — a 51-card Databases deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.