Question

In: Computer Science

Multiple choice Consider the following ORACLE relations : One (x, y) = {<2, 5>, <1, 6>,...

Multiple choice

Consider the following ORACLE relations :
One (x, y) = {<2, 5>, <1, 6>, <1, 6>, <1, 6>, <4, 8>, <4, 8>}
Two (x, y) = {<2, 55>, <1, 1>, <4, 4>, <1, 6>, <4, 8>, <4, 8>, <9, 9>, <1, 6>}

Consider the following two SQL queries SQ1 and SQ2 :

SQ1 : SELECT * FROM One)            
          EXCEPT            
         (SELECT * FROM Two);
  
SQ2 : SELECT * FROM One)            
          EXCEPT ALL           
         (SELECT * FROM Two);

2 and 2 respectively

1 and 2 respectively

1 and 1 respectively

2 and 1 respectively

Solutions

Expert Solution

Answer: 1 and 2 respectively.

  • SQ1 : SELECT * FROM One)            
              EXCEPT            
             (SELECT * FROM Two); It eliminates the duplicate values. 
  • It's generally  {<2, 5>, <1, 6>, <1, 6>, <1, 6>, <4, 8>, <4, 8>} -  {<2, 55>, <1, 1>, <4, 4>, <1, 6>, <4, 8>, <4, 8>, <9, 9>, <1, 6>}
  • <1,6> and <4,8> Were there in the second set, so remove all occurances of them in the first set. So you will get {<2,5>} , which is only one element.
  • SQ2 : SELECT * FROM One)            
              EXCEPT ALL           
             (SELECT * FROM Two); It does not eliminate duplicate values, it keepes them as it is.
  • It's generally  {<2, 5>, <1, 6>, <1, 6>, <1, 6>, <4, 8>, <4, 8>} -  {<2, 55>, <1, 1>, <4, 4>, <1, 6>, <4, 8>, <4, 8>, <9, 9>, <1, 6>}
  • In the second set <4,8> present twice. So you can remove <4,8> , <4,8> (both) from the first set.
  • In the second set we have only two <1,6>. But in our one set we have three <1,6>. So we can remove two of them and one <1,6> will remain there.
  • So the result will be {<2,5>,<1,6>}, in which 2 elements are present.

Related Solutions

2. Consider the following data: x= 1, 2, 3, 4, 5 y =3, 2, 4, 6,...
2. Consider the following data: x= 1, 2, 3, 4, 5 y =3, 2, 4, 6, 5 By hand, not using Matlab, and showing your work: (a) Compute the correlation coefficient. (b) Find the least-squares line. (c) Find the standard deviation around the least-squares line.
Consider the following data table: x 8 5 4 6 2 5 3 y 1 3...
Consider the following data table: x 8 5 4 6 2 5 3 y 1 3 6 3 7 2 5 (15 points) Create a scatterplot of the data either by hand or with a computer.  Does there appear to be a linear relationship between x and y?  If so, what is the strength and direction of the relationship? (20 points) Give the Simple Linear Regression Model, using x as the predictor variable and y as the response variable.  What is the meaning...
Consider a set A = { 1, 2, 3, 4, 5, 6, 8} Consider these relations,...
Consider a set A = { 1, 2, 3, 4, 5, 6, 8} Consider these relations, 1. R1 = { ( a, b) | a = 3b } Can you write down the pairs ? one such pair is ( 3, 1) 2. R2 = { (a, b) | 2a = b } Can you write down the pairs ? one such pair is (2, 4) 3. R3 = { ( a, b) | a >= 2b } Can you...
Consider the following data set. x 1 2 3 4 5 6 y 3.00 0.21 0.61...
Consider the following data set. x 1 2 3 4 5 6 y 3.00 0.21 0.61 0.70 1.13 1.17 a) plot the data (y versus x). Are there any points that appear to be outliers? If there are, circle them and label as such. b) produce a regression of y against x. Add the regression line to the plot in a). Do you think that the regression line captures the most important features of the data set reasonably well? c)...
Consider the following set of ordered pairs. x 5 2 2 3 7 6 y 3...
Consider the following set of ordered pairs. x 5 2 2 3 7 6 y 3 8 5 4 2 7 a. Using alphaequals0.10​, test for the significance of the regression slope. b. Construct a 90​% confidence interval for the population slope. a. Using alphaequals0.10​, test for the significance of the regression slope. Identify the null and alternative hypotheses. Upper H 0​: beta ▼ not equals less than greater than greater than or equals equals less than or equals nothing...
Consider the following data: X Y 1 13 3 10 5 9 5 5 6 3...
Consider the following data: X Y 1 13 3 10 5 9 5 5 6 3 Draw a Scatter Plot of the data. Do you believe the correlation coefficient r will be positive, negative or close to zero? Why What is your estimate to the value of Y associated with X=4?
Consider the following five utility functions. G(x,y) = (x)1/2 + y H(x,y) = (x+1)1/2 + y...
Consider the following five utility functions. G(x,y) = (x)1/2 + y H(x,y) = (x+1)1/2 + y + 1 L(x,y) = ln(x) + y U(x,y) = x ey W(x,y) = 100 x - 4x2 + 3 y Z(x,y) = -(100 - x)2 -3 (y-200)2 Which function or functions represent the same preferences as U?   a.G b.U c.None. d.W e.Z f.L g.H
Consider the following joint distribution. X p(x,y) 2 5 Y 2 0.1 0.34 5 0.31 0.25...
Consider the following joint distribution. X p(x,y) 2 5 Y 2 0.1 0.34 5 0.31 0.25 Based on this distribution, find: E(X) Sd(Y) Corr(X,Y)
Consider the following set of ordered pairs. x 4 2 4 3 6 4 y 5...
Consider the following set of ordered pairs. x 4 2 4 3 6 4 y 5 7 7 4 2 7 ​a) Calculate the correlation coefficient. ​b) Using alpha equals 0.05​, perform a hypothesis test to determine if the population correlation coefficient is less than zero. LOADING... Click the icon to view a portion of the​ Student's t-distribution table. ​a) requals nothing ​(Round to three decimal places as​ needed.) ​b) Determine the null and alternative hypotheses. Upper H 0​: rho...
Consider the following joint distribution. X p(x,y) 2 4 Y 1 0.11 0.36 6 0.33 0.2...
Consider the following joint distribution. X p(x,y) 2 4 Y 1 0.11 0.36 6 0.33 0.2 Based on this distribution, fill in the blanks below. X p(x,y) 2 4 Y 1 0.11 0.36 6 0.33 0.2 E(X)= Sd(Y)= . Corr(X,Y)=
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT