A

Admin • 828.03K Points
Coach

Q. Consider a database name "db_name" whose attributes are intern_id (primary key), subject.
Intern_id = {1, 2, 3, 4, 5, 6}
Subject = {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following MySQL statement?
SELECT intern_id
FROM db_name
WHERE subject NOT IN (c, c++, oop);

  • (A) {5, 6}
  • (B) {1, 2, 3}
  • (C) {3, 4}
  • (D) {1, 4}
  • Correct Answer - Option(D)
  • Views: 11
  • Filed under category MySQL
  • Hashtags:

Explanation by: Admin
This question is about understanding how to use the "NOT IN" operator in MySQL to filter data. Let's break down what's happening:

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.