A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
bartleby

Concept explainers

Question
Book Icon
Chapter 5, Problem 7RQ
Program Plan Intro

Consider the below two tables for all the “UNION”, “INTERSECT”, and “MINUS” operations.

Consider two tables:

Table creation:

CREATE TABLE EMPLOYEE(NAME VARCHAR(15));

CREATE TABLE EMPLOYEE_1(NAME VARCHAR(15));

Inserting values:

INSERT INTO EMPLOYEE VALUES("Alice Cordoza");

INSERT INTO EMPLOYEE VALUES("John Cretchakoy");

INSERT INTO EMPLOYEE VALUES("Anne McDonald");

INSERT INTO EMPLOYEE_1 VALUES("John Cretchakoy");

INSERT INTO EMPLOYEE_1 VALUES("Mary Chen");

Explanation of Solution

INTERSECTset operator:

The INTERSECT set operator is used to combine the output of two or more than two queries and produce a result. The produced result contains the values (rows) that are common in both the tables.

Syntax: QUERYINTERSECTQUERY;

INTERSECT query:

SELECT * FROM EMPLOYEE INTERSECT SELECT * FROM EMPLOYEE_1;

Explanation of Solution

MINUS set operator:

The MINUS set operator is used to combine the output of two or more than two queries and produce a result. The produced result contains the values (rows) that appear in the first table but not in the second table. The word “EXCEPT” can also be used in the place of “MINUS”.

Syntax: QUERYMINUSQUERY;

MINUS query 1:

SELECT * FROM EMPLOYEE MINUS SELECT ...

Explanation of Solution

Restrictions on the table:

In order to perform any of the operations like “UNION”, “INTERSECT”, and “MINUS” operations, the tables must be union-compatible...

Blurred answer
Students have asked these similar questions
Suppose that the two Rank methods below are added to the Skip List class on Blackboard. public int Rank(T item) Returns the rank of the given item. public T Rank(int i) Returns the item with the given rank i. Requirements 1. Describe in a separate Design Document what additional data is needed and how that data is used to support an expected time complexity of O(log n) for each of the Rank methods. Show as well that the methods Insert and Remove can efficiently maintain this data as items are inserted and removed. (7 marks) 2. Re-implement the methods Insert and Remove of the Skip List class to maintain the augmented data in expected O(log n) time. Using the Contains method, ensure that added items are distinct. (6 marks) 3. Implement the two Rank methods. (8 marks) 4. Test your new methods thoroughly. Include your test cases and results in a Test Document. (4 marks)
Why do we need official standards for copper cable and fiber-optic cable? What happens without the standard?
What is the difference between physical connection (Physical topology) and logical connection (Logical topology)? Why are both necessary?
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Text book image
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning