What would be the outcome?

The following data exists in the PRODUCTS table:
PROD_ID PROD_LIST_PRICE
———————————————-123456 152525.99
You issue the following query:
SQL> SELECT RPAD(( ROUND(prod_list_price)), 10,’*’)
FROM products
WHERE prod_id = 123456;

What would be the outcome?

The following data exists in the PRODUCTS table:
PROD_ID PROD_LIST_PRICE
———————————————-123456 152525.99
You issue the following query:
SQL> SELECT RPAD(( ROUND(prod_list_price)), 10,’*’)
FROM products
WHERE prod_id = 123456;

What would be the outcome?

A.
152526****

B.
**152525.99

C.
152525**

D.
an error message

Explanation:
The LPAD(string, length after padding, padding string) and RPAD(string, length after padding,
padding string) functions add a padding string of characters to the left or right of a string until it
reaches the specified length after padding.



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Alisha

Alisha

please help me with the answer

mirac

mirac

round(152525.99) –> 152526 –> rounds value 152525.99 to a number with zero (default) decimal spots;
rpad(1525256,10,’*’) –> adding ‘*’ to 152526 to get size of 10 –> 152526****

Alisha

Alisha

what does rpad do?

TSEKOS

TSEKOS

fulfill the missing positions with the character defined in this case in the right part. In this case with 4 asterisco