The following Oracle SQL script calculates the histogram. width_bucket() and ratio_to_report() are two useful functions.
Width_buck function divides the CREDIT_SCORE into 10 equal length bins based on the minimum and maximum values.
Ratio_to_report function calculate the percentage of number of records, i.e., count(*), for each bin created by with_bucket function in step2.
tbl as (
select min(CREDIT_SCORE) low, max(CREDIT_SCORE) high
tbl2 as (
select width_bucket(CREDIT_SCORE, low, high, 10) s, CREDIT_SCORE
from CELL_PHONE_SERVICE_APPS, tbl
min(CREDIT_SCORe) lower, max(credit_score) upper,
round((ratio_to_report(count(1)) over())*100,1) pcnt
from tbl2 group by s order by s;