Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:09:32+00:00 2026-06-13T08:09:32+00:00

I’m currently working on the following homework: CREATE TABLE T_1 (COURSE_NO CHAR(8) PRIMARY KEY,

  • 0

I’m currently working on the following homework:

CREATE TABLE T_1
(COURSE_NO CHAR(8) PRIMARY KEY,
COURSE_NAME CHAR(50) );

CREATE TABLE T_2
(COURSE_NO CHAR(8),
COURSE_NAME CHAR(50) );

CREATE TABLE T_3
(COURSE_NO CHAR(8),
STUDENT_ID CHAR(15),
GRADE CHAR (2));

INSERT INTO T_1
VALUES
('CS100','Data Structures'),
('CS200','Object Oriented Programming'),
('CS300','Distributed Systems'),
('EE100','Circuit Analysis'),
('EE200','VLSI Design'),
('EE300','Packet Switching Networks');

INSERT INTO T_2
VALUES
('EE100','Circuit Analysis'),
('EE200','VLSI Design'),
('EE300','Packet Switching Networks'),
('MA100','Calculus'),
('MA200','Advanced Calculus'),
('MA300','Number Theory');

INSERT INTO T_3
VALUES
('CS100','150-70-5879','B'),
('CS100','280-90-8766','A'),
('EE100','430-76-6858','B'),
('CS200','720-60-5000','B');

I’m requested to specify the tuples given: (T1 – T2) union (T2 – T1) Union (T1 intersect T2).

Now I know that MySQL uses the, either join for the minus operator, I’m able to process each minus in their own way like:

SELECT *
FROM T_1
LEFT JOIN T_2
ON T_1.Course_No = T_2.Course_no
WHERE T_2.Course_no IS NULL;

I can also do this for the T2 – T1 but I’m lost when it comes to doing it all in 1 query or how to (T1-T2) U (T2-T1) or (T2-T1) U (T1nT2).

Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:09:33+00:00Added an answer on June 13, 2026 at 8:09 am

    Not best, but very intuitive way:

    q1 = (T1 - T2): (SELECT course_no FROM T_1
                     WHERE course_no NOT IN (SELECT course_no FROM T_2))
    q2 = (T2 - T1): same way, change T_1 and T_2
    q3 = (T1 intersect T2): (SELECT course_no FROM T_1
                             WHERE course_no IN (SELECT course_no FROM T_2))
    
    answer = q1 union q2 union q3
    

    We get following sql-query:

    (SELECT course_no FROM T_1 WHERE course_no NOT IN (SELECT course_no FROM T_2))
    UNION
    (SELECT course_no FROM T_2 WHERE course_no NOT IN (SELECT course_no FROM T_1))
    UNION
    (SELECT course_no FROM T_1 WHERE course_no IN (SELECT course_no FROM T_2))
    

    What is about T_3?

    EDIT:

    T_1 = CS100, CS200, CS300, EE100, EE200, EE300
    T_2 = EE100, EE200, EE300, MA100, MA200, MA300
    
    q1 = T_1 - T_2 = CS100, CS200, CS300
    q2 = T_2 - T_3 = MA100, MA200, MA300
    q3 = T_1 intersect T_2 = EE100, EE200, EE300
    
    answer = q1 union q2 union q3 = CS100, CS200, CS300, MA100, MA200, MA300, EE100, EE200, EE300
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.