kuscheld around the world project

Upload: ehsan-ghasisin

Post on 07-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Kuscheld Around the World Project

    1/8

    Objectives:

    Our main objective is to apply the techniques that we learn in 338 t o provide a simple

    solution for restaurant management personnel.

    As a secondary goal, we want to create an application that will be used in the real world.We wish to accomplish the following tasks:

    1. Entity-relationship diagram for our restaurant database2. Structured Query Language (SQL)3. Design PHP Interface4. Design Web interface to connect to our database

    Application Domain:

    The purpose of our 338 project is to create a generalized restaurant management systemthat is affordable to the small business owner. Through automating normal restaurant

    tasks, our system will capture and keep data. Once the data is stored in a relationaldatabase, the restaurant manager can genera te vital reports on day-to-day, monthly, andannual operations. These reports will assist in long term planning and potential future

    growth.

    Data Collection:

    In a real setting, this RMS would get its data from the employees of the restaurant.Managers wo uld input food orders for the suppliers, make schedules, build menus and

    hire/fire people. To simulate several months of use, we will collect data (such as relevantfood items and useful employee attributes) for the RMS. We can then test the databaseoperation with real-world data and simulate the actual running of a restaurant.

    Queries:

    1. Find all food items in order by item name, item id, supplier, quantityThis query is important because management likes to know how much

    inventory, and the indivi dual details about each food item. Managementalso likes to know who the supplier is to contact and order more items.

    2. Search by nutritional informationNutritional information is very important to know due to the current healthtrends. The manager should know this information because he or she can

    order an item that has a specific nutritional requirement.

  • 8/6/2019 Kuscheld Around the World Project

    2/8

    3. Show details on items

    This query lists all the information about items, because it is veryimportant to know what a specific item is and ha s. It is also important to

    know the

    4. Order itemOrdering items is a very crucial part of running a restaurant. Without theability to order an item from supplier, a restaurant will not be able to

    function. By having this query in the management system, the restaurantis able to make the efficiency even better.

    5. Update food item informationObviously, food items will change. The cost of the item may increase or

    decrease based on the costs that the management may have to incur. Thequery will allow for easier changes and updates to the database.

    6. Delete food item informationThis is another important query for the food item table. With this query,

    the managers will be able to delete specific information or delete the entirefood item; this will make the food item table will be easier to use.

    7. List all employees sorted by name, ssn, phone #This query allows the manager to see the employees name, ssn, and

    phone number.

    8. Details of employees (schedule, etc.)Each manager would need to be able access an individual employeesinformation. With this query, the manager will be able to keep track of

    his/her employees. This will help the company by keeping an updated listof each employees work schedule.

    9. Update employeeThis query is part of the employee table. This query will help maintain the

    tables, for when employees change addresses, phone numbers, etc. Thisquery will also make the managers job easier for they wont have tomanually enter the information in.

    10. Delete employeeThis is another mana gement query that lets the manager delete employeesthat have been fired or that have quit. This query eliminated time that themanagers would have to spend to update on the table, etc.

    11.Insurance information-Insurance information is very important to the monetary operations of thecompany. It is also very important to know what insurance policy, etc. theemployee has when it insurance payments are needed for an employee.

    This query will save money for the company by keeping accurate records

  • 8/6/2019 Kuscheld Around the World Project

    3/8

    of the insurance payments, etc.

    12.List orders sorted byFinancial statement that will determine how profitable the restaurant is.

    To stay in business a company must be profitable. If the business were

    not keeping track of profit, then that would defeat the purpose of starting abusiness. We selected dates and then calculated total revenue by

    subtracting total expenses from total revenue in Perl to give our databasebetter performance.

    13.Process ordersProcess orders query is a very important query for the entire management

    system. When the process orders button is clicked, the inventoryrecords are updated based on what information is selected. This query

    keeps an accurate count

    14.Add supplier and update the supplierThis query works with the supplier table. The manager can modify thesuppliers table based on any change in an individual supplier. A supplier

    can change for many reasons, (change suppliers or the supplier couldmove, change addresses, etc.)

    15.Add food itemThis is another important query on the food item table. The manager is

    able to add various food items to the table based on specific needs ofcustomers, and the needs of the restaurant.

    16. Add EmployeeAnother feature using the Employee table. The manager is able to add a

    new employee to the table and modify accordingly.

    17. Search for shift

    This query is very important for the manager who working during aspecific shift. With this query, the manager can search and know who is

    supposed to be working. This query will allow for more effi cientmanagement of the employees during the day.

    18. List all shiftsThis is another important query. The main manager can view who is

    supposed to be working for the day.

    19. Show all information on a selected item

    Indexing

    We index all of our tables by the primary key.

  • 8/6/2019 Kuscheld Around the World Project

    4/8

    Optimization

    We helped optimize the menu query by indexing it by mcid. We felt this was

    important since this is all orders are inputted; therefore, it needs to be processed quickly.The rest of database was optimized based on the amount of times the query would

    run in the average week. Queries that were not going to be run often we did not try tooptimize as thoroughly as the queries that would be run every day. Optimization on these

    included making sure that there were as little select statements ran inside the where andfrom clause as possible.

    Normalization

    We did not use normalization due to the fact that it slows down the queries and causes theweb-based interface to be slower.

    Workload

    1. Pre-Project Proposal2. Final Project Proposal

    a) Define requirementsb) ER diagramc) Data Collectiond) Relational Schemae) Queriesf) Schedule Proposal

    3. Design4. Interface5. Test6. Present

  • 8/6/2019 Kuscheld Around the World Project

    5/8

    Relational Scheme

    CREATE TABLE Orders(OrderId varchar2(10),

    Amount varchar2(10),TotalCost varchar2(10),Odate varchar2(8),

    ItemID varchar2(10),Rphone varchar2(10)

    PRIMARY KEY (OrderId),

    FOREIGN KEY (ItemID) REFERENCES Fooditem,FOREIGN KEY (Rphone) REFERENCES Restaurant);

    CREATE TABLE Restaurant(

    Rname varchar2(20),Rstreet varchar2(30),Rcity varchar2(20),

    Rstate varchar2(2),Rzip varchar2(10),

    Members Duties

    Alex Disov 1. SQL design2. ER Diagram3. Proposal4. Coding5. Query optimization

    Andy Fanning 1. SQL design2. ER Diagram3. Relational Schema4. Coding5. Web Designing Interface

    Doug Kuschel 1. SQL Design2. Data Collection3. ER Diagram4. Coding5. Proposal6. User Manual

    Aaron Meyer 1. Pre-Proposal2. ER Diagram3. SQL Design4. Coding5. Design/Implement Web Interface

    Sara Reed 1. SQL design2. ER Diagram3. Proposal4. Design Web Interface5. Query optimization

  • 8/6/2019 Kuscheld Around the World Project

    6/8

    Rphone varchar2(10),PRIMARY KEY (Rphone);

    CREATE TABLE Suppliers(

    SupplierID varchar2(10),

    Sname varchar2(20),Sstreet varchar2(30),

    Scity varchar2(20),Sstate varchar2(2),

    Szip varchar2(10),Sphone varchar2(10)PRIMARY KEY (SupplierID));

    CREATE TABLE FoodItem(

    ItemId varchar2(10),SupplierID varchar2(6),Cost varchar2(10),

    ItemName varchar2(20),Quantity varchar2(10)

    PRIMARY KEY (ItemId),FOREIGN KEY (SupplierID) REFERENCES Suppliers ON DELETECASCADE);

    CREATE TABLE Employees(

    Rphone varchar2(10),Ssn varchar2(9),Ename varchar2(20),

    Ephone varchar2(10),Estreet varchar2(30),

    Ecity varchar2(20),Estate varchar2(2),Ezip varchar2(10),

    Type varchar2(10),Wage varchar2(10),

    Hours varchar2(3);

    CREATE TABLE Lifepolicy(

    PolicyID varchar2(10),SSN varchar2(9),

    Lcost varchar2(10),PRIMARY KEY (PolicyID),FOREIGN KEY (ssn) REFERENCES Employees ON DELETE

    CASCADE);

    CREATE TABLE Purchases(

    Fid number(38),

    Userid number(38),

  • 8/6/2019 Kuscheld Around the World Project

    7/8

    Orderdate date ;

    CREATE TABLE Schedule(

    Rphone varchar2(10),

    Ssn varchar2(9),Starts varchar2(9),

    Ends varchar2(9),Managesince varchar2(10);

    PRIMARY KEY (Ssn),FOREIGN KEY (Rphone) REFERENCES Restaurant,FOREIGN KEY (Ssn) REFERENCES Employees);

    CREATE TABLE Nutritioninfo(

    ItemID number,Fat number,

    Calories number,Cholesterol number,

    FOREIGN KEY (ItemID) REFERENCES Fooditem ON DELETECASCADE;

    CREATE TABLE Dependents(

    Ssn varchar2(9),Dage varchar2(3),Dstreet varchar2(30),

    Dcity varchar2(20),Dstate varchar2(2),

    Dzip varchar2(10),PolicyID varchar2(10),Dname varchar2(30),

    PRIMARY KEY (Ssn),FOREIGN KEY (PolicyID) REFERENCES Lifepolicy);

    Conclusion

    This database design is for any restaurant. The data entered is just sample data, itcan easily be changed to fit any restaurants needs, and can be expanded to have morefeatures for different restaurants' desires. The new sys tem helps the company analyze the

    data quicker and saves time on the numerous amounts of paper work that they currentlydo. Queries such as time sheet management and food management queries will greatly

    enhance the overall productivity of the average rest aurant. These are so helpful mainlybecause they greatly speed up the mundane tasks that can be accomplished by a computerin a fraction of the time. This results in managers spending less time with accounting and

  • 8/6/2019 Kuscheld Around the World Project

    8/8