Menu
hardPayNet · mathBasic

Charge each payout its tier's fee

Merchant payouts are charged a processing fee that depends on how large the payout is. Each payout falls into exactly one tier, and the fee is a percentage of the amount plus a flat component.

For each payout return payout_id, amount, the fee charged, and net_amount — what the merchant actually receives. Round the fee to 2 decimal places, and subtract that rounded fee to get net_amount, so the two figures agree on a statement.

Order by payout_id.

Schema

fee_tiers
tierTEXT
min_amountNUMERIC
max_amountNUMERIC
fee_pctNUMERIC
flat_feeNUMERIC
payouts
payout_idINT
merchantTEXT
amountNUMERIC

Basic

The example input, expected output, and walkthrough for this question unlock with a Basic plan.

↑ Read the question

Basic

This is a Basic question

Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.

See Basic plans

RM 25/mo · cancel anytime

Keep going

Company names are trademarks of their respective owners, used here only to describe practice material. mahir_data is not affiliated with, endorsed by, or sponsored by any company named on this site. Terms.