In: Computer Science
QUESTION 38
The ITEM table contains these columns:
COST NUBMER(7,2)
RETAIL NUMBER(7,2)
The RETAIL and COST columns must have a value that is greater than
zero.
Evaluate these two SQL Statements:
1. SELECT retail – cost * 1.25 * .10
FROM item;
2. SELECT (retail – (cost *1.25 )*.10)
FROM item;
What will be the results?
Statement 1 will return a low value than statement 2. |
||
Statement 1 and statement 2 will return the same values. |
||
Statement 1 will return a higher value than statement 2. |
||
Only one of the statements will execute. |
2.5 points
QUESTION 39
Using a second SELECT query in the same overall query is a
subquery |
||
join query |
||
cross join |
||
aggregate function |
2.5 points
QUESTION 40
select SAL from EMP where SAL between 1000 and 10000; results in (table rows are 1 to 10099)
rows 1001 to 9999 returned |
||
rows 1 to 10001 returned |
||
rows 1001 to 10000 returned |
||
rows 1000 to 10000 returned |
38) Given two queries :
1. SELECT retail – cost * 1.25 * .10
FROM item;
2. SELECT (retail – (cost *1.25 )*.10)
FROM item;
The output will be the same as the operation is multiplication only. If any other arithmetic operator is used then comes the picture of precedence.
So, Statement 1 and Statement 2 will return the same values .
So, Option 2 is correct.
39) Given : Using a second SELECT query in the same overall query is a
The answer is sub query as we go with elimination process, join query does not use select query instead uses a join command to club the tables accordingly. Cross join is one of the types of joins . Aggregate function uses min,max,sum,avg,count . so we can conclude the answer as sub query.
syntax :
SELECT column-name FROM table-name1 WHERE value IN (SELECT column-name FROM table-name WHERE condition)
So, Option 1 is correct.
40)Given : select SAL from EMP where SAL between 1000 and 10000; results in (table rows are 1 to 10099)
It returns the employees whose salary in 1000 and 10000 inclusive which means if the employee has the sal of 1000 and 10000 will be shown in the result.
So, Option 4 is correct.