Functional Requirements

1
Menus
The menu system will be divided into Customers, Sales, Inventory, and Maintenance.
Employ...
COMM DECIMAL(7,2),
PRIMARY KEY (ID) )


create table customer
(CUST_ID SMALLINT NOT NULL,
CUST_NAME VARCHAR(25) not null,
...
where cust_id = 1


Make Payment: This will add a lease payment to the customers account.
update customer
set cust_balance...
WARRID SMALLINT,
STATUS CHARACTER (1) NOT NULL,
RECEIVED DECIMAL (7, 2)          NOT NULL       ,
PRIMARY KEY ( SALEID)   ...
where saleid = 1;


           update customer
           set cust_balance = cust_balance + 600
           where cust_id =...
create table inventory
(vehicleid unique smallint,
vclass char(1),
makername char(10),
model char(10,
year smallint,
price...
create table supplier
(ID SMALLINT NOT NULL.
SUPNAM VARCHAR(15))
db2 " import from 'supplyfile' of del insert into supplie...
SELECT *
           from inventory where condition = 'n'
       7. Search Used Vehicles: Find all used vehicles.
         ...
(partid unique smallint not null,
supplier char(10),
model char(15),
qty integer)


       1.   Check Warranty: Find the w...
Upcoming SlideShare
Loading in …5
×

Functional Requirements

1,118 views
1,040 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,118
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Functional Requirements

  1. 1. Functional Requirements 1 Menus The menu system will be divided into Customers, Sales, Inventory, and Maintenance. Employee table: db2+>create table employee db2 " import from 'empfile' of del insert into employee" (empID UNIQUE SMALLINT NOT NULL, empNAME VARCHAR(9), empJOB CHAR(5) CHECK (JOB IN ('Sales', 'Mech','Staff')), SALARY DECIMAL(7,2), SALES SMALLINT NOT NULL , PRIMARY KEY (empno) ) CREATE INDEX ID ON EMPLOYEE (empno ASC) create table employee (empID SMALLINT NOT NULL, empNAME VARCHAR(25), empJOB CHAR(5) CHECK (empJOB IN ('Sales', 'Mech','Staff')), SALARY DECIMAL(7,2), SALES SMALLINT, PRIMARY KEY (empID) ) ; Customer create table customer (CUST_ID SMALLINT NOT NULL, CUST_NAME VARCHAR(9),
  2. 2. COMM DECIMAL(7,2), PRIMARY KEY (ID) ) create table customer (CUST_ID SMALLINT NOT NULL, CUST_NAME VARCHAR(25) not null, cust_address varchar(25) not null, cust_phone numeric(10, 0) not null, cust_balance decimal(10, 2) with default 0, cust_leaseexpiry date, PRIMARY KEY (CUST_ID) ) ; The customer module will create a table of customers along with tracking previous customer's transactions including financing. Create Customer: this will add an entry in a Customer table including name, address, and a unique identifier to track future records. insert into customer (cust_id, cust_name, cust_address, cust_phone, cust_balance) values (3, 'han solo', 'gegegegege', 000, 0) Update Customer: this will allow for the updating of fields in the Customer table. This will include the customer name, address and phone numer. update customer set cust_name = 'ailsejf' where cust_id = 1 update customer set cust_address = 'ailsejf' where cust_id = 1 update customer set cust_phone = '1234567890'
  3. 3. where cust_id = 1 Make Payment: This will add a lease payment to the customers account. update customer set cust_balance = cust_balance - 200 where cust_id = 1 Check Customer: Query for outstanding customer debts, remaining lease, and previous purchases. select cust_balance, (cust_leaseexpiry - current date) remaining_days from customer where cust_id = 2 Book Test Drive: Add an entry in the Schedule table with the salesperson id, date, customer id, and customer number to confirm or cancel the booking. Check if the maintenance department has a conflicting booking. Test Drive Schedule: Outputs upcoming test drive bookings from the schedule table. Sales The sales module tracks the sales of each salesperson for the purposes of the payroll department. It also tracks customers purchase to facilitate maintenance and warranty repair when required. Queries will be made to see employee sales records, and vehicle popularity for ordering of stock. The menu will include: create table sales (saleid unique smallint not null, custid smallint, vechid smallint, CREATE TABLE SALES (SALEID SMALLINT NOT NULL, CUSTID SMALLINT NOT NULL, EMPID SMALLINT NOT NULL, VECHID SMALLINT NOT NULL,
  4. 4. WARRID SMALLINT, STATUS CHARACTER (1) NOT NULL, RECEIVED DECIMAL (7, 2) NOT NULL , PRIMARY KEY ( SALEID) ) ; 1. Add Sale: this will add an entry in the Sales table with transaction id, customer number, salesperson number, vehicle number, warranty selection, and value. It will also remove the vehicle from the Inventory table. insert into sales (saleid, custid, empid, vechid, status, received) values (1, 2, 1, 1, 'O', 0) 2. Take Deposit: Take downpayment on vehicle and make vehicle unavailable for sale. update sales set received = received + 600 where saleid = 1; update customer set cust_balance = cust_balance - 600 where cust_id = (select custid from sales where saleid = 1); update vehicle set status = 'On Order' where saleid = 1; 3. Return Deposit: Return deposit to customer and make vehicle available again. update sales set received = received - 600
  5. 5. where saleid = 1; update customer set cust_balance = cust_balance + 600 where cust_id = (select custid from sales where saleid = 1); update vehicle set status = 'On Order' where saleid = 1; 4. Add Trade: This will add an entry to the Lot (see Add Vehicle under the Inventory Description) and add to the customer balance in the Sales table using the transaction id for a specific sale. Trades will not be considered if the lot is full. 5. Add Lease: This will add an item to the Sales table similar to Add Sale, but the monthly rate and remaining payments are linked to the customer record. 6. Return Lease: Adds the leased vehicle back to the inventory and calculates the balance due by the customer. 7. Lease Quote: Query the database to calculate the monthly payments required with a given downpayment. 8. Add Warranty: This will add a warranty to a previous purchase as long as the purchase was within the last year. Add 5% to purchase cost. 9. Monthly Sales: Output a list of each employee by number by looking up the total sales in the Sales table and displaying their count. SELECT empid from EMPLOYEE where JOB = 'Sales' Inventory The inventory module lists types of vehicles with an identifier for cross referencing. Queries will be made to find specific vehicles by type, make, year, and warranty. The inventory is restricted to 100 vehicles according to our lot size. The menu will include:
  6. 6. create table inventory (vehicleid unique smallint, vclass char(1), makername char(10), model char(10, year smallint, price integer, condition char(1), mileage integer) create table vehicle (vehicleid smallint not null, vclass char(20) not null, makername char(20) not null, model char(20) not null, year integer not null, price longint not null, condition char(11) CHECK (condition IN ('Good', 'Rebuilt', 'Salvage', 'Irreparable')), mileage integer not null, status char(10) check (condition in ('Inventory', 'On Order', 'Sold', 'Test Drive', 'Stolen')), primary key (vehicleid)); create table parts (itemid smallint not null, itemtype char(9) check(itemtype in ('Tire', 'Motor Oil', 'Grease', 'Wheel', 'Fuse', 'Battery')), status char(1), primary key (itemid));
  7. 7. create table supplier (ID SMALLINT NOT NULL. SUPNAM VARCHAR(15)) db2 " import from 'supplyfile' of del insert into supplier" create table order (oderid unique smallint not null, supplier char(10), model char(15), year smallint, qty smallint, orderon DATE, recievedon DATE) 1. Add Vehicle: This will add an entry in the Inventory table with the vehicle class (van, truck or car), manufacturer, model, model year, odometer reading along with a unique identifier. 2. Edit Vehicle: Output the vehicle information according to the vehicle id number, and then receive requests for changes. 3. Search Manufacturer: Output all entries in the Inventory of a specific manufacturer. SELECT * from inventory where makername = 'pontiac' 4. Search Price Range: Find all vehicles in a particular price range. SELECT * from inventory where price (BETWEEN 100 AND 100000) 5. Search Class: Find all Vans/Trucks/Cars. SELECT * from inventory where vclass = 'c' 6. Search New Vehicles: Find all new vehicles.
  8. 8. SELECT * from inventory where condition = 'n' 7. Search Used Vehicles: Find all used vehicles. SELECT * from inventory where condition = 'u' 8. Search Year Range: Find all vehicles in a particular year range. SELECT * from inventory where year (BETWEEN 1999 AND 2010) 9. Order Vehicle: This will order a particular vehicle if there is a customer request or to restock after purchases. This will be added to the Order table till the vehicle is recieved when it will be moved to the inventory. INSERT INTO order values(oderid,supplier, model, year, qty) 10. Recieve Order: This will add an entry to the inventory and fill the Order table. 11. Outstanding Order: Displays all products on order. SELECT * from order where recievedon = NULL A method for combining 5-8 should be possible to refine a search for particular customer requests. Maintenance The maintenance module will track the maintenance schedule of the vehicles sold, inspect trades, and order parts for maintenance. The menu will include: create table schedule (id smallint not null, vehicleid smallint, empid smallint, booking DATE) create table parts
  9. 9. (partid unique smallint not null, supplier char(10), model char(15), qty integer) 1. Check Warranty: Find the warranty status in the Sales table according to vehicle id. SELECT warranty from sales where vehcleid = '12345' 2. Inspect Vehicle: Adds a booking on the Schedule table with the vehicle id, employee id, and date. INSERT INTO schedule values(id, vehicleid, empid, booking) 3. Book Maintenance: Add entry into the Schedule table, with the vehicle id, employee id, date, and customer number. INSERT INTO schedule values(id, vehicleid, empid, booking) 4. Vehicle History: Output previous repair work done on vehicle. SELECT * from schedule where vehicleid = '12345' 5. Order Part: This will add part to the Order table and will be linked to a work order in the maintenance schedule. INSERT INTO order values(oderid,supplier, partname,qty, orderon)

×