Searching for "number"

Q:

What are Number Functions in SQL?

Answer

- ABS(number)

Returns the absolute positive value of an expression.
Syntax:
ABS(expression)
Example:
SELECT ABS(-1.0), ABS(0.0), ABS(1.0)
Output:
1.0    .0    1.0

- CEIL(number)

Returns the smallest integer greater than, or equal to, the specified numeric expression.
Syntax:
CEILING(expression)
Example:
SELECT CEILING($223.45), CEILING($-223.45), CEILING($0.0)
Output:
224.00    -223.00        0.00

- FLOOR(number)

Returns the largest integer less than, or equal to, the specified numeric expression.
Syntax:
FLOOR(expression)
Example:
SELECT FLOOR($223.45), CEILING($-223.45), CEILING($0.0)
Output:
223.00      -224.00        0.00

- MOD(number, divisor)

Returns the remainder of the division from 2 integer values.
Syntax:
MOD(dividend, divisor)
Example:
SELECT MOD(20,3)
Output:
2

- POWER(number, power)

Returns the exponential value for the numeric expression.
Syntax:
POWER(number, power)
Example:
SELECT POWER(2.0, 3.0)
Output:
8.0

- SIGN(number)

Returns the sign i.e. positive or negative value for the numeric expression. It returns -1 for negative expressions, a value of 0 for zero
Syntax:
SIGN(number)
Example:
SELECT SIGN(4)
Output:
1

- ROUND(number, precision)

Returns the numeric value rounded off to the next value specified.
Syntax:
ROUND(number, number of places)
Example:
SELECT ROUND(1.3456, 2)

- SQRT(number)

Returns the square root value of the expression.
Syntax:
SQRT(number)
Example:
SELECT SQRT(4.0)
Output:
2.0

- TRUNC(number, precision)

Returns a numeric value that truncate to the specific places
Syntax:
TRUNCATE(number,places)
Example:
SELECT TRUNCATE(1.3456, 2)
Output:
1.34

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle

Q:

How do you generate Sequence number in Datastage?

Answer

Sequence numbers can be generated in Datastage using certain routines. They are


-KeyMgtGetNextVal


-KeyMgtGetNextValConn

Report Error

View answer Workspace Report Error Discuss

Q:

Write an SQL Query find number of employees according to gender whose DOB is between 01/01/1960 to 31/12/1975.

Answer

SELECT COUNT(*), sex from Employees  WHERE  DOB BETWEEN ‘01/01/1960 ' AND ‘31/12/1975’  GROUP BY sex;

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

Q:

The average expenditure of the hotel when there are 10 guests is Rs. 60 per guests and the average expenditure is Rs.40 when there are 20 Guests. If it is known that there are some fixed expenses irrespective of the number of guests then the average expenditure per guest  whe there are 40 guests in the hotel.

A) Rs. 30 B) Rs. 25
C) Rs. 20 D) can't be determined
 
Answer & Explanation Answer: A) Rs. 30

Explanation:

Let the fixed expenditure of the hotel be Rs.x and the variable expenditure ( which is dependent on the guest ) is Rs.y , then 

          x + 10y = 600        ---------(1)

          x + 20y = 800       ----------(2)

From (1) & (2)

10y = 200 

=>  y = Rs. 20   and    x= 400

 

Hence the total expenditure when there are 40 guests = 400 + 40 x 20 = 1200

 

Therefore,  average expenditure = 1200/40 = Rs. 30

Report Error

View Answer Report Error Discuss

Filed Under: Average

Q:

Out of the five integral numbers C is the average of A and D.  B is greater than C and less than D.Also B is the average of A and E . The middle most number in the sequence 

A) A B) B
C) C D) D
 
Answer & Explanation Answer: B) B

Explanation:

     D _  C  _ A          --------(1)

     D > B > C           --------(2)

from (1) and (2)

     D > B > C > A   ---------(3)

 

Again      E _ B _ A

But B > A, from (3)

So          E > D > B > C > A      [ Since B is the average of E and A so it is eqidistant from both E and A]

Report Error

View Answer Report Error Discuss

Filed Under: Average

Q:

The average of any 5 consecutive odd natural numbers is k . If two more such numbers , just next to the previous 5 numbers are added , the new average becomes

A) 2(k+1) B) 2k-3
C) 2k+1 D) k+2
 
Answer & Explanation Answer: D) k+2

Explanation:

The 5 consecutive odd numbers whose average is k are  (k-4), (k-2), k, (k+2), (k+4)

Again the average of (k-4), (k-2), k, (k+2), (k+4), (k+6), (k+8) is (k+2)

Report Error

View Answer Report Error Discuss

Filed Under: Average

Q:

123 typists typeed 984 papers in 1/15 hour. The number of papers typed for  minute by a average typist is:

A) 1 B) 2
C) 3 D) 5
 
Answer & Explanation Answer: B) 2

Explanation:

Use unitary method:

In \inline \frac{1}{15} hours, 123 typists can type 984 paper

In 1 minute, 123 typists can type  \inline \frac{984}{4} = 246 papers

In 1 minute, 1 typist can type \inline \frac{246}{123} =2 papers      [ Hint \inline \frac{1}{15} hours = 4 minutes]

Report Error

View Answer Report Error Discuss

Filed Under: Average

Q:

The number of oranges in three baskets are in the ratio of 3 : 4 : 5. In which ratio the no. of oranges in first two baskets must be increased so that the new ratio   becomes 5 : 4 : 3?

A) 1:3 B) 2:1
C) 3:4 D) 2:3
 
Answer & Explanation Answer: B) 2:1

Explanation:

Let,   B1 : B2 : B3 = 3x : 4x : 5x 

 

again  B1 : B2 : B3 = 5y : 4y : 3y

 

Since there is increase in no.of oranges in first two baskets only, it means the no. of oranges remains constant in the third basket

 

Therefore,   5x = 3y

 

Hence    3x : 4x : 5x   =>   9y5:12y5:15y5 = 9y:12y:15y

 

and       5y : 4y : 3y   =>   25x : 20x : 15x

 

Therfore, increment in first basket = 16

 

Increment in second basket = 8

 

Thus, required ratio = 16/8 = 2:1

Report Error

View Answer Report Error Discuss

Filed Under: Ratios and Proportions