Skip to main content

Posts

MySQL MCQs ( Table and Join Operations ) PART 3

Most asked MySQL MCQs focused on Table and Join Operations Output for UGC NET, SET, EMRS, KVS, ISRO, and Assistant Professor exams. 21. Given the following tables, what will be the output of an INNER JOIN? Customers Table CustomerID Name City 1 Alice Delhi 2 Bob Mumbai 3 Charlie Kolkata Orders Table OrderID CustomerID Product 101 1 Laptop 102 2 Mobile 103 4 Tablet Query: SELECT Customers.Name, Orders.Product FROM Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID; A) Returns all customers with their respective orders B) Returns customers who have placed orders C) Returns all customers, even if they don’t have an order D) Returns all orders, even if they don’t have a customer Answer: B) Returns customers who have placed orders (Output: Alice - Laptop, Bob - Mobile) 22. What will a LEFT JOIN return when there is no matching row in the right table? A) NULL values for the right table columns B) E...

MySQL MCQs Part 2

 Here are 10 more MySQL MCQs for UGC NET, SET, EMRS, KVS, ISRO, and Assistant Professor exams. 11. What is the purpose of the HAVING clause in MySQL? A) It filters records before grouping B) It filters records after grouping C) It is used to rename columns D) It is used to join tables Answer: B) It filters records after grouping 12. Which MySQL function is used to count the number of rows in a table? A) COUNT() B) SUM() C) TOTAL() D) NUMBER() Answer: A) COUNT() 13. What does the FOREIGN KEY constraint do in MySQL? A) Ensures unique values in a column B) Links a column to a primary key in another table C) Automatically increments a column value D) Restricts NULL values in a column Answer: B) Links a column to a primary key in another table 14. Which command is used to create a backup of a MySQL database? A) BACKUP DATABASE B) SAVE DATABASE C) mysqldump D) EXPORT DATABASE Answer: C) mysqldump 15. Which MySQL JOIN returns only matching rows from bot...

MySQL MCQs PART 1

Top MySQL MCQs for UGC NET, SET, EMRS, KVS, ISRO, and Assistant Professor and other competitive exams... 1. Which of the following is true about MySQL? A) MySQL is an open-source database management system B) MySQL is a NoSQL database C) MySQL does not support relational database features D) MySQL is a proprietary database Answer: A) MySQL is an open-source database management system 2. What is the default storage engine used by MySQL as of version 5.5? A) MyISAM B) InnoDB C) HEAP D) CSV Answer: B) InnoDB 3. Which command is used to view all databases in MySQL? A) SHOW DATABASES; B) DISPLAY DATABASES; C) LIST DATABASES; D) VIEW DATABASES; Answer: A) SHOW DATABASES; 4. Which data type is used to store large text data in MySQL? A) VARCHAR B) TEXT C) INT D) BLOB Answer: B) TEXT 5. What is the function of the AUTO_INCREMENT attribute in MySQL? A) Automatically increases a column value when a new row is inserted B) Decreases the column value after every ...

10 MCQs related to Code Optimization

10 Multiple Choice Questions (MCQs) related to  Code Optimization , useful for UGC NET, SET, and GATE exams: 1. What is the main purpose of code optimization in a compiler? A) Convert source code to machine code B) Improve the execution speed and reduce resource usage C) Detect syntax errors D) Allocate memory for variables Explanation: Code optimization aims to enhance the performance of the compiled code by reducing execution time, memory usage, and power consumption . Answer: B) Improve the execution speed and reduce resource usage 2. Which of the following is NOT a type of code optimization? A) Peephole Optimization B) Loop Optimization C) Syntax Checking D) Constant Folding Explanation: Syntax Checking is part of syntax analysis , not code optimization. Answer: C) Syntax Checking 3. Which of the following is an example of local optimization? A) Loop Unrolling B) Constant Folding C) Register Allocation D) Dead Code Elimination Explanat...

10 Multiple Choice Questions (MCQs) related to Intermediate Code Generation

10 Multiple Choice Questions (MCQs) related to  Intermediate Code Generation , useful for UGC NET, SET, and GATE exams: 1. What is the main purpose of intermediate code generation in a compiler? A) Convert high-level code to machine code B) Generate an intermediate representation for optimization and portability C) Detect syntax errors D) Allocate memory for variables Explanation: Intermediate code generation creates an intermediate representation (IR) that is machine-independent , allowing for optimization and easier translation to machine code. Answer: B) Generate an intermediate representation for optimization and portability 2. Which of the following is NOT an intermediate representation format? A) Abstract Syntax Tree (AST) B) Three-Address Code (TAC) C) Postfix Notation D) Machine Code Explanation: Machine code is the final output of compilation, not an intermediate representation . Answer: D) Machine Code 3. Which of the following is a charac...

10 MCQs related to Semantic Analysis

10 Multiple Choice Questions (MCQs) related to  Semantic Analysis , useful for UGC NET, SET, and GATE exams: 1. What is the primary function of semantic analysis in a compiler? A) Checking syntax errors B) Checking logical errors C) Checking type mismatches and undefined variables D) Optimizing the code Explanation: Semantic analysis ensures that the program is meaningfully correct by checking type mismatches, undeclared variables, and function usage . Answer: C) Checking type mismatches and undefined variables 2. Which of the following errors is detected during semantic analysis? A) Missing semicolons B) Type mismatches C) Unrecognized tokens D) Invalid operator precedence Explanation: Semantic analysis checks for type mismatches, undeclared variables, and incompatible function calls . Answer: B) Type mismatches 3. What is the primary data structure used in semantic analysis? A) Parse Tree B) Symbol Table C) Stack D) Linked List Explanatio...

10 MCQs related to Syntax Analysis

10 Multiple Choice Questions (MCQs)  related to   Syntax Analysis , useful for UGC NET, SET, and GATE exams: 1. What is the primary function of syntax analysis in a compiler? A) Checking token validity B) Checking grammatical structure C) Optimizing code D) Allocating memory Explanation: Syntax Analysis (Parsing) ensures that the sequence of tokens follows the grammar of the programming language. Answer: B) Checking grammatical structure 2. Which data structure is commonly used in syntax analysis? A) Queue B) Stack C) Linked List D) Hash Table Explanation: Parsers use a stack to keep track of grammar rules and parsing states . Answer: B) Stack 3. Which type of grammar is used for syntax analysis? A) Regular Grammar B) Context-Free Grammar C) Context-Sensitive Grammar D) Unrestricted Grammar Explanation: Context-Free Grammar (CFG) is used in syntax analysis to define language structure . Answer: B) Context-Free Grammar 4. W...