You are on page 1of 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 acco mplish the following tasks: 1. 2. 3. 4. Entity-relationship diagram for our restaurant database Structured Query Language (SQL) Design PHP Interface Design Web interface to connect to our database

Application Domain: The purpose of our 338 project is to create a generalized restaurant management system that 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 relational database, the restaurant manager can genera te vital reports on day-to-day, monthly, and annual 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 relevant food items and useful employee attributes) for the RMS. We can then test the database operation 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, quantity This query is important because management likes to know how much inventory, and the indivi dual details about each food item. Management also likes to know who the supplier is to contact and order more items. 2. Search by nutritional information Nutritional information is very important to know due to the current health trends. The manager should know this information because he or she can order an item that has a specific nutritional requirement.

3. Show details on items This query lists all the information about items, because it is very important to know what a specific item is and ha s. It is also important to know the 4. Order item Ordering items is a very crucial part of running a restaurant. Without the ability to order an item from supplier, a restaurant will not be able to function. By having this query in the management system, the restaurant is able to make the efficiency even better. 5. Update food item information Obviously, food items will change. The cost of the item may increase or decrease based on the costs that the management may have to incur. The query will allow for easier changes and updates to the database. 6. Delete food item information This is another important query for the food item table. With this query, the managers will be able to delete specific information or delete the entire food 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 employees information. With this query, the manager will be able to keep track of his/her employees. This will help the company by keeping an updated list of each employees work schedule. 9. Update employee This query is part of the employee table. This query will help maintain the tables, for when employees change addresses, phone numbers, etc. This query will also make the managers job easier for they wont have to manually enter the information in. 10. Delete employee This is another mana gement query that lets the manager delete employees that have been fired or that have quit. This query eliminated time that the managers would have to spend to update on the table, etc. 11. Insurance informationInsurance information is very important to the monetary operations of the company. It is also very important to know what insurance policy, etc. the employee has when it insurance payments are needed for an employee. This query will save money for the company by keeping accurate records

of the insurance payments, etc. 12. List orders sorted by Financial 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 a business. We selected dates and then calculated total revenue by subtracting total expenses from total revenue in Perl to give our database better performance. 13. Process orders Process orders query is a very important query for the entire management system. When the process orders button is clicked, the inventory records are updated based on what information is selected. This query keeps an accurate count 14. Add supplier and update the supplier This query works with the supplier table. The manager can modify the suppliers table based on any change in an individual supplier. A supplier can change for many reasons, (change suppliers or the supplier could move, change addresses, etc.) 15. Add food item This 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 of customers, and the needs of the restaurant. 16. Add Employee Another 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 a specific shift. With this query, the manager can search and know who is supposed to be working. This query will allow for more effi cient management of the employees during the day. 18. List all shifts This 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.

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 ba sed 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 to optimize 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 and from clause as possible. Normalization We did not use normalization due to the fact that it slows down the queries and causes the web-based interface to be slower.

Workload 1. Pre-Project Proposal 2. Final Project Proposal a) Define requirements b) ER diagram c) Data Collection d) Relational Schema e) Queries f) Schedule Proposal 3. Design 4. Interface 5. Test 6. Present

Members Alex Disov

Andy Fanning

Doug Kuschel

Aaron Meyer

Sara Reed

1. 2. 3. 4. 5. 1. 2. 3. 4. 5. 1. 2. 3. 4. 5. 6. 1. 2. 3. 4. 5. 1. 2. 3. 4. 5.

Duties SQL design ER Diagram Proposal Coding Query optimization SQL design ER Diagram Relational Schema Coding Web Designing Interface SQL Design Data Collection ER Diagram Coding Proposal User Manual Pre-Proposal ER Diagram SQL Design Coding Design/Implement Web Interface SQL design ER Diagram Proposal Design Web Interface Query optimization

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),

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 DELETE CASCADE); 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),

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 Foo ditem ON DELETE CASCADE; 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, it can easily be changed to fit any restaurants needs, and can be expanded to have more features 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 currently do. 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 mainly because they greatly speed up the mundane tasks that can be accomplished by a computer in a fraction of the time. This results in managers spending less time with accounting and

such and more time running the restaurant and curtailing to its most important assets, the customers.

You might also like