
UGC NET Computer Science Unit 8 is based on Database Management Systems (DBMS), one of the most scoring and concept-heavy areas of the syllabus. It deals with how data is structured, stored, retrieved, and managed efficiently using relational models and database techniques.
Since questions are often conceptual as well as query-based, solving UGC NET Computer Science Unit 8 PYQs is extremely important. PYQs help candidates understand how topics like normalization, SQL, and transaction management are tested in the actual exam and highlight the most frequently asked concepts.
UGC NET Computer Science Unit 8 Previous Year Questions (PYQs) primarily revolve around Database Management System concepts. This unit is particularly important because it combines conceptual clarity with direct application-based questions, making PYQ practice essential for scoring well.
A. Type Checking
B. Code Generation
C. Code Optimisation
D. Error Handling
Choose the correct answer from the options given below:
A) A, B, C Only
B) B, C, D Only
C) A, C, D Only
D) A, B, D Only
Answer: A) A, B, C Only
Explanation: Syntax Trees (especially Abstract Syntax Trees - ASTs) are widely used in compiler design for:
Type Checking (A): Semantic analysis uses syntax trees to verify type correctness.
Code Generation (B): Target code can be generated by traversing the syntax tree.
Code Optimization (C): Optimizations such as constant folding, dead code elimination, and expression simplification are often performed on syntax trees.
Error Handling (D) is primarily associated with lexical, syntax, and semantic analysis phases rather than being a direct task attained using syntax trees.
A. Lexical Analysis
B. Semantic Analysis
C. Syntax Analysis
D. Intermediate Code Generation
E. Code Optimization
Choose the correct answer from the options given below:
A) A, B, C, D, E
B) A, C, B, D, E
C) A, D, B, C, E
D) A, C, D, B, E
Answer: B) A, C, B, D, E
Explanation:
The standard compilation phases occur in the following order:
Lexical Analysis (A)
Converts source code into tokens.
Syntax Analysis (C)
Builds parse tree / syntax tree according to grammar rules.
Semantic Analysis (B)
Performs type checking, scope checking, and other semantic validations.
Intermediate Code Generation (D)
Produces an intermediate representation (IR).
Code Optimization (E)
Improves the intermediate code for efficiency.
Thus, the correct sequence is: A → C → B → D → E
A. Type Checking
B. Code Generation
C. Code Optimization
D. Error Handling
Choose the correct answer from the options given below:
A. A, B, C Only
B. B, C, D Only
C. A, C, D Only
D. A, B, D Only
Answer: A. A, B, C Only
Explanation: Syntax Trees (or Abstract Syntax Trees - ASTs) are widely used in compiler design for:
Type Checking during semantic analysis.
Code Generation by translating tree structures into target code.
Code Optimization by simplifying expressions and improving efficiency.
Error handling is generally performed during lexical, syntax, and semantic analysis phases rather than being a direct function of syntax trees.
A. Left recursion
B. Left factoring
C. Ambiguity
D. Associativity and Precedence
Answer: D. Associativity and Precedence
Explanation:
A Shift-Reduce Conflict occurs when a parser cannot decide whether to shift the next input symbol or reduce the current symbols on the stack. Such conflicts are commonly resolved using:
Operator Precedence
Operator Associativity (left-to-right or right-to-left)
| List-I | List-II | |
| A. A → aB | a, a ∈ T, A, B ∈ V | I. Recursive Descent Parser | |
| B. A → BC | a, a ∈ T, A, B, C ∈ V | II. Turing Machine | |
| C. LL (1) grammar | III. Chomsky Normal Form | |
| D. Halting problem | IV. Finite Automata |
Choose the correct answer from the options given below:
A. A–IV, B–III, C–I, D–II
B. A–III, B–I, C–II, D–IV
C. A–II, B–IV, C–III, D–I
D. A–IV, B–III, C–II, D–I
Answer: A. A–IV, B–III, C–I, D–II
Explanation:
A → aB | a represents a Right Linear Grammar, equivalent to Finite Automata (IV).
A → BC | a is the form used in Chomsky Normal Form (III).
LL(1) Grammar is parsed using a Recursive Descent Parser (I).
The Halting Problem is associated with Turing Machines (II).
A. Type conversion
B. Tokenization
C. Loop optimization
D. Data flow Analysis
Answer: A. Type conversion
Explanation: The Semantic Analysis phase checks the meaning of the program, including Type checking, Type conversion/coercion, Scope resolution, and Declaration checking.
Other options belong to different phases:
Tokenization → Lexical Analysis
Loop Optimization → Code Optimization
Data Flow Analysis → Optimization phase
A. make parsing and semantic analysis simpler
B. improve error recovery and error reporting
C. increase the chances of reusing the machine independent optimizer in other compilers
D. improve the register allocation
Answer: C. increase the chances of reusing the machine independent optimizer in other compilers
Explanation: Intermediate Code Representation (IR) provides a machine-independent form of the source program. Its advantages include:
Portability across different target machines.
Reusability of machine-independent optimizers.
Separation of front-end and back-end compiler phases.
A. Quadruples
B. Triples
C. Patterns
D. Indirect Triples
Choose the correct answer from the options given below:
A) A and B Only
B) A, B and D Only
C) B and C Only
D) B, C and D Only
Answer: B) A, B and D Only
Explanation: Three address codes can be represented using Quadruples, Triples, and Indirect Triples — these are the three standard data structures used in compiler design for intermediate code representation. "Patterns" is not a valid representation structure for three address codes.