Which SQL operator returns only the rows that are common and present in the outputs of both executing SELECT queries? MCQ with Answer and Explanation

Which SQL operator returns only the rows that are common and present in the outputs of both executing SELECT queries?
A. INTERSECT
B. UNION
C. EXCEPT / MINUS
D. JOIN
Answer: Option A
Solution (By JKSSB Mock Tests)
The INTERSECT operator returns only the distinct rows that appear in the result sets of both SELECT statements.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1
What is the main advantage of using a DBMS?
A. Reduced application development time
B. Data sharing and concurrency control
C. All of the above
D. Data integrity and security

Correct Answer: Option C


Explanation:
DBMS provides numerous benefits including data sharing, concurrency control, integrity, security, and reduces development time.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What type of join returns all rows from the right table, paired with matching records from the left table, or filling in NULL values if no match is found?
A. Left Outer Join
B. Right Outer Join
C. Full Join
D. Inner Join

Correct Answer: Option B


Explanation:
A Right Outer Join retains all rows from the right table, pairing them with matching left table entries or supplying NULL values if matches do not exist.

This question belongs to: Computer Database Management System (DBMS)
Question #3
Which of the following is a valid SQL statement to add a primary key to an existing table?
A. ADD PRIMARY KEY ON table_name (column_name);
B. ALTER TABLE table_name ADD PRIMARY KEY (column_name);
C. Both A and C
D. ALTER TABLE table_name ADD CONSTRAINT pk_name PRIMARY KEY (column_name);

Correct Answer: Option C


Explanation:
Both syntaxes are valid: ADD PRIMARY KEY (column) and ADD CONSTRAINT ... PRIMARY KEY (column).

This question belongs to: Computer Database Management System (DBMS)