Gate 2005

Duration: 5 min

This video lesson is available to enrolled students.

Return to /learn/GATE-GUIDANCE-BY-SANCHIT-SIR/database-management-systemdbms/sql/nested-correlated-subqueries/asset-gate-2005-3439 after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Discrete Mathematics: Set Theory, Relations, Functions, Graph Theory, Group Theory, Propositional and Predicate Logic
  2. DataBase Management System/DBMS: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, File Organization & Indexing, Relational Algebra, SQL, Relational Calculus, Transaction Management, Concurrency Control
  3. Digital Electronics: Digital Systems & Boolean Basics, Logic Gates & Hardware, Boolean Expression, Boolean Minimization, Combinational Circuit, Sequential Circuits, Number System, Number Representation
  4. Computer Architecture: Floating Point Rep, Cache Memory Organization, Input Output Organisation, Pipelining, Instr Formats & Modes, Control Unit Design
  5. Operating System: Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Threads & Process Creation, Deadlock, Memory Management, Virtual Memory, Disc Scheduling, File Management
  6. C Language: C Fundamentals, Control Flow, Functions, Arrays & Pointers, Storage Classes, Structures & Enums, DMA, Macros, Scoping & File Handling
  7. Data Structures: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
  8. Algorithms: Algorithm Analysis, Time Complexity Analysis, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos
  9. Computer Networks: Introduction to CN, DLL: Access Control, DLL: Flow Control, DLL: Error Control, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware Basics
  10. Theory Of Computation/Automata Theory: Introduction to TOC, Deterministic FA (DFA), Non-Deterministic FA, Regular Expressions, Grammar, Regular Language Properties, Moore & Mealy Machines, Pushdown Automata & CFG, Turing Machines, Complexity Theory
  11. Compiler Design: Intro to Compilers, Lexical Analysis, Grammar & CFG, Syntax Analysis: Top-Down, Syntax Analysis: Bottom-Up, Semantic Analysis & SDT, Intermediate Code Gen, Code Optimization, Run Time Environment
  12. Engineering Mathematics: Permutation and Combination, Linear Algebra, Calculus, Probability, Statistics, Signal Space and Optimum Detection, Probability, Statistics, Combinatorics
  13. General Aptitude: Ratio and Proportion (Ratios), Data Interpretation, Logarithm, Number System, HCF LCM, Sequence and Series (Series), Speed Time and Distance, Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Percentage, Mensuration and Geometry, Mental Ability, Arithmetic, Profit and Loss, Powers and Exponents (Surds and Indices), Average, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Syllogisms, Venn Diagram, Seating Arrangements, Blood Relations, Directions (Direction Test), Analogy, Algebra, Analytical Reasoning (Counting Figures Reasoning), Puzzle Solving (Puzzles), Cubes & Dices, Ranking, Order and Sequence, Mixture and Alligation, Age Problems, Clock, Selection Decision Table (Decision Making), Data Arrangement, Ratio and Proportion, Vocabulary, Averages, Mixtures and Alligation, Percentages, Subject-Verb Agreement, Sentence Completion, Geometry, Reading Comprehension, Statistics, Three-Dimensional Patterns and Visualization, Permutations and Combinations, Trigonometry, Simplification and Approximation, Constraint Puzzles, Numerical Reasoning, Series Completion, Analogy and Classification, Patterns in Two-Dimensional Figures, Coding and Decoding, Mathematical Operations, Direction Sense, Assembling and Grouping of Shapes, Cubes and Dice, Profit, Loss and Discount, Mensuration, Probability, Measurement and Quantity Take-Off, Sentence Structure and Correction, Critical Reasoning, Syllogisms and Venn Diagrams, Order, Ranking and Sequence, Logical Deduction and Induction, Narrative Sequencing, Project Monitoring, Resources and Safety, Traverse Surveying, Clocks and Calendars, Time and Work, Algebra, Data Interpretation, Speed, Time and Distance, Data Sufficiency, Blood Relations, Simple Interest and Compound Interest, Calendar, Alphabet and Word Tests, Sequences and Series, Powers, Surds and Logarithms, Number System, Transformation of Shapes
  14. English (Verbal Aptitude): Vocabulary, Noun, Subject Verb Agreement (Verb Noun Agreement), Adjectives, Tenses, Pronoun, Preposition, Direct and Indirect Speech, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Sentence Correction (Error Correction), Verbal Analogy (Word Based Analogy), Conjunction, Verb, Articles, Adverb, Modals, Prepositions and Conjunctions, Idioms and Phrases, Verb Forms and Verb Patterns, Sentence Basics, Nouns and Pronouns, Articles and Determiners, Adjectives and Adverbs, Modals, Conditionals and Subjunctive, Voice and Reported Speech, Blood Relations, Tenses, Vocabulary
  15. Live Classes Recordings(Earlier Batch): GATE 2026 Live Class
  16. Full Mock Test:
  17. Previous Year Papers:
  18. GATE 2026 Counselling: Counselling and Guidance Sessions
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

The video presents a detailed analysis of a SQL query problem from the GATE 2005 exam. The problem involves a relation named `book` with attributes `title` and `price`. The core of the lesson is interpreting a nested SQL query that selects titles based on a condition involving a subquery. The instructor explains that the subquery counts the number of books in the relation that have a price strictly greater than the price of the book currently being processed in the outer query. To make this concept clear, he draws two tables representing the outer alias `B` and the inner alias `T`. He populates these tables with a sequence of prices (10, 20, 30, 40, 50, 60, 70) to simulate the database state. This visual aid helps in tracing the execution of the query for each row.

Chapters

  1. 0:00 – 2:00 00:00-02:00

    The instructor begins by displaying the problem statement and the SQL code on the screen. He reads the query aloud, highlighting the outer query `select title from book as B` and the correlated subquery. He explains that for every row in the outer table `B`, the subquery runs to count rows in table `T` where `T.price > B.price`. To illustrate this, he draws two vertical tables on the whiteboard. He labels them `B` and `T` and starts writing down sample price values like 10, 20, 30, 40, 50, 60, and 70 in both tables. This setup is intended to create a concrete scenario to test the logic of the query.

  2. 2:00 – 4:38 02:00-04:38

    With the tables drawn, the instructor proceeds to calculate the count for each price in the outer table. He explains that for the book with price 70, there are zero books with a higher price, so the count is 0. For price 60, the count is 1 (only 70 is higher). He continues this pattern, showing that for prices 50, 40, and 30, the counts are 2, 3, and 4 respectively. Since the condition is `count < 5`, all these books satisfy the condition. He notes that for price 20, the count is 5, which fails the condition. Thus, the query returns the titles of the books with prices 70, 60, 50, 40, and 30. He identifies this set as the five most expensive books and selects option (D) as the correct answer, eliminating options suggesting four books or the fifth most inexpensive book.

The lecture demonstrates a powerful technique for understanding correlated subqueries: using a small, ordered dataset to trace execution. By manually calculating the count of more expensive books for each price point, the instructor proves that the query filters for the top 5 most expensive items. This step-by-step breakdown transforms an abstract SQL statement into a logical ranking problem, making it easier for students to grasp how the `count(*)` function interacts with the `where` clause in a nested context.

Loading lesson…