πŸ“Š MySQL
Q. 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));
  • (A) {5, 6}
  • (B) {1, 2, 3}
  • (C) {3, 4}
  • (D) {1, 2, 3, 4, 5, 6}
πŸ’¬ Discuss
βœ… Correct Answer: (D) {1, 2, 3, 4, 5, 6}

Explanation: This question is about understanding how to use SQL queries to retrieve data from a database. Let's break down the code step by step:

Explanation by: Ram Avtar Sharma
This question is about understanding how to use SQL queries to retrieve data from a database. Let's break down the code step by step:

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
133
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Ram Avtar Sharma
Publisher
πŸ“ˆ
83%
Success Rate