You have table pyramid_table with 2 columns CH and NUM. It contains 1 row. The column CH contains a single character and column NUM contains a number.
Write a SQL query to Generate a pyramid of CH characters of height NUM e.g if CH is '*' and NUM is 5, the output should be :
       *
     ***
   *****
 *******
*********
Solution:
SELECT
lpad(' ',num-rownum,' ')||substr(lpad(ch,2*num,ch),1,2*rownum-1)||lpad(' ',num-rownum,' ') as pyramid
from 
pyramid_table,all_objects
where
rownum<=num
To TLS or to NNE? Postquantum hints the former
                      -
                    
When encrypting Network traffic to your database server, there are two 
different approaches. One is to use Oracle Native Encryption by setting 
SQLNET.ENCRY...
3 weeks ago
 
 

 
 Posts
Posts
 
 
No comments:
Post a Comment