Skip to main content

Posts

Showing posts with the label SQL

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 ...