yes, the coupon would need be stored in a database.
it would be pretty similar to the coupon code system in the tutorials section where you have form input to enter the coupon code and it gets saved to a session.
the differences would be:
-add a coupon code table to the database to store available coupon codes. have a column for used, set the default value to 0
-when the coupon form submits, use a recordset to lookup the coupon code and add a condition to the recordset to only return if the used column is 0
-in the set session value behavior to save the coupon code to a session, use the recordset not empty trigger
-on order completion, update the coupon table to set the used column to 1 for the coupon that was used.