1

Consider a database name "db_name" whose attributes are intern_id (primary key), subject, subject_value. Intern_id = {1, 2, 3, 4, 5, 6} Subject = {sql, oop, sql, oop, c, c++} Subject_value = {0, 0, 1, 1, 2, 2, 3, 3} 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 IN (SELECT subject FROM db_name WHERE subject_value IN (3, 2));

Correct Answer: {1, 2, 3, 4, 5, 6}

Make the most of this question

This page focuses on one MySQL MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

MySQL MCQs MCQ: Consider a database name "db_name" whose attributes are intern_id (primary key), subject, subject_value. Intern_id = {1, 2, 3, 4, 5, 6} Subject = {sql, oop, sql, oop, c, c++} Subject_value = {0, 0, 1, 1, 2, 2, 3, 3} 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 IN (SELECT subject FROM db_name WHERE subject_value IN (3, 2)); | Extra Education