4.4.4 For the purpose of promotion, the "Jintu.com" travel platform plans to reduce or exempt the accommodation fee of two-star routes by 30 yuan per day, and request to update the prices of these routes

View this chapter

View job directory


Statement of needs:

For the purpose of promotion, the "Jintu.com" travel platform plans to reduce or exempt the accommodation fee of two-star routes by 30 yuan per day, and request to update the prices of these routes

Realization ideas:

The number of stay days = the number of travel days-1. The stored procedure proc_PriceModify needs to define a cursor whose accommodation standard is the line data of a two-star hotel, traverse these line records in the cursor in turn, calculate the corresponding deduction amount according to the number of stay days, and then execute the update statement to update the line price

After the stored procedure call proc_PriceModify is successfully created, execute the stored procedure to reduce or exempt the accommodation fee of two-star routes by 30 yuan per day, and update the prices of these routes in the database accordingly

Implementation code:

Guess you like

Origin blog.csdn.net/weixin_44893902/article/details/111117607