Docsity

Rbms requirementsdocumentcs532 2015, Lecture notes of Database Management Systems (DBMS)

Toggle sidebar
bg1
Requirements Document for a Retail Business Management System
(Data and Constraints)
1. Introduction
The objectives of the Retail Business Management System (RBMS) are to allow
• clerks of the business to check product inventory and product sales discount information;
• authorized managers of the business to additionally check sales statistics, order products,
hire/fire employees, etc.
Note: This system is not meant to be a complete retail business management system. Much
simplification is made to make the system more manageable as a course project.
2. Information to be contained
The following information will be stored in RBMS.
1) Employee information
• For each employee, we keep the following information. (Suggested attribute names
are in parentheses): An employee id number (eid), a name (ename), an address
(address), a telephone number (telephone#), the date when the employee started to
work (start_date) and position (position).
• An employee can be either a manager or a clerk; that is, the position has only two
possible values, “clerk” and “manager”.
• For each clerk, we also keep a salary rate (hourly_rate) and the number of hours
worked in the current pay period (hours).
• For each manager, we keep the following additional information: the date when the
employee was promoted to a manager (prom_date) and an annual salary rate (salary).
Note that managers do not have hourly rate and hours.
• All employees are uniquely identified by eid.
• In addition, the following are assumed to be true: (a) clerks who start to work on the
same day have the same hourly rate; (b) managers who are promoted at the same
time have the same annual salary rate; (c) no clerk can work for more than 100 hours
per pay period (two weeks); and (d) different addresses have different telephone
numbers.
2) Product information
• Each product represents one type of items sold at the retail business. For each
product, we keep: a product id number (pid), a product name (pname), quantity on
hand (qoh), a threshold that will trigger a reminder to increase inventory if the
quantity on hand falls below the threshold (qoh_threshold), unit purchase price from
the supplier (original_price), a description about the product (description), the
current discount category (discnt_category), and the current discount rate
PAGE 1
pf3

Partial preview of the text

Download Rbms requirementsdocumentcs532 2015 and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

Requirements Document for a Retail Business Management System

(Data and Constraints)

1. Introduction

The objectives of the Retail Business Management System (RBMS) are to allow

  • clerks of the business to check product inventory and product sales discount information;
  • authorized managers of the business to additionally check sales statistics, order products, hire/fire employees, etc.

Note: This system is not meant to be a complete retail business management system. Much simplification is made to make the system more manageable as a course project.

2. Information to be contained

The following information will be stored in RBMS.

  1. Employee information
  • For each employee, we keep the following information. (Suggested attribute names are in parentheses): An employee id number (eid), a name (ename), an address (address), a telephone number (telephone#), the date when the employee started to work (start_date) and position (position).
  • An employee can be either a manager or a clerk; that is, the position has only two possible values, “clerk” and “manager”.
  • For each clerk, we also keep a salary rate (hourly_rate) and the number of hours worked in the current pay period (hours).
  • For each manager, we keep the following additional information: the date when the employee was promoted to a manager (prom_date) and an annual salary rate (salary). Note that managers do not have hourly rate and hours.
  • All employees are uniquely identified by eid.
  • In addition, the following are assumed to be true: (a) clerks who start to work on the same day have the same hourly rate; (b) managers who are promoted at the same time have the same annual salary rate; (c) no clerk can work for more than 100 hours per pay period (two weeks); and (d) different addresses have different telephone numbers.
  1. Product information
  • Each product represents one type of items sold at the retail business. For each product, we keep: a product id number (pid), a product name (pname), quantity on hand (qoh), a threshold that will trigger a reminder to increase inventory if the quantity on hand falls below the threshold (qoh_threshold), unit purchase price from the supplier (original_price), a description about the product (description), the current discount category (discnt_category), and the current discount rate

(discnt_rate). Four discount categories are allowed: 1, 2, 3 and 4. Discount rate is determined by the discount category. Furthermore, the discount effective period is indicated by a start date (discnt_start_date) and the number of days (discnt_days) of the discount. Products are uniquely identified by pid.

  1. Supplier information
  • For each product supplier, we keep: a supplier id number (sid), a supplier name (sname), a supplier city (city), a telephone number (telephone#) and an email address (email_addr). Suppliers are uniquely identified by sid. A telephone number is required but email address is optional. Different suppliers have different telephone numbers and different email addresses (if exist).
  1. Supply information
  • We keep track of which supplier supplies what products and the date (date) and quantity (quantity) of each supply transaction. It is assumed that a supplier may supply multiple products and the same product may be supplied by multiple suppliers. We further assume that the same supplier may supply the same product multiple times but no more than once each day.
  1. Customer information
  • Anyone who made a purchase from the retail business becomes a customer of the business. It is assumed that for each customer, we can find and keep the following information: a customer id (cid), a name (cname) with first name (firstname) and last name (lastname), an address (address), a telephone number (telephone#), the number of times the customer has made purchases at the business (visits_made), and the most recent date the customer visited the business (last_visit_date). Customers are uniquely identified by cid. It is assumed that different addresses have different telephone numbers.
  1. Purchase information
  • (^) Each purchase involves a customer buying a product from an employee (i.e., a clerk or a manager). Additionally, for each purchase, we keep track of the quantity purchased (qty), the unit price (unit_price), the total price (total_price), and the time of the purchase (ptime).

3. Integrity Constraints

Many integrity constraints have been included in the description in Section 2. The following describes additional constraints that need to be maintained.

  • No customer can buy more quantity of a product than the quantity on hand of the product.
  • All discounts that start on a same date with the same discount category will end on a same date. For example, suppose two products P1 and P2 both started a category 2