Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose you have two tables in a university database system: enrolled _ students which contains the IDs of all currently enrolled students, and graduated _
Suppose you have two tables in a university database system: enrolledstudents which contains the IDs of all currently enrolled students, and graduatedstudents which contains the IDs of all students who have graduated. You want to create a list of all unique student IDs, whether they are currently enrolled or have already graduated.
Which of the following SQL queries correctly combines the student IDs from both tables without any duplicates?
Group of answer choices
SELECT studentid FROM enrolledstudents UNION SELECT studentid FROM graduatedstudents;
SELECT studentid FROM enrolledstudents UNION ALL SELECT studentid FROM graduatedstudents;
SELECT studentid FROM enrolledstudents INTERSECT SELECT studentid FROM graduatedstudents;
SELECT studentid FROM enrolledstudents EXCEPT SELECT studentid FROM graduatedstudents;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started