4.9k views
5 votes
using the software.plans table, calculate how much revenue the company makes each day for each plan. include columns for the plan id and the daily revenue amount rounded to 2 decimal places.

User Elegant
by
7.3k points

1 Answer

6 votes

Final answer:

To calculate daily revenue for each plan, multiply the number of subscribers by the plan's price and divide by the number of days in the billing cycle. Round the result to two decimal places and include columns for plan ID and daily revenue in the results.

Step-by-step explanation:

To calculate how much revenue a company makes each day for each plan using the software.plans table, you would need to know the number of subscribers to each plan and the price of the plan. Assuming the table contains this information, the formula for calculating daily revenue for each plan is:

  1. Multiply the number of subscribers by the price of the plan to get the total revenue.
  2. Divide the total revenue by the number of days in the billing cycle to get the daily revenue.
  3. Round the result to two decimal places as instructed.

Include columns for the plan ID and the daily revenue amount in your final output to clearly display the results.

Example SQL query:

SELECT plan_id, ROUND((price * subscribers) / billing_cycle_days, 2) AS daily_revenue FROM software.plans;

User Qingkejin
by
7.0k points