The `UNION` operator in SQL combines the results of multiple `SELECT` statements and automatically eliminates duplicate rows.
SELECT Name FROM Employees WHERE Department = 'IT' UNION SELECT Name FROM FormerEmployees WHERE ExitReason = 'Resigned'; In the above SQL query, which of the following statement is true about its result? - Question not attempted
Asked in Analyst Cum Programmer (Deputy Director) 2024 · Topic: Basics of Computers and Information Technology (Database Management Systems (DBMS) Basics: Concepts, Types of Databases)
Show answer
Answer: D. The result includes unique names from both queries, removing duplicates automatically.
Read the notes: Basics of Computers and Information Technology →
More Information and Communication Technology questions
- Consider the following Assertion (A) and the Reason (R) - Assertion (A) : "In object-oriented databases, persistent objects can survive after program termination and can be retrieved in future sessions". Reason (R) : Persistent objects are stored in volatile memory for faster access and cease to exist when program ends. Which of the following is correct?
- Which property ensures that a transaction is either fully executed or not performed at all? - Question not attempted
- In ER diagrams, a 'weak entity' is characterized by which of the following? - Question not attempted
- What is the primary goal of BCNF in database normalization? - Question not attempted
- Which SQL query retrieves all employees whose address contains the substring ‘AJMER’ from EMPLOYEE table? - SELECT * FROM EMPLOYEE WHERE Address = ‘AJMER’; - SELECT * FROM EMPLOYEE WHERE Address LIKE ‘%AJMER’; - SELECT * FROM EMPLOYEE LIKE Address = ‘AJMER’; - SE‐ LECT * FROM EMPLOYEE WHERE Address LIKE ‘AJMER’;
- Suppose we have two relations: R(A, B, C) and S(B, C, D). Consider the natural join operation: R ⋈ S Which of the following could be the resulting schema of this operation?
- Which relational algebra expression selects all employees from the emp table whose salary is greater than 40000 and who work in the Delhi location?
- What is the primary purpose of the embedded SQL?
All 1,360 Information and Communication Technology questions →