Database design of Broadband Billing System application with the help of stored procedures and triggers in SQL Server.
ER Diagram for Broadband Billing System:
Data Model Diagram for Broadband Billing System:
Create Data Base:
For this purpose, created a Database Named “BBS” on the server.
- Right Click on Database in Object Explorer of SSMS
- Click on New
- And Provide the name and hit the ok button
Create Objects specified in Data Model & Add data to the “Subscription” table
Run the BBS_CreateTables script that will create the below data model in SQL.
Creation of SQL Procedures:
SP#1
Create a procedure that gets the customer’s name, customer mobile number, id proof, type, city, area, and password as inputs and registers the customer for choosing any suitable plan of broadband as per his locality.
Run the BBS_RegisterNewCustomer_prc Script to create Register New Customer
Testing Script:
— Register New Customer
|
SP#2
Create a procedure that gets the customer’s name, customer mobile number, id proof, type, city, area, and password as inputs and registers the customer for choosing any suitable plan of broadband as per his locality.
Run the BBS_ShowCurrentSubscriptionPlans_prc script:
Testing Script:
— Check Current Subscription Plans |
SP#3
Create a procedure that gives the customer all the plans available and the customer can choose anyone plans out of them as per his need and locality by taking subscription id, customer id, and month as input.
Run the BBS_ShowAllPlansToCustomers_prc Script:
Testing Script:
— Show all plans to customers |
SP#4
Create a procedure that will generate the bill for the customer’s chosen subscription plan by taking subscription id, month, and customer id as inputs.
Run the BBS_GenerageBillForCustomer_prc script:
Testing Script:
— Generate Bill for Customer
|
SP#5
Create a procedure to make a transaction for payment for the chosen transaction and will show the transaction details of the customer’s payment status.
Run the BBS_ShowPendingTranactions_prc script :
Run the script:
— Show Pending Transactions |
Trigger:
Create a trigger that gets triggered when there is any update on the bill table after the successful transaction of payment and this trigger has to change the status of the bill payment from pending to paid.
Run the below Scripts:
BBS_Transaction_Details_Update_tr Script
BBS_MakeTranactionsForPayment_prc Script
Testing Script:
— Show Pending Transactions — Make Transactions for payment |
Run the 1st SP first to get the transaction details and amount
Pass those in 2nd sp and execute it.
Then if you run the query you will see the status updated to Paid
|
End
Download the Broadband Billing System application Stored Procedure Scripts Here.