Percentage of Revenue by Year
You are generating a yearly report for your company’s revenue sources.
Calculate the percentage of total revenue to date that was made during the first and last years recorded in the table. Round the percentages to two decimal places
Example:
Input:
annual_payments
table
Columns | Type |
---|---|
amount |
INTEGER |
created_at |
DATETIME |
status |
VARCHAR |
user_id |
INTEGER |
product |
VARCHAR |
id |
INTEGER |
Output:
Columns | Type |
---|---|
percent_first |
FLOAT |
percent_last |
FLOAT |
.....
Loading editor