Question

In: Computer Science

Using SET operations, display a list of customers that are interested in a car (prospect table)...

Using SET operations, display a list of customers that are interested in a car (prospect table) of the same make and model which they already own.

Solutions

Expert Solution

The set operations are UNION, UNION ALL, INTERSECT and MINUS.

Let us use each one of them for the above question.

UNION operator- The UNION set operator returns the combined results of the two SELECT statements and returns the duplicates from result.

query:

SELECT custname, carmake, carmodel

FROM prospect

UNION

SELECT custname, carmake, carmodel

FROM prospect;

UNION ALL operator- The UNION ALL set operator is similar to UNION operator but it retains the duplicates in the final result

query:

SELECT DISTINCT custname, carmake, carmodel

FROM prospect

UNION ALL

SELECT DISTINCT custname, carmake, carmodel

FROM prospect;

INTERSECT operator - The INTERSECT lists only records that are common to both the SELECT queries.

query:

SELECT custname, carmake, carmodel

FROM prospect

INTERSECT

SELECT custname, carmake, carmodel

FROM car;

MINUS operator - The MINUS set operator removes the second query's results from the output if they are also found in the first query's results.

SELECT custname, carmake, carmodel

FROM prospect

MINUS

SELECT custname, carmake, carmodel

FROM car;


Related Solutions

How to Prospect For New Customers Background Pete Tsuleff has been interested in the food and...
How to Prospect For New Customers Background Pete Tsuleff has been interested in the food and beverage industry since he was a little boy. His father owned a restaurant/tavern. Tsuleff spent his evenings, weekends, and summers working in the restaurant. At age 21, he began to work as a bartender. He had firsthand experience ordering food, hiring, firing, and running the entire operation by the time he was 25. At age 30, he bought his father out. During the next...
How to Prospect For New Customers Background Pete Tsuleff has been interested in the food and...
How to Prospect For New Customers Background Pete Tsuleff has been interested in the food and beverage industry since he was a little boy. His father owned a restaurant/tavern. Tsuleff spent his evenings, weekends, and summers working in the restaurant. At age 21, he began to work as a bartender. He had firsthand experience ordering food, hiring, firing, and running the entire operation by the time he was 25. At age 30, he bought his father out. During the next...
For the following sample, display the data using a frequency distribution table and then using a...
For the following sample, display the data using a frequency distribution table and then using a histogram . Assume the data is continuous and measured on a ratio scale. 23 21 18 17 17 15 20 3 4 28 16 15 15 15 27 2 3 15 16 16 a) How would you describe the shape of the distribution? b) Which is the most appropriate measure of central tendency? c) Calculate the most appropriate measure of central tendency.
Write a program to display privilege list of the roles and role list for privileges using...
Write a program to display privilege list of the roles and role list for privileges using many to many concept. Problem Specification: 1. Prefill the data for roles and privileges. 2. Create a menu 1. Assign privilege 2. Cancel privilege 3. Search privilege by role 4. Search role by privilege. 3. Assign privilege -- To assign specific privilege for role. 4. Cancel Privilege -- To cancel specific privilege for role. 5. Search privilege by role -- To display all the...
1. A national car rental company is interested in determining whether the mean days that customers...
1. A national car rental company is interested in determining whether the mean days that customers rent cars is the same between three of its major cities. The following data reflect the number of days people rented a car for a sample of people in each of three cities. Nizwa Sohar Muscat 5 7 7 3 7 5 7 11 8 1 5 11 2 7 15 9 3 17 a. Write down the null and alternative hypotheses to be...
1. Write the statement that will display all of the information in the PetOwner table using...
1. Write the statement that will display all of the information in the PetOwner table using the asterisk (*) notation. 2. Write the statement that will display all of the information in the PetOwner table without using the asterisk (*) notation. 3. Write the statement that will display the first and last names of the owners in that order. 4. Write the statement to display the breed, type and DOB of all pets having a type of Cat. 5. Write...
Using the following list and a “for” loop, display differences of all consecutive pairs of numbers...
Using the following list and a “for” loop, display differences of all consecutive pairs of numbers in the list. our_list = [1,2,5,6,3,77,9,0,3,23,0.4,-12.4,-3.12] The output should look like this: 1 3 1 … 4. Using a “while loop” ask the user for a number and add it to a list if number is even and to a different list if number is odd. Keep asking the user for a number until he says “I’m bored” and doesn't want to give you...
23.2 PROJECT 2 : Data Visualization using LOOPS (python) This program will display a set of...
23.2 PROJECT 2 : Data Visualization using LOOPS (python) This program will display a set of authors and the number of novels written by each author in both a table and a histogram. You will ask the user for all of the information. Using what you learned about incremental development, use the following approach to create your program: Prompt the user for the information about the table. First, ask for the title of this data set by prompting the user...
A high street store was interested to discover if the spending of customers using credit cards...
A high street store was interested to discover if the spending of customers using credit cards is different from the spending of customers using cash. A random sample of 52 customers using credit cards for a single transaction had a mean spend of £36.43 with standard deviation £12.08. A random sample of 38 customers using cash for a single transaction had a mean spend of £31.84 with standard deviation £11.27. A hypothesis test is to be performed to investigate whether...
Part (a) using the data set below on the account balances of customers at a bank’s...
Part (a) using the data set below on the account balances of customers at a bank’s four locations. Using that data set and an α of 0.05, test the null hypothesis that the mean account balances are equal in the four towns using a one-way ANOVA in Excel. using Excel file include the output as part of the answer. Part (b)    Do you reject the null hypothesis or not? Indicate on which part of the Excel output you base...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT