Sei sulla pagina 1di 2

CSC-363 Final Project

Michael Loeser
Patrick Gonzalez
Chris Holmes

Rewards application database

PROJECT DESCRIPTION:
The project is a small customer purchase, award, and reward tracking system. It takes
customer data including basic name, email, phone info, provides for quick lookups while
completing a transaction. Lookups will be done using phone number or email address.

The system can take transaction information and record point-based awards for a variety of
reasons in response to the transactions, or birthday, or whatever. Awards will generate
records in the Awards table. These records will record point earns (negative records for
returns and other purposes are also possible).

Customer redemption of their awarded points will be recorded in the Rewards table. These
records will be recorded as positive point amounts. The total current points will be the total
of points in awards – total points in rewards. Awards and Rewards are recorded in separate
tables to allow for better performance and support easy querying for separate statement
displays.

The summary table will be updated with each award and reward, potentially by an offline
process or triggered calculation to reduce the impact of system performance on large queries
on the award and reward tables. This data will be used for customer detail displays and for
validation that the customer has existing points to use before a reward can be created.

The basic elements are:


- customer lookup
- customer transaction statement
- customer award statement
- tracking of customer rewards (award points redeemed)
- awards could be given for any reason, tracked by a selection of reason
- awards will all be in points
- rewards could be used for any amount of points
- rewards will also have a reason selection

Design Description:

DB follows 3rd normal form using relationships for data where needed. The customer table
has all related information in the table because these values are all queried together when
doing lookups to find customers by either phone or email. The customer id pk value
generated in this table is a fk relationship in the other tables.

The award table has fk relationships to the customer table and the award type table. The
transaction table reference, transaction_id, is nullable since awards could be generated for
non-transaction purposes. These relationships could easily have been extracted to another
table but this is a low volume table and will be well indexed.

Project Files Included:


- rewards_er_diagram.pdf
o ER diagram for the rewards database tables
o Shows all columns and relationships
o Exported from MySql Workbench as a pdf
- reward_schema.sql
o defines the tables, primary and foreign key relationships, indexes, etc. for the tables in
the rewards database
- rewards_data_inserts.sql
o insert statements and test queries to add data to each of the tables
o inserts follow the relationships for the tables and are examples of how the database
would be used in a production example
o delete statements to allow re-insert are also included as commented statements
- rewards_queries.sql
o a list of example queries showing real world uses of the tables
o comments included with the queries describe the specific use and data values being
retrieved
- rewards_view.sql
o an example of a customer and summary data view
o comments in the script describe the details and expected use of the view
- rewards_procs.sql
o added for extra credit
o a list of example stored procedures
o examples provided include comments describing their purpose and data retrieved
o examples of calls to the procs are included as commented statements at the top of the
script

Potrebbero piacerti anche